module Server: sig end
val system_inactive : unit -> bool
val system_sleep : int -> unit
val system_set_user : string -> unit
val system_stop : unit -> unit
val system_stopped : unit -> bool
val system_add_safe : string -> string -> unit
set
directory
Add a directory to the list of directories (including their sub directories) where static content of the website is searched.
The first added directory acts like the root directory of the static content of the server.
val system_check_safe : string -> string -> bool
set
file
Symbolic links are checked and when the resulting file is inside one of the save directories this function returns trueval set_server_parm : string -> string -> unit
var
value
Set an internal server variable, these are readable by all the client scripts
special values:
"status" of HTTP-response
val socket_create : int -> int -> int
port_nr
max_connections
resulting in the socket
val socket_loop : unit -> bool
val socket_create_ssl : int -> int -> string -> string -> string -> int
port_nr
max_connections
certificate_file
privatekey_file
certificate_password
resulting in the socket
val socket_listen : unit -> unit
val socket_close : int -> unit
val socket_current : unit -> int
val conn_loop : unit -> bool
val conn_header : int -> int -> int
keep_alive
time to wait for new headers on the current connections and a
timeout
that stops reading after this amount of inactivity both the parameters are in milliseconds.
The functions returns 1 after completion of the header or 2 to close the current connection (error or keep_alive exceeded).
On a 0 the rest of the connections should be checked and then this connection should be checked again for completion.
val conn_send : int -> unit
timeout
and it stops sending after the time in milliseconds of inactivity.val conn_var : string -> string -> string
type
name
can be:val conn_var_list : string -> string -> string
val conn_var_loop : string -> string
val conn_cookie : string -> string -> int -> unit
conn_set_cookie name value days
val conn_calc : (string -> string -> Html.t list) -> string -> string -> bool
docalc
is a function that should provide
the calculation itself and results into html data. The other parameters tp
and name
are given to docalc as a tuple to find the correct
dynamic page to calculate. The first parameter to docalc contains all the information that can be gathered by the 'conn_var' function.val conn_close : unit -> unit
val conn_file : string -> string -> int -> bool
set
filename
expires
-> will_be_send?
Send a total file over the connection. This function tries to determine the mime-type of this file.
The expires is counted in days from now, this can be zero to check the cache date every time.val conn_parms : unit -> string