@@ -24,9 +24,10 @@ open Lwt.Syntax
2424(* This file is for client-side comet-programming. *)
2525
2626open Js_of_ocaml
27+ open Eliom_lib
2728module Ecb = Eliom_comet_base
2829
29- let section = Eliom_lib. Lwt_log.Section. make " eliom:comet"
30+ let section = Lwt_log.Section. make " eliom:comet"
3031
3132module Configuration = struct
3233 type configuration_data =
@@ -184,8 +185,8 @@ let handle_exn, set_handle_exn_function =
184185 " Unknown exception during comet. Customize this with Eliom_comet.set_handle_exn_function. "
185186 in
186187 match exn with
187- | Some exn -> Eliom_lib.Lwt_log. raise_error ~section ~exn s
188- | None -> Eliom_lib. Lwt_log. debug ~section s)
188+ | Some exn -> raise_error ~section ~exn " %s " s
189+ | None -> Lwt_log. debug ~section s)
189190 in
190191 ( (fun ?exn () ->
191192 if not ! closed
@@ -408,7 +409,7 @@ end = struct
408409 (function
409410 | _chan_id , Ecb. Data _ -> ()
410411 | _chan_id , Ecb. Closed ->
411- Eliom_lib. Lwt_log. ign_warning ~section
412+ Lwt_log. ign_warning ~section
412413 " update_stateful_state: received Closed: should not happen, this is an eliom bug, please report it"
413414 | chan_id , Ecb. Full -> stop_waiting hd chan_id)
414415 message
@@ -524,17 +525,17 @@ end = struct
524525 | Eliom_request. Failed_request (0 | 502 | 504 ) ->
525526 if retries > max_retries
526527 then (
527- Eliom_lib. Lwt_log. ign_notice ~section " connection failure" ;
528+ Lwt_log. ign_notice ~section " connection failure" ;
528529 set_activity hd `Inactive ;
529530 aux 0 )
530531 else
531532 let * () = Js_of_ocaml_lwt.Lwt_js. sleep (delay retries) in
532533 aux (retries + 1 )
533534 | Restart ->
534- Eliom_lib. Lwt_log. ign_info ~section " restart" ;
535+ Lwt_log. ign_info ~section " restart" ;
535536 aux 0
536537 | exn ->
537- Eliom_lib. Lwt_log. ign_notice ~exn ~section " connection failure" ;
538+ Lwt_log. ign_notice ~exn ~section " connection failure" ;
538539 let * () = handle_exn ~exn () in
539540 Lwt. fail exn )
540541 in
@@ -547,7 +548,7 @@ end = struct
547548 call_service_after_load_end srv queue
548549 (false , Ecb. Stateful (Ecb. Commands command)))
549550 (fun exn ->
550- Eliom_lib. Lwt_log. ign_notice_f ~section ~exn " request failed" ;
551+ Lwt_log. ign_notice_f ~section ~exn " request failed" ;
551552 Lwt. return " " ))
552553
553554 let close hd chan_id =
@@ -566,8 +567,8 @@ end = struct
566567 {state with count = state.count - 1 }
567568 ! map
568569 with Not_found ->
569- Eliom_lib. Lwt_log. ign_info_f ~section
570- " trying to close a non existent channel: %s " chan_id)
570+ Lwt_log. ign_info_f ~section " trying to close a non existent channel: %s "
571+ chan_id)
571572
572573 let add_channel_stateful hd chan_id =
573574 hd.hd_activity.active_channels < -
@@ -580,7 +581,7 @@ end = struct
580581 | Ecb. Last i , Ecb. Last j -> Ecb. Last (max i j)
581582 | p , Ecb. Last _ -> p
582583 | Ecb. Last _ , p -> p
583- | _ -> Eliom_lib.Lwt_log. raise_error ~section " not corresponding position"
584+ | _ -> raise_error ~section " not corresponding position"
584585
585586 let add_channel_stateless hd chan_id kind =
586587 let pos =
@@ -714,7 +715,7 @@ let check_and_update_position position msg_pos data =
714715 match position, msg_pos, data with
715716 | No_position , None , _ -> true
716717 | No_position , Some _ , _ | Position _ , None , Ecb. Data _ ->
717- Eliom_lib.Lwt_log. raise_error ~section
718+ raise_error ~section
718719 " check_position: channel kind and message do not match"
719720 | Position _ , None , (Ecb. Full | Ecb. Closed ) -> true
720721 | Position (relation , r ), Some j , _ -> (
0 commit comments