From a2a1883e04aaa923b385cbbc496395ed5bf1dc17 Mon Sep 17 00:00:00 2001 From: tmanevik Date: Mon, 6 Jul 2015 21:21:27 +0200 Subject: Inets Reference Manual Editorial changes --- lib/inets/doc/src/mod_esi.xml | 73 ++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 36 deletions(-) (limited to 'lib/inets/doc/src/mod_esi.xml') diff --git a/lib/inets/doc/src/mod_esi.xml b/lib/inets/doc/src/mod_esi.xml index 8044f46242..66c59a0c60 100644 --- a/lib/inets/doc/src/mod_esi.xml +++ b/lib/inets/doc/src/mod_esi.xml @@ -30,11 +30,11 @@ mod_esi.sgml mod_esi - Erlang Server Interface + Erlang Server Interface

This module defines the Erlang Server Interface (ESI) API. - It is a more efficient way of writing erlang scripts - for your Inets web server than writing them as common CGI scripts.

+ It is a more efficient way of writing Erlang scripts + for your Inets web server than writing them as common CGI scripts.

@@ -42,7 +42,7 @@ deliver(SessionID, Data) -> ok | {error, Reason} - Sends Data back to client. + Sends Data back to client. SessionID = term() Data = string() | io_list() | binary() @@ -53,16 +53,16 @@

This function is only intended to be used from functions called by the Erl Scheme interface to deliver parts of the content to the user.

-

Sends data from a Erl Scheme script back to the client.

+

Sends data from an Erl Scheme script back to the client.

-

Note that if any HTTP-header fields should be added by the - script they must be in the first call to deliver/2 and the - data in the call must be a string. Calls after the headers - are complete may contain binary data to reduce copying - overhead. Do not assume anything about the data type of - SessionID, the SessionID must be the value given as input to - the esi call back function that you implemented.

+

If any HTTP header fields are added by the + script, they must be in the first call to deliver/2, + and the data in the call must be a string. Calls after the headers + are complete can contain binary data to reduce copying + overhead. Do not assume anything about the data type of + SessionID. SessionID must be the value given + as input to the ESI callback function that you implemented.

@@ -74,54 +74,55 @@ Module:Function(SessionID, Env, Input)-> _ - Creates a dynamic web page and returns it chunk by chunk to the server process by calling mod_esi:deliver/2. + Creates a dynamic web page and returns it chunk by chunk + to the server process by calling mod_esi:deliver/2. SessionID = term() - Env = [EnvironmentDirectives] ++ ParsedHeader + Env = [EnvironmentDirectives] ++ ParsedHeader EnvironmentDirectives = {Key,Value} Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name Input = string() -

The Module must be found in the code path and export - Function with an arity of three. An erlScriptAlias must - also be set up in the configuration file for the Web server.

-

If the HTTP request is a 'post' request and a body is sent - then content_length will be the length of the posted - data. If 'get' is used query_string will be the data after - ? in the url.

-

ParsedHeader is the HTTP request as a key value tuple - list. The keys in parsed header will be the in lower case.

-

SessionID is a identifier - the server uses when deliver/2 is called; do not +

Module must be found in the code path and export + Function with an arity of three. An erlScriptAlias must + also be set up in the configuration file for the web server.

+

If the HTTP request is a 'post' request and a body is sent, + content_length is the length of the posted + data. If 'get' is used, query_string is the data after + ? in the URL.

+

ParsedHeader is the HTTP request as a key-value tuple + list. The keys in ParsedHeader are in lower case.

+

SessionID is an identifier + the server uses when deliver/2 is called. Do not assume anything about the datatype.

-

Use this callback function to dynamically generate dynamic web - content. When a part of the page is generated send the - data back to the client through deliver/2. Note +

Use this callback function to generate dynamic web + content dynamically. When a part of the page is generated, send the + data back to the client through deliver/2. Notice that the first chunk of data sent to the client must at least contain all HTTP header fields that the response will generate. If the first chunk does not contain the - End of HTTP header, that is "\r\n\r\n", - the server will - assume that no HTTP header fields will be generated.

+ end of HTTP header, that is, "\r\n\r\n", + the server assumes that no HTTP header fields will be generated.

Module:Function(Env, Input)-> Response - Creates a dynamic web page and return it as a list. This functions is deprecated and only kept for backwards compatibility. + Creates a dynamic web page and returns it as a list. + This function is deprecated and is only kept for backwards compatibility. - Env = [EnvironmentDirectives] ++ ParsedHeader + Env = [EnvironmentDirectives] ++ ParsedHeader EnvironmentDirectives = {Key,Value} Key = query_string | content_length | server_software | gateway_interface | server_protocol | server_port | request_method | remote_addr | script_name. Input = string() Response = string() -

This callback format consumes a lot of memory since the +

This callback format consumes much memory, as the whole response must be generated before it is sent to the - user. This function is deprecated and only kept for backwards + user. This function is deprecated and is only kept for backwards compatibility. - For new development Module:Function/3 should be used.

+ For new development, use Module:Function/3.

-- cgit v1.2.3