]> matita.cs.unibo.it Git - helm.git/commitdiff
- ported to latest API
authorStefano Zacchiroli <zack@upsilon.cc>
Mon, 24 May 2004 12:45:56 +0000 (12:45 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Mon, 24 May 2004 12:45:56 +0000 (12:45 +0000)
- bumped copyright info

13 files changed:
helm/DEVEL/ocaml-http/examples/always_ok_daemon.ml
helm/DEVEL/ocaml-http/examples/basic_auth.ml
helm/DEVEL/ocaml-http/examples/chdir.ml
helm/DEVEL/ocaml-http/examples/client_address.ml
helm/DEVEL/ocaml-http/examples/damned_recursion.ml
helm/DEVEL/ocaml-http/examples/dont_fork.ml
helm/DEVEL/ocaml-http/examples/dump_args.ml
helm/DEVEL/ocaml-http/examples/highlander.ml
helm/DEVEL/ocaml-http/examples/obj_foo.ml
helm/DEVEL/ocaml-http/examples/oo_daemon.ml
helm/DEVEL/ocaml-http/examples/threads.ml
helm/DEVEL/ocaml-http/examples/timeout.ml
helm/DEVEL/ocaml-http/examples/webfsd.ml

index 492be655aaa62f6a2045a9bd6a0495ef3fe9c9a5..d5d456d7481d9a22488c4802dcadb2168775ab4f 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
@@ -22,4 +22,5 @@
 open Http_daemon;;
   (* start an http daemon that alway respond with a 200 status code and an empty
   content *)
-start ~port:9999 (fun _ _ outchan -> respond outchan)
+start ~port:9999 ~addr:"localhost" (fun _ _ outchan -> respond outchan)
+
index f9d75a7c5e4e64ec37771de43ff4ca70f44c6eaa..c3e4e6f9162b55d5cc2fe5d6d5ce25f213b0f564 100644 (file)
@@ -1,9 +1,29 @@
 
+(*
+  OCaml HTTP - do it yourself (fully OCaml) HTTP daemon
+
+  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
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*)
+
 let callback (req: Http_types.request) outchan =
   match req#authorization with
   | Some (`Basic (username, password))
     when username = "foo" && password = "bar" ->
-      Http_daemon.respond ~code:200 ~body:"secret page!" outchan
+      Http_daemon.respond ~code:(`Code 200) ~body:"secret page!" outchan
   | _ -> raise (Http_types.Unauthorized "my secret site")
 
 let _ = Http_daemon.start' ~port:9999 callback
index a5e460b3a51f4a6dae4e7cbb1f3b4375fdfcbaac..183b3ca00bd6dfdd96a859dda713221029c86af8 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
index 75719111e799a06ad9c0472eab24c8dd15d86881..0f5c68d2c4ff87798cf7ac5469317290967b87e7 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
index dd3f6a36d0cc5410ec655cfc488421b76f5840e3..8c7efd91e07f185098356bffbf15e1a106cb84c6 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
index d0e1d91e61531ce49d7fefb774a4348801932915..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
index 8e0d5dc67858909e311310a5a8ab39295083f18c..a6dcdda0e09aa9513bab623a6f70e244fafd56d6 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
@@ -22,7 +22,7 @@
 open Printf;;
 
 let callback req outchan =
-  Http_daemon.send_basic_headers ~code:200 outchan;
+  Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
   Http_daemon.send_CRLF outchan;
   let str = 
     (sprintf "request path = %s\n"  req#path) ^
index b58d3a6e7358b0b4cd51c97373a145bf1491cd77..24a4abd84d9d01e211dc3b1689eff213cd48c2f7 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
@@ -25,7 +25,7 @@ port *)
 open Printf;;
 
 let callback req outchan =
-  Http_daemon.send_basic_headers ~code:200 outchan;
+  Http_daemon.send_basic_headers ~code:(`Code 200) outchan;
   Http_daemon.send_CRLF outchan;
   let str = 
     (sprintf "request path = %s\n"  req#path) ^
index 2786218530ccf7e8ef4b20966e928d40ab9713bf..3a6911019003010411dce31b89d6fddcfaa2ea46 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
index b73a2acd980a7eb65c22b98e21e41360b3429548..528f2b24688e8cc08c4af5671eca9bc949f8b51b 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
index 9eba49f37bc9b4dc43453bf3588b529621d429d8..a73f422d8199c11106d9687219105ab8f9035b37 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
index eaa84077879b830226b0508a70b971cc28d6e020..84e989b94d22e02b5ffb699cf43889d7596a5cc4 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
index 6babe3dde4abf2cc80bf46b9bd986111c5d6c01f..c41443e87b62ebd65f68c70e5ce6f8aefe4c2462 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