sig
type fatal_error =
[ `Broken_pipe
| `Message_too_long
| `Server_error
| `Timeout
| `Unix_error of Unix.error ]
val string_of_fatal_error : Nethttpd_kernel.fatal_error -> string
type bad_request_error =
[ `Bad_header
| `Bad_header_field of string
| `Bad_request_line
| `Bad_trailer
| `Format_error of string
| `Protocol_not_supported
| `Request_line_too_long
| `Unexpected_eof ]
val string_of_bad_request_error :
Nethttpd_kernel.bad_request_error -> string
val status_of_bad_request_error :
Nethttpd_kernel.bad_request_error -> Nethttp.http_status
type data_chunk = string * int * int
type status_line = int * string
type transfer_coding = [ `Chunked | `Identity ]
type resp_token =
[ `Resp_action of unit -> unit
| `Resp_body of Nethttpd_kernel.data_chunk
| `Resp_end
| `Resp_header of Nethttp.http_header
| `Resp_info_line of Nethttpd_kernel.status_line * Nethttp.http_header
| `Resp_status_line of Nethttpd_kernel.status_line
| `Resp_trailer of Nethttp.http_trailer ]
val resp_100_continue : Nethttpd_kernel.resp_token
type resp_state =
[ `Active | `Dropped | `Error | `Inhibited | `Processed | `Queued ]
type front_token =
[ `Resp_end | `Resp_wire_data of Nethttpd_kernel.data_chunk ]
exception Send_queue_empty
type announcement =
[ `As of string | `Ignore | `Ocamlnet | `Ocamlnet_and of string ]
class type http_response =
object
method advance : int -> unit
method bidirectional_phase : bool
method close_connection : bool
method front_token : Nethttpd_kernel.front_token
method protocol : Nethttp.protocol
method send : Nethttpd_kernel.resp_token -> unit
method send_queue_empty : bool
method set_callback : (unit -> unit) -> unit
method set_state : Nethttpd_kernel.resp_state -> unit
method state : Nethttpd_kernel.resp_state
method transfer_encoding : Nethttpd_kernel.transfer_coding
end
class http_response_impl :
?close:bool ->
?suppress_body:bool ->
Nethttp.protocol -> Nethttpd_kernel.announcement -> http_response
val send_static_response :
Nethttpd_kernel.http_response ->
Nethttp.http_status -> Nethttp.http_header option -> string -> unit
val send_file_response :
Nethttpd_kernel.http_response ->
Nethttp.http_status ->
Nethttp.http_header option -> Unix.file_descr -> int64 -> unit
type request_line = Nethttp.http_method * Nethttp.protocol
type req_token =
[ `Bad_request_error of
Nethttpd_kernel.bad_request_error * Nethttpd_kernel.http_response
| `Eof
| `Fatal_error of Nethttpd_kernel.fatal_error
| `Req_body of Nethttpd_kernel.data_chunk
| `Req_end
| `Req_expect_100_continue
| `Req_header of
Nethttpd_kernel.request_line * Nethttp.http_header *
Nethttpd_kernel.http_response
| `Req_trailer of Nethttp.http_trailer
| `Timeout ]
exception Recv_queue_empty
class type http_protocol_config =
object
method config_announce_server : Nethttpd_kernel.announcement
method config_limit_pipeline_length : int
method config_limit_pipeline_size : int
method config_max_header_length : int
method config_max_reqline_length : int
method config_max_trailer_length : int
end
class http_protocol :
#Nethttpd_kernel.http_protocol_config ->
Unix.file_descr ->
object
method abort : Nethttpd_kernel.fatal_error -> unit
method config : Nethttpd_kernel.http_protocol_config
method cycle : ?block:float -> unit -> unit
method do_input : bool
method do_output : bool
method fd : Unix.file_descr
method input_timeout_class : [ `Next_message | `None | `Normal ]
method need_linger : bool
method peek_recv : unit -> Nethttpd_kernel.req_token
method pipeline_len : int
method receive : unit -> Nethttpd_kernel.req_token
method recv_queue_byte_size : int
method recv_queue_len : int
method resp_queue_len : int
method shutdown : unit -> unit
method test_coverage : string list
method timeout : unit -> unit
method waiting_for_next_message : bool
end
class lingering_close :
Unix.file_descr ->
object
method cycle : ?block:bool -> unit -> unit
method fd : Unix.file_descr
method lingering : bool
end
end