X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2FDEVEL%2Focaml-http%2Fhttp_types.ml;h=fa09a3d5c72023d428f19b09b07bf6c410fa5a0a;hb=d4993a3584bd83a87f642e8766eb86c0a24b682b;hp=79ccf783a53e6835f154b4d2d3db21d114b7c8c8;hpb=697d0d8857366485238a67386d0ce8f18404ac42;p=helm.git diff --git a/helm/DEVEL/ocaml-http/http_types.ml b/helm/DEVEL/ocaml-http/http_types.ml index 79ccf783a..fa09a3d5c 100644 --- a/helm/DEVEL/ocaml-http/http_types.ml +++ b/helm/DEVEL/ocaml-http/http_types.ml @@ -26,6 +26,13 @@ type version = type meth = [ `GET ] +type daemon_mode = [ `Single | `Fork | `Thread ] + +type tcp_server = + sockaddr:Unix.sockaddr -> timeout:int option -> + (in_channel -> out_channel -> unit) -> + unit + type informational_substatus = [ `Continue | `Switching_protocols @@ -100,6 +107,25 @@ type status = | server_error_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 + +exception Malformed_query of string +exception Malformed_query_part of string * string +exception Unsupported_method of string +exception Unsupported_HTTP_version of string +exception Malformed_request_URI of string +exception Malformed_request of string + +exception Param_not_found of string + +exception Invalid_status_line of string +exception Header_not_found of string + class type response = object method version: version @@ -125,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 @@ -141,6 +169,7 @@ class type response = method setExpires: string -> unit method server: string method setServer: string -> unit + method toString: string method serialize: out_channel -> unit end class type request = @@ -148,5 +177,21 @@ class type request = method uri: string method path: string method param: string -> string + method paramAll: string -> string list method params: (string * string) list + method clientSockaddr: Unix.sockaddr + method clientAddr: string + method clientPort: int 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 +