X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Focaml-http%2Fexamples%2Falways_ok_daemon.ml;h=caa0d4516fe427e8dbd1691e0b2ece1f5ce88186;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=aafe347e7f9850a8ffca2a3694b6073aab315878;hpb=6a8da4dd52033adfe80533f7467439aec1561147;p=helm.git diff --git a/helm/DEVEL/ocaml-http/examples/always_ok_daemon.ml b/helm/DEVEL/ocaml-http/examples/always_ok_daemon.ml index aafe347e7..caa0d4516 100644 --- a/helm/DEVEL/ocaml-http/examples/always_ok_daemon.ml +++ b/helm/DEVEL/ocaml-http/examples/always_ok_daemon.ml @@ -2,7 +2,7 @@ (* OCaml HTTP - do it yourself (fully OCaml) HTTP daemon - Copyright (C) <2002> Stefano Zacchiroli + Copyright (C) <2002-2004> Stefano Zacchiroli 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 @@ -19,8 +19,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) -open Http_daemon;; -open Http_response;; +open Http_types + (* start an http daemon that alway respond with a 200 status code and an empty content *) -start (fun _ _ -> respond_with (new Http_response.response)) +let spec = + { Http_daemon.default_spec with + callback = (fun _ outchan -> Http_daemon.respond outchan); + port = 9999; + } + +let _ = Http_daemon.main spec +