]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/ocaml-http/examples/dont_fork.ml
fixed parse error for ocaml 3.08
[helm.git] / helm / DEVEL / ocaml-http / examples / dont_fork.ml
index 8d8eb45ccdec087789e8017d5b74f4875fc96031..f053554963195f0342b197ad528ac4a0f8bec0ce 100644 (file)
@@ -2,7 +2,7 @@
 (*
   OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
 
-  Copyright (C) <2002> Stefano Zacchiroli <zack@cs.unibo.it>
+  Copyright (C) <2002-2004> Stefano Zacchiroli <zack@cs.unibo.it>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -20,9 +20,6 @@
 *)
 
 let callback req outchan =
-  output_string outchan "FOO\n";
-  flush outchan;
-  Unix.sleep 5;
-  Http_daemon.respond_error ~body:"AH AH AH :-P" outchan
+  Http_daemon.respond_error ~body:"AH AH AH :-P\n" outchan
 in
-Http_daemon.start' ~port:9999 ~fork:false callback
+Http_daemon.start' ~port:9999 ~mode:`Single ~timeout:(Some 5) callback