Skip to content
Merged
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
12 changes: 7 additions & 5 deletions xenvm-local-allocator/local_allocator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,7 @@ let main use_mock config daemon socket journal fromLVM toLVM =
debug "Binding and listening on the socket";
Lwt_unix.bind s (Lwt_unix.ADDR_UNIX(config.Config.socket));
Lwt_unix.listen s 5;
let rec unix () =
debug "Calling accept on the socket";
Lwt_unix.accept s
>>= fun (fd, _) ->
let conn_handler fd () =
let ic = Lwt_io.of_fd ~mode:Lwt_io.input fd in
let oc = Lwt_io.of_fd ~mode:Lwt_io.output ~close:return fd in
(* read one line *)
Expand All @@ -490,7 +487,12 @@ let main use_mock config daemon socket journal fromLVM toLVM =
Lwt_io.flush oc
>>= fun () ->
Lwt_io.close ic
>>= fun () ->
in
let rec unix () =
debug "Calling accept on the socket";
Lwt_unix.accept s
>>= fun (fd, _) ->
async (conn_handler fd);
unix () in
let listen_unix = unix () in
debug "Waiting forever for requests";
Expand Down