From b135ff929bdf58c2e076a6462ab03e6ed1067654 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Fri, 6 Dec 2002 17:27:10 +0000 Subject: [PATCH] - added exceptions Invalid_header_{name,value} - added class types connection and daemon --- helm/DEVEL/ocaml-http/http_types.ml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 + -- 2.39.2