From 84adefa331c4159d432d22840663c38f155cd4c1 Mon Sep 17 00:00:00 2001 From: Erlang/OTP Date: Fri, 20 Nov 2009 14:54:40 +0000 Subject: The R13B03 release. --- lib/inets/doc/src/mod_esi.xml | 123 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 lib/inets/doc/src/mod_esi.xml (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 new file mode 100644 index 0000000000..d4541a1d15 --- /dev/null +++ b/lib/inets/doc/src/mod_esi.xml @@ -0,0 +1,123 @@ + + + + +
+ + 19972009 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + mod_esi + Joakim Grebenö + + 1997-10-14 + 2.2 + mod_esi.sgml +
+ mod_esi + Erlang Server Interface + +

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

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

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.

+ +

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. 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.

+
+
+
+ +
+ ESI Callback Functions +
+ + + 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. + + SessionID = term() + 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. <v>Input = string() + + +

The Module must be found in the code path and export + Function with an arity of two. 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 use when deliver/2 is called, do not + assume any-thing 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 + 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 not contains + End of HTTP header that is "\\r\ \\r\ " + the server will + assume 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. + + 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. <v>Input = string() + Response = string() + + +

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

+
+
+
+ +
+ + -- cgit v1.2.3