`sig
exception Ocsigen_http_error of (Ocsigen_cookies.cookieset * int)
exception Bad_config_tag_for_extension of string
exception Error_in_config_file of string
exception Error_in_user_config_file of string
val badconfig : ('a, unit, string, 'b) Pervasives.format4 -> 'a
type virtual_hosts = (string * Netstring_pcre.regexp * int option) list
val hash_virtual_hosts : Ocsigen_extensions.virtual_hosts -> int
val equal_virtual_hosts :
Ocsigen_extensions.virtual_hosts ->
Ocsigen_extensions.virtual_hosts -> bool
val host_match :
virtual_hosts:Ocsigen_extensions.virtual_hosts ->
host:string option -> port:int -> bool
type do_not_serve = {
do_not_serve_regexps : string list;
do_not_serve_files : string list;
do_not_serve_extensions : string list;
}
exception IncorrectRegexpes of Ocsigen_extensions.do_not_serve
val do_not_serve_to_regexp :
Ocsigen_extensions.do_not_serve -> Netstring_pcre.regexp
val join_do_not_serve :
Ocsigen_extensions.do_not_serve ->
Ocsigen_extensions.do_not_serve -> Ocsigen_extensions.do_not_serve
type config_info = {
default_hostname : string;
default_httpport : int;
default_httpsport : int;
mime_assoc : Ocsigen_charset_mime.mime_assoc;
charset_assoc : Ocsigen_charset_mime.charset_assoc;
default_directory_index : string list;
list_directory_content : bool;
follow_symlinks : Ocsigen_extensions.follow_symlink;
do_not_serve_404 : Ocsigen_extensions.do_not_serve;
do_not_serve_403 : Ocsigen_extensions.do_not_serve;
uploaddir : string option;
maxuploadfilesize : int64 option;
}
and follow_symlink =
DoNotFollowSymlinks
| FollowSymlinksIfOwnerMatch
| AlwaysFollowSymlinks
type client
val client_id : Ocsigen_extensions.client -> int
val client_connection :
Ocsigen_extensions.client -> Ocsigen_http_com.connection
type ifrange = IR_No | IR_Ifunmodsince of float | IR_ifmatch of string
type file_info = {
tmp_filename : string;
filesize : int64;
raw_original_filename : string;
original_basename : string;
file_content_type : (string * string option) option;
}
type request_info = {
ri_url_string : string;
ri_method : Ocsigen_http_frame.Http_header.http_method;
ri_protocol : Ocsigen_http_frame.Http_header.proto;
ri_ssl : bool;
ri_full_path_string : string;
ri_full_path : string list;
ri_original_full_path_string : string;
ri_original_full_path : string list;
ri_sub_path : string list;
ri_sub_path_string : string;
ri_get_params_string : string option;
ri_host : string option;
ri_port_from_host_field : int option;
ri_get_params : (string * string) list Lazy.t;
ri_initial_get_params : (string * string) list Lazy.t;
ri_post_params :
(Ocsigen_extensions.config_info -> (string * string) list Lwt.t) option;
ri_files :
(Ocsigen_extensions.config_info ->
(string * Ocsigen_extensions.file_info) list Lwt.t)
option;
ri_remote_inet_addr : Unix.inet_addr;
ri_remote_ip : string;
ri_remote_ip_parsed : Ocsigen_lib.Ip_address.t Lazy.t;
ri_remote_port : int;
ri_forward_ip : string list;
ri_server_port : int;
ri_user_agent : string;
ri_cookies_string : string option Lazy.t;
ri_cookies : string Ocsigen_cookies.CookiesTable.t Lazy.t;
ri_ifmodifiedsince : float option;
ri_ifunmodifiedsince : float option;
ri_ifnonematch : string list option;
ri_ifmatch : string list option;
ri_content_type : ((string * string) * (string * string) list) option;
ri_content_type_string : string option;
ri_content_length : int64 option;
ri_referer : string option Lazy.t;
ri_origin : string option Lazy.t;
ri_access_control_request_method : string option Lazy.t;
ri_access_control_request_headers : string list option Lazy.t;
ri_accept :
((string option * string option) * float option *
(string * string) list)
list Lazy.t;
ri_accept_charset : (string option * float option) list Lazy.t;
ri_accept_encoding : (string option * float option) list Lazy.t;
ri_accept_language : (string * float option) list Lazy.t;
ri_http_frame : Ocsigen_http_frame.t;
mutable ri_request_cache : Polytables.t;
ri_client : Ocsigen_extensions.client;
ri_range :
((int64 * int64) list * int64 option * Ocsigen_extensions.ifrange)
option Lazy.t;
ri_timeofday : float;
mutable ri_nb_tries : int;
ri_connection_closed : unit Lwt.t;
}
and request = {
request_info : Ocsigen_extensions.request_info;
request_config : Ocsigen_extensions.config_info;
}
exception Ocsigen_Is_a_directory of Ocsigen_extensions.request
type answer =
Ext_do_nothing
| Ext_found of (unit -> Ocsigen_http_frame.result Lwt.t)
| Ext_found_stop of (unit -> Ocsigen_http_frame.result Lwt.t)
| Ext_next of int
| Ext_stop_site of (Ocsigen_cookies.cookieset * int)
| Ext_stop_host of (Ocsigen_cookies.cookieset * int)
| Ext_stop_all of (Ocsigen_cookies.cookieset * int)
| Ext_continue_with of
(Ocsigen_extensions.request * Ocsigen_cookies.cookieset * int)
| Ext_retry_with of Ocsigen_extensions.request *
Ocsigen_cookies.cookieset
| Ext_sub_result of Ocsigen_extensions.extension2
| Ext_found_continue_with of
(unit ->
(Ocsigen_http_frame.result * Ocsigen_extensions.request) Lwt.t)
| Ext_found_continue_with' of
(Ocsigen_http_frame.result * Ocsigen_extensions.request)
and request_state =
Req_not_found of (int * Ocsigen_extensions.request)
| Req_found of (Ocsigen_extensions.request * Ocsigen_http_frame.result)
and extension2 =
(unit -> unit) ->
Ocsigen_cookies.cookieset ->
Ocsigen_extensions.request_state ->
(Ocsigen_extensions.answer * Ocsigen_cookies.cookieset) Lwt.t
type extension =
Ocsigen_extensions.request_state -> Ocsigen_extensions.answer Lwt.t
type parse_fun = Simplexmlparser.xml list -> Ocsigen_extensions.extension2
type parse_host
type userconf_info = { localfiles_root : string; }
type parse_config =
Ocsigen_extensions.virtual_hosts ->
Ocsigen_extensions.config_info -> Ocsigen_extensions.parse_config_aux
and parse_config_user =
Ocsigen_extensions.userconf_info -> Ocsigen_extensions.parse_config
and parse_config_aux =
Ocsigen_lib.Url.path ->
Ocsigen_extensions.parse_host ->
Ocsigen_extensions.parse_fun ->
Simplexmlparser.xml -> Ocsigen_extensions.extension
val register_extension :
name:string ->
?fun_site:Ocsigen_extensions.parse_config ->
?user_fun_site:Ocsigen_extensions.parse_config_user ->
?begin_init:(unit -> unit) ->
?end_init:(unit -> unit) ->
?init_fun:(Simplexmlparser.xml list -> unit) ->
?exn_handler:(exn -> string) -> ?respect_pipeline:bool -> unit -> unit
module Configuration :
sig
type element
type attribute
val element :
name:string ->
?obligatory:bool ->
?init:(unit -> unit) ->
?elements:Ocsigen_extensions.Configuration.element list ->
?attributes:Ocsigen_extensions.Configuration.attribute list ->
?pcdata:(string -> unit) ->
?other_elements:(string ->
(string * string) list ->
Simplexmlparser.xml list -> unit) ->
?other_attributes:(string -> string -> unit) ->
unit -> Ocsigen_extensions.Configuration.element
val attribute :
name:string ->
?obligatory:bool ->
(string -> unit) -> Ocsigen_extensions.Configuration.attribute
val process_element :
in_tag:string ->
elements:Ocsigen_extensions.Configuration.element list ->
?pcdata:(string -> unit) ->
?other_elements:(string ->
(string * string) list ->
Simplexmlparser.xml list -> unit) ->
Simplexmlparser.xml -> unit
val process_elements :
in_tag:string ->
elements:Ocsigen_extensions.Configuration.element list ->
?pcdata:(string -> unit) ->
?other_elements:(string ->
(string * string) list ->
Simplexmlparser.xml list -> unit) ->
?init:(unit -> unit) -> Simplexmlparser.xml list -> unit
val ignore_blank_pcdata : in_tag:string -> string -> unit
end
val get_hostname : Ocsigen_extensions.request -> string
val get_port : Ocsigen_extensions.request -> int
val ri_of_url :
?full_rewrite:bool ->
string ->
Ocsigen_extensions.request_info -> Ocsigen_extensions.request_info
exception NoSuchUser
type ud_string
val parse_user_dir : string -> Ocsigen_extensions.ud_string
val replace_user_dir :
Netstring_pcre.regexp -> Ocsigen_extensions.ud_string -> string -> string
exception Not_concerned
val find_redirection :
Netstring_pcre.regexp ->
bool ->
string ->
bool ->
string option -> int -> string option -> string -> string -> string
exception Unknown_command
val register_command_function :
?prefix:string -> (string -> string list -> unit Lwt.t) -> unit
val get_command_function :
unit -> ?prefix:string -> string -> string list -> unit Lwt.t
val make_parse_config :
Ocsigen_lib.Url.path ->
Ocsigen_extensions.parse_config_aux -> Ocsigen_extensions.parse_fun
val parse_config_item : Ocsigen_extensions.parse_config
val parse_user_site_item : Ocsigen_extensions.parse_config_user
val set_hosts :
(Ocsigen_extensions.virtual_hosts * Ocsigen_extensions.config_info *
Ocsigen_extensions.extension2)
list -> unit
val get_hosts :
unit ->
(Ocsigen_extensions.virtual_hosts * Ocsigen_extensions.config_info *
Ocsigen_extensions.extension2)
list
val compute_result :
?previous_cookies:Ocsigen_cookies.cookieset ->
?awake_next_request:bool ->
Ocsigen_extensions.request_info -> Ocsigen_http_frame.result Lwt.t
val get_number_of_connected : unit -> int
val incr_connected : int -> unit
val decr_connected : unit -> unit Lwt.t
val wait_fewer_connected : int -> unit Lwt.t
val during_initialisation : unit -> bool
val start_initialisation : unit -> unit
val end_initialisation : unit -> unit
val get_numberofreloads : unit -> int
val get_init_exn_handler : unit -> exn -> string
val set_config : Simplexmlparser.xml list -> unit
val client_of_connection :
Ocsigen_http_com.connection -> Ocsigen_extensions.client
val get_server_address :
Ocsigen_extensions.request_info -> Unix.inet_addr * int
val sockets : Lwt_unix.file_descr list Pervasives.ref
val sslsockets : Lwt_unix.file_descr list Pervasives.ref
end`