File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -473,10 +473,7 @@ let main use_mock config daemon socket journal fromLVM toLVM =
473473 debug " Binding and listening on the socket" ;
474474 Lwt_unix. bind s (Lwt_unix. ADDR_UNIX (config.Config. socket));
475475 Lwt_unix. listen s 5 ;
476- let rec unix () =
477- debug " Calling accept on the socket" ;
478- Lwt_unix. accept s
479- >> = fun (fd , _ ) ->
476+ let conn_handler fd () =
480477 let ic = Lwt_io. of_fd ~mode: Lwt_io. input fd in
481478 let oc = Lwt_io. of_fd ~mode: Lwt_io. output ~close: return fd in
482479 (* read one line *)
@@ -490,7 +487,12 @@ let main use_mock config daemon socket journal fromLVM toLVM =
490487 Lwt_io. flush oc
491488 >> = fun () ->
492489 Lwt_io. close ic
493- >> = fun () ->
490+ in
491+ let rec unix () =
492+ debug " Calling accept on the socket" ;
493+ Lwt_unix. accept s
494+ >> = fun (fd , _ ) ->
495+ async (conn_handler fd);
494496 unix () in
495497 let listen_unix = unix () in
496498 debug " Waiting forever for requests" ;
You can’t perform that action at this time.
0 commit comments