let user = get_option "rdfly.mysql_connection.user";;
let daemonport = Helm_registry.get_int "rdfly.port";;
-let callback (req: Http_types.request) ch =
+let callback ((req: Http_types.request), ch) =
try
debug_print ("Connection from " ^ req#clientAddr) ;
debug_print ("Received request: " ^ req#uri) ;
| exc ->
return_html_error ("Uncaught exception: " ^ (Printexc.to_string exc)) ch
+let callback req ch =
+ HExtlib.finally
+ (fun () -> try close_out ch with Sys_error _ -> ())
+ callback (req, ch)
+
let main () =
Sys.catch_break true;
try