sig
type fatal_error =
[ `Broken_pipe
| `Broken_pipe_ignore
| `Message_too_long
| `Server_error
| `TLS_error of string * string
| `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 body_size : int64
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 ->
int64 ->
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 ]
val string_of_req_token : Nethttpd_kernel.req_token -> string
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
method config_suppress_broken_pipe : bool
method config_tls : Netsys_crypto_types.tls_config option
end
val default_http_protocol_config : Nethttpd_kernel.http_protocol_config
class modify_http_protocol_config :
?config_max_reqline_length:int ->
?config_max_header_length:int ->
?config_max_trailer_length:int ->
?config_limit_pipeline_length:int ->
?config_limit_pipeline_size:int ->
?config_announce_server:Nethttpd_kernel.announcement ->
?config_suppress_broken_pipe:bool ->
?config_tls:Netsys_crypto_types.tls_config option ->
Nethttpd_kernel.http_protocol_config -> http_protocol_config
class type http_protocol_hooks =
object
method tls_set_cache :
store:(string -> string -> unit) ->
remove:(string -> unit) -> retrieve:(string -> string) -> unit
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 hooks : Nethttpd_kernel.http_protocol_hooks
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_filled : bool
method resp_queue_len : int
method shutdown : unit -> unit
method test_coverage : string list
method timeout : unit -> unit
method tls_session_props : Nettls_support.tls_session_props option
method waiting_for_next_message : bool
end
class lingering_close :
?preclose:(unit -> unit) ->
Unix.file_descr ->
object
method cycle : ?block:bool -> unit -> unit
method fd : Unix.file_descr
method lingering : bool
end
module Debug : sig val enable : bool Pervasives.ref end
end