1 (* Copyright 2001, 2002 b8_bavard, b8_fee_carabine, INRIA *)
3 This file is part of mldonkey.
5 mldonkey is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 mldonkey is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mldonkey; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 type auth
= No_auth
| Read_auth
| Write_auth
20 type error_reason
= Blocked
| Not_allowed
| Url_not_found
of string
22 Unknown
of string * string
24 | Authorization
of auth
26 referer
: Url.url
option;
27 content_length
: int64
;
28 content_type
: string;
34 and full_header
= string * string
38 arg_args
: (string * string) list
;
39 arg_headers
: full_header list
;
41 and version
= HTTP1_0
| HTTP1_1
| HTTP
43 sock
: TcpBufferedSocket.t
;
48 headers
: full_header list
;
49 form_args
: form_arg list
;
51 mutable reply_head
: string;
52 mutable reply_headers
: (string * string) list
;
53 mutable reply_content
: string;
54 mutable reply_stream
: (TcpBufferedSocket.t
-> unit) option;
57 and handler
= TcpBufferedSocket.t
-> request
-> unit
60 bind_addr
: Unix.inet_addr
;
62 requests
: (string * handler
) list
;
63 mutable addrs
: Ip_set.blocking_list
;
64 use_ip_block_list
: bool;
69 val create
: config
-> TcpServerSocket.t
70 val html_escaped
: string -> string
71 val html_real_escaped
: string -> string
73 val add_reply_header
: request
-> string -> string -> unit
74 val handler
: config
-> 'a
-> TcpServerSocket.event
-> unit
75 val parse_head
: TcpBufferedSocket.t
-> string -> request
77 val verbose
: bool ref
79 val request_range
: request
-> int64
* (int64
option)
80 val parse_range
: string -> int64
* int64
option * int64
option
81 val error_page
: string -> string -> string -> string -> string -> error_reason
option -> string * string * string