module Extensions: sig
.. end
type of URLs, without parameter
exception Ocsigen_404
exception Ocsigen_Is_a_directory
exception Ocsigen_malformed_url
exception Ocsigen_Internal_Error of string
exception Bad_config_tag_for_extension of string
exception Error_in_config_file of string
type
url_path = string list
type of URLs, without parameter
type
current_url = string list
type
current_dir = string list
type
file_info = {
|
tmp_filename : string ; |
|
filesize : int64 ; |
|
original_filename : string ; |
}
The files sent in the request
Note that the files are cancelled once the request has been fulfilled
type
request_info = {
|
ri_url : string ; |
|
ri_path_string : string ; |
|
ri_path : string list ; |
|
ri_params : string ; |
|
ri_host : string option ; |
|
ri_get_params : (string * string) list Lazy.t ; |
|
ri_post_params : (string * string) list Lwt.t Lazy.t ; |
|
ri_files : (string * file_info) list Lwt.t Lazy.t ; |
|
ri_inet_addr : Unix.inet_addr ; |
|
ri_ip : string ; |
|
ri_port : int ; |
|
ri_user_agent : string ; |
|
ri_cookies : (string * string) list Lazy.t ; |
|
ri_ifmodifiedsince : float option ; |
|
ri_http_frame : Predefined_senders.Stream_http_frame.http_frame ; |
}
The request
If you force ri_files
or ri_post_params
, the request is fully read,
so it is not possible any more to read it from ri_http_frame
(and vice versa).
type
result = {
}
The result of a page generation
type
charset_tree_type
Charset for each directory
type
answer =
The result given by the extension (filter or page generation)
val register_extension : (Ocsimisc.virtual_hosts ->
(string option -> request_info -> answer Lwt.t) *
(string list -> Simplexmlparser.ExprOrPatt.texprpatt -> unit)) *
(unit -> unit) * (unit -> unit) * (exn -> string) -> unit
We register for each extension four functions:
- a function that will be called for each
virtual server, generating two functions:
- one that will be called to generate the pages
- one to parse the configuration file
- a function that will be called at the beginning
of the initialisation phase
- a function that will be called at the end of the initialisation phase
of the server
- a function that will create an error message from the exceptions
that may be raised during the initialisation phase, and raise again
all other exceptions