+ocaml-http (0.1.2-1) unstable; urgency=low
+
+ * avoid exceptions for closing connection twice during finaliztion of
+ connection objects (thanks to Eric Strokes <eric.stokes@csun.edu>
+ for the patch)
+
+ -- Stefano Zacchiroli <zack@debian.org> Wed, 14 Sep 2005 18:03:40 +0200
+
ocaml-http (0.1.1-1) unstable; urgency=low
* added ?default parameter to "param" method
open Http_constants
open Http_parser
+exception Http_daemon_failure of string
+
(** send raw data on outchan, flushing it afterwards *)
let send_raw ~data outchan =
output_string outchan data;
let main spec = main { spec with callback = trivial_callback }
end
- (* @param inchan input channel connected to client
+ (** @param inchan input channel connected to client
@param outchan output channel connected to client
@param sockaddr client socket address *)
class connection inchan outchan sockaddr =
(* ASSUMPTION: inchan and outchan are channels built on top of the same
Unix.file_descr thus closing one of them will close also the other *)
- let close' o = o#close in
+ let close' o = try o#close with Http_daemon_failure _ -> () in
object (self)
initializer Gc.finalise close' self
method private assertNotClosed =
if closed then
- failwith "Http_daemon.connection: connection is closed"
+ raise (Http_daemon_failure
+ "Http_daemon.connection: connection is closed")
method getRequest =
self#assertNotClosed;