Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .merlin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EXT lwt

S async
S cohttp
S lib
S lib_test
S examples/async
S lwt
Expand All @@ -25,11 +25,12 @@ PKG ipaddr.unix
PKG conduit
PKG conduit.async
PKG conduit.lwt
PKG cmdliner

B _build/
B _build/lwt
B _build/lib_test
B _build/async
B _build/cohttp
B _build/lib
B _build/examples/async
B _build/bin
10 changes: 6 additions & 4 deletions bin/cohttp_server_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ let arglist = [

let _ =
try Arg.parse arglist (fun x -> rest := x :: !rest) usage;
begin match !rest with
| [] -> Lwt_unix.run (start_server "." !port !host !index !verbose !ssl_cert !ssl_key ())
| dir::_ -> Lwt_unix.run (start_server dir !port !host !index !verbose !ssl_cert !ssl_key ())
end
let dir =
match !rest with
| [] -> "."
| dir::_ -> dir in
Lwt_main.run (
start_server dir !port !host !index !verbose !ssl_cert !ssl_key ())
with
| Failure s -> print_endline s
| Sys_error s -> print_endline s
2 changes: 1 addition & 1 deletion lib_test/test_net_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let test_cases =
make_net_req "https://github.com/";
make_net_reqv;
] in
List.map (fun x -> "test" >:: (fun () -> Lwt_unix.run (x ()))) tests
List.map (fun x -> "test" >:: (fun () -> Lwt_main.run (x ()))) tests

(* Returns true if the result list contains successes only.
Copied from oUnit source as it isnt exposed by the mli *)
Expand Down
4 changes: 2 additions & 2 deletions lib_test/test_net_lwt_client_and_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ let _ =
|0 -> (* child / client *)
Unix.sleep 2;
Printf.eprintf "client is %d\n%!" (Unix.getpid ());
Lwt_unix.run (client ())
Lwt_main.run (client ())
|pid -> (* parent / server *)
Printf.eprintf "server is %d\n%!" (Unix.getpid ());
Lwt_unix.run (make_server ())
Lwt_main.run (make_server ())
2 changes: 1 addition & 1 deletion lib_test/test_net_lwt_google.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let body =
(* you can paste this into utop to interactively mess around *)
(* do a #require "cohttp.lwt" first *)
let open Cohttp_lwt_unix in
Lwt_unix.run (
Lwt_main.run (
Client.get Uri.(of_string "http://www.google.com/") >>= fun (r,b) ->
Cohttp_lwt_body.to_string b
)
Expand Down
2 changes: 1 addition & 1 deletion lib_test/test_net_lwt_google_custom_ctx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let () =
let ctx = Cohttp_lwt_unix.Client.custom_ctx ~resolver () in

let fetch uri =
Lwt_unix.run (
Lwt_main.run (
Cohttp_lwt_unix.Client.get ~ctx (Uri.of_string uri)
>>= fun (r,b) ->
Cohttp_lwt_body.to_string b
Expand Down
2 changes: 1 addition & 1 deletion lib_test/test_net_lwt_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ let make_server () =
let t2 = Server.create ~ctx ~mode:ssl_mode config in
t1 <&> t2

let _ = Lwt_unix.run (make_server ())
let _ = Lwt_main.run (make_server ())
2 changes: 1 addition & 1 deletion lib_test/test_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ let test_cases =
"mutate_simple_req", mutate_simple_req;
"make_simple_res", make_simple_res;
] in
List.map (fun (n,x) -> n >:: (fun () -> Lwt_unix.run (x ()))) tests
List.map (fun (n,x) -> n >:: (fun () -> Lwt_main.run (x ()))) tests

(* Returns true if the result list contains successes only.
Copied from oUnit source as it isnt exposed by the mli *)
Expand Down