From: Stefano Zacchiroli Date: Fri, 6 Dec 2002 17:27:10 +0000 (+0000) Subject: - added exceptions Invalid_header_{name,value} X-Git-Tag: v0_3_99~167 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=b135ff929bdf58c2e076a6462ab03e6ed1067654;p=helm.git - added exceptions Invalid_header_{name,value} - added class types connection and daemon --- diff --git a/helm/DEVEL/ocaml-http/http_types.ml b/helm/DEVEL/ocaml-http/http_types.ml index 7233056fc..ebbcbcc35 100644 --- a/helm/DEVEL/ocaml-http/http_types.ml +++ b/helm/DEVEL/ocaml-http/http_types.ml @@ -108,6 +108,8 @@ type status = ] exception Invalid_header of string +exception Invalid_header_name of string +exception Invalid_header_value of string exception Invalid_HTTP_version of string exception Invalid_code of int exception Invalid_status of status @@ -149,8 +151,10 @@ class type response = method addContents: string -> unit method addContentsBuf: Buffer.t -> unit method addHeader: name:string -> value:string -> unit + method addHeaders: (string * string) list -> unit method addBasicHeaders: unit method replaceHeader: name:string -> value:string -> unit + method replaceHeaders: (string * string) list -> unit method removeHeader: name:string -> unit method hasHeader: name:string -> bool method header: name:string -> string @@ -176,3 +180,15 @@ class type request = method paramAll: string -> string list method params: (string * string) list end +class type connection = + object + method getRequest: request option + method respond_with: response -> unit + method close: unit + end +class type daemon = + object + method accept: connection + method getRequest: request * connection + end +