Skip to content
Newer
Older
100644 75 lines (59 sloc) 2.66 KB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18
19 type msg = HttpServerCore_parse.msg
20
21 type uri = string
22 type header = msg
23 type mime = msg
24 type post_body = mime list * Rcontent.content
25
26 type response = { sl : msg ; headers : header list ; body : Rcontent.content }
27
28 type multipart_post_request = { uri:uri;
29 request_headers:header list;
30 request_body : post_body list;
31 tmpfiles : string list;
32 }
33
34 type get = uri * header list
35 type post =
36 | Multipart of multipart_post_request
37 | Simple of uri * header list * Rcontent.content
38
39 type request_line = { _method : msg ; request_uri : string ; http_version : string }
40
41 type server_info = { server_url:string; server_ip_or_name:string; server_port:int; server_secured:bool; server_id:int }
42
43 type handle_request = { hr_delcookies : bool;
44 hr_cachetype : string;
45 hr_server_info : server_info;
46 hr_is_secure : bool;
47 hr_timestamp : Time.t;
48 hr_timestamp_tm : Time.tm;
49 hr_inet_addr_str : string;
50 hr_user_agent : string;
51 hr_referer : string;
52 hr_ec : string;
53 hr_ic : string;
54 hr_dt2 : Time.t;
55 }
56
57 type request = { request_scheduler: Scheduler.t;
58 request_line : request_line;
59 request_header : header list;
60 request_message_body : Rcontent.content;
61 request_post_body : post_body list;
62 server_info : server_info;
63 is_multipart : bool;
64 handle_request : handle_request;
65 }
66
67 type web_info = { cont : response -> unit;
68 request : request;
69 connection : Scheduler.connection_info;
70 certificate : Ssl.certificate option;
71 }
72
73 val current_time_string : string ref
74 val time_diff : string ref
Something went wrong with that request. Please try again.