]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/tcp_server.ml
bug fix: reset timeout after processing request in Tcp_server.simple
[helm.git] / helm / DEVEL / ocaml-http / tcp_server.ml
index 70b303eeb0f06fe0ba4ffb2f9daac7ac0c5ef64a..44e4df1d57586f1010821e084f2015f8342daa68 100644 (file)
@@ -45,7 +45,10 @@ let simple ~sockaddr ~timeout callback =
     let (inchan, outchan) =
       (Unix.in_channel_of_descr suck, Unix.out_channel_of_descr suck)
     in
-    (try callback inchan outchan with Timeout -> ());
+    (try
+      callback inchan outchan;
+      ignore (Unix.alarm 0)
+    with Timeout -> ());
     close_out outchan (* this close also inchan, because socket is the same *)
   done