aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/doc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inets/doc')
-rw-r--r--lib/inets/doc/src/Makefile58
-rw-r--r--lib/inets/doc/src/ftp.xml16
-rw-r--r--lib/inets/doc/src/http_server.xml86
-rw-r--r--lib/inets/doc/src/httpc.xml (renamed from lib/inets/doc/src/http.xml)244
-rw-r--r--lib/inets/doc/src/httpd.xml46
-rw-r--r--lib/inets/doc/src/httpd_util.xml11
-rw-r--r--lib/inets/doc/src/inets.xml8
-rw-r--r--lib/inets/doc/src/make.dep22
-rw-r--r--lib/inets/doc/src/mod_esi.xml8
-rw-r--r--lib/inets/doc/src/notes.xml132
-rw-r--r--lib/inets/doc/src/notes_history.xml24
-rw-r--r--lib/inets/doc/src/ref_man.xml8
12 files changed, 453 insertions, 210 deletions
diff --git a/lib/inets/doc/src/Makefile b/lib/inets/doc/src/Makefile
index 5b5a818db8..e4cb0c4e48 100644
--- a/lib/inets/doc/src/Makefile
+++ b/lib/inets/doc/src/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 1997-2010. 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.
-#
+#
# %CopyrightEnd%
#
#
@@ -25,7 +25,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
# ----------------------------------------------------
include ../../vsn.mk
VSN=$(INETS_VSN)
-APPLICATION=inets
+
# ----------------------------------------------------
# Include dependency
@@ -35,11 +35,13 @@ ifndef DOCSUPPORT
include make.dep
endif
+
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
+
# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
@@ -56,7 +58,7 @@ XML_REF3_FILES = \
inets.xml \
ftp.xml \
tftp.xml \
- http.xml\
+ httpc.xml\
httpd.xml \
httpd_conf.xml \
httpd_socket.xml \
@@ -67,41 +69,29 @@ XML_REF3_FILES = \
mod_security.xml
XML_PART_FILES = \
- part.xml \
- part_notes.xml \
- part_notes_history.xml
-XML_HTML_FILES = \
- notes_history.xml
+ part.xml
BOOK_FILES = book.xml
-XML_FILES = $(BOOK_FILES) \
- $(XML_CHAPTER_FILES) \
- $(XML_PART_FILES) \
- $(XML_REF6_FILES) \
- $(XML_REF3_FILES) \
- $(XML_APPLICATION_FILES)
+XML_FILES = \
+ $(BOOK_FILES) \
+ $(XML_CHAPTER_FILES) \
+ $(XML_PART_FILES) \
+ $(XML_REF6_FILES) \
+ $(XML_REF3_FILES) \
+ $(XML_APPLICATION_FILES)
-GIF_FILES = \
- inets.gif \
- notes.gif \
- ref_man.gif \
- book.gif \
- warning.gif \
- note.gif
+# GIF_FILES = inets.gif
# ----------------------------------------------------
HTML_FILES = \
$(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \
- $(XML_HTML_FILES:%.xml=$(HTMLDIR)/%.html) \
$(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html)
INFO_FILE = ../../info
EXTRA_FILES = summary.html.src \
- $(DEFAULT_GIF_FILES) \
- $(DEFAULT_HTML_FILES) \
$(XML_REF3_FILES:%.xml=$(HTMLDIR)/%.html) \
$(XML_REF6_FILES:%.xml=$(HTMLDIR)/%.html) \
$(XML_CHAPTER_FILES:%.xml=$(HTMLDIR)/%.html)
@@ -208,6 +198,7 @@ clean_html:
clean_man:
rm -f $(MAN3_FILES)
+
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
@@ -216,11 +207,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
ifdef DOCSUPPORT
release_docs_spec: docs
+ @echo "release_docs_spec(docs) when DOCSUPPORT=$DOCSUPPORT"
$(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
$(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
$(INSTALL_DIR) $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
+ $(INSTALL_DATA) $(HTMLDIR)/* $(RELSYSDIR)/doc/html
$(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
$(INSTALL_DIR) $(RELEASE_PATH)/man/man3
$(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
@@ -228,15 +219,18 @@ else
ifeq ($(DOCTYPE),pdf)
release_docs_spec: pdf
+ @echo "release_docs_spec(pdf)"
$(INSTALL_DIR) $(RELEASE_PATH)/pdf
$(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
else
ifeq ($(DOCTYPE),ps)
release_docs_spec: ps
+ @echo "release_docs_spec(ps)"
$(INSTALL_DIR) $(RELEASE_PATH)/ps
$(INSTALL_DATA) $(TOP_PS_FILE) $(RELEASE_PATH)/ps
else
release_docs_spec: docs
+ @echo "release_docs_spec(docs)"
$(INSTALL_DIR) $(RELSYSDIR)/doc/html
$(INSTALL_DATA) $(GIF_FILES) $(EXTRA_FILES) $(HTML_FILES) \
$(RELSYSDIR)/doc/html
@@ -260,10 +254,6 @@ info:
@echo ""
@echo "TOP_HTML_FILES:\n$(TOP_HTML_FILES)"
@echo ""
- @echo "DEFAULT_GIF_FILES:\n$(DEFAULT_GIF_FILES)"
- @echo ""
- @echo "DEFAULT_HTML_FILES:\n$(DEFAULT_HTML_FILES)"
- @echo ""
@echo "XML_REF3_FILES:\n$(XML_REF3_FILES)"
@echo ""
@echo "XML_REF6_FILES:\n$(XML_REF6_FILES)"
diff --git a/lib/inets/doc/src/ftp.xml b/lib/inets/doc/src/ftp.xml
index 9ecca3dde1..25dfe716fc 100644
--- a/lib/inets/doc/src/ftp.xml
+++ b/lib/inets/doc/src/ftp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>ftp</title>
@@ -534,12 +534,14 @@
<fsummary>Start an standalone ftp client.</fsummary>
<type>
<v>Host = string() | ip_address()</v>
- <v>Opts = start_options() | open_options()</v>
- <v>start_options() = [start_option()]</v>
+ <v>Opts = options()</v>
+ <v>options() = [option()]</v>
+ <v>option() = start_option() | open_option()</v>
+ <!-- <v>start_options() = [start_option()]</v> -->
<v>start_option() = {verbose, verbose()} | {debug, debug()}</v>
<v>verbose() = boolean() (defaults to false)</v>
<v>debug() = disable | debug | trace (defaults to disable)</v>
- <v>open_options() = [open_option()]</v>
+ <!-- <v>open_options() = [open_option()]</v> -->
<v>open_option() = {ipfamily, ipfamily()} | {port, port()} | {mode, mode()} | {timeout, timeout()} | {progress, progress()}</v>
<v>ipfamily() = inet | inet6 | inet6fb4 (defaults to inet)</v>
<v>port() = integer() > 0 (defaults to 21)</v>
@@ -845,7 +847,7 @@
<type>
<v>Pid = pid()</v>
<v>Command = string()</v>
- <v>FTPLine = string() - Note the telnet end of line characters, from the ftp protocol definition, CRLF e.g. "\\r\ " has been removed.</v>
+ <v>FTPLine = string() - Note the telnet end of line characters, from the ftp protocol definition, CRLF e.g. "\\r\\n" has been removed.</v>
</type>
<desc>
<p>Sends an arbitrary FTP command and returns verbatimly a list
diff --git a/lib/inets/doc/src/http_server.xml b/lib/inets/doc/src/http_server.xml
index 56317d647c..547617e2e3 100644
--- a/lib/inets/doc/src/http_server.xml
+++ b/lib/inets/doc/src/http_server.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>HTTP server </title>
@@ -82,7 +82,7 @@
<p>The server is configured using an erlang property list.
For the available properties see
- <seealso marker="inets:inets">httpd(3)</seealso>
+ <seealso marker="httpd">httpd(3)</seealso>
For backwards compatibility also apache-like config files
are supported.
</p>
@@ -246,7 +246,7 @@
every row contains the name of the group and the members
of the group separated by a space, for example:</p>
<pre>
-\011 GroupName: Member1 Member2 .... MemberN
+GroupName: Member1 Member2 .... MemberN
</pre>
</item>
<item>
@@ -278,8 +278,8 @@
and every row contains User Name and Password separated by a
colon, for example:</p>
<pre>
-\011 UserName:Password
-\011 UserName:Password
+UserName:Password
+UserName:Password
</pre>
</item>
<item>
@@ -299,11 +299,11 @@
the specified methods. If no request method is specified
all request methods are verified against the restrictions.</p>
<pre>
-\011 &lt;Limit POST GET HEAD&gt;
-\011 order allow deny
-\011 require group group1
-\011 allow from 123.145.244.5
-\011 &lt;/Limit&gt;
+&lt;Limit POST GET HEAD&gt;
+ order allow deny
+ require group group1
+ allow from 123.145.244.5
+&lt;/Limit&gt;
</pre>
</item>
<item>
@@ -363,12 +363,10 @@
message-body, separated by a blank line. The message-header
contains one or more header fields. The body may be
empty. Example: </p>
- <code type="none">
-"Content-Type:text/plain\
-Accept-Ranges:none\
-\
-some very
-\011plain text" </code>
+
+ <code>"Content-Type:text/plain\nAccept-Ranges:none\n\nsome very
+ plain text" </code>
+
<p>The server will interpret the cgi-headers and most of them
will be transformed into HTTP headers and sent back to the
client together with the body.</p>
@@ -387,7 +385,7 @@ some very
the extra overhead. An URL which calls an Erlang erl function
has the following syntax (regular expression): </p>
<code type="none">
-\011 http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
+http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
</code>
<p>*** above depends on how the ErlScriptAlias config
directive has been used</p>
@@ -428,7 +426,7 @@ http://your.server.org/***/Mod:Func(Arg1,...,ArgN)
http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[])))
</code>
<p>which effectively will close down the Erlang node,
- that is use the erl scheme instead, until this
+ therefor, use the erl scheme instead, until this
security breach has been fixed.</p>
<p>Today there are no good way of solving this problem
and therefore Eval Scheme may be removed in future
@@ -498,14 +496,14 @@ http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[
for parsed files, for example:
</p>
<pre>
-\011text/x-server-parsed-html shtml shtm
+ text/x-server-parsed-html shtml shtm
</pre>
<p>This makes files ending with <c>.shtml</c> and <c>.shtm</c>
into parsed files. Alternatively, if the performance hit is not a
problem, <em>all</em> HTML pages can be marked as parsed:
</p>
<pre>
-\011text/x-server-parsed-html html htm
+ text/x-server-parsed-html html htm
</pre>
</section>
@@ -518,7 +516,7 @@ http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[
unparsed. Each directive has the following format:
</p>
<pre>
-\011&lt;!--#command tag1="value1" tag2="value2" --&gt;
+ &lt;!--#command tag1="value1" tag2="value2" --&gt;
</pre>
<p>Each command takes different arguments, most only accept one
tag at a time. Here is a breakdown of the commands and their
@@ -612,7 +610,7 @@ http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[
<item>
<p>The unescaped version of any search query the client
sent, with all shell-special characters escaped with
- <c>\\</c>.</p>
+ <c>\</c>.</p>
</item>
<tag><c>DATE_LOCAL</c></tag>
<item>
@@ -753,24 +751,28 @@ http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[
schema and the tables already is created. </p>
<code>
- -module(mnesia_test).
- -export([start/0,load_data/0]).
- -include("mod_auth.hrl").
-
- first_start()->
- mnesia:create_schema([node()]),
- mnesia:start(),
- mnesia:create_table(httpd_user,
- [{type,bag},{disc_copies,[node()]},
- {attributes,record_info(fields,httpd_user)}]),
- mnesia:create_table(httpd_group,
- [{type,bag},{disc_copies,[node()]},
- {attributes,record_info(fields,httpd_group)}]),
- mnesia:wait_for_tables([httpd_user,httpd_group],60000).
-
- start()->
- mnesia:start(),
- mnesia:wait_for_tables([httpd_user,httpd_group],60000).
+-module(mnesia_test).
+-export([start/0,load_data/0]).
+-include("mod_auth.hrl").
+
+first_start() ->
+ mnesia:create_schema([node()]),
+ mnesia:start(),
+ mnesia:create_table(httpd_user,
+ [{type, bag},
+ {disc_copies, [node()]},
+ {attributes, record_info(fields,
+ httpd_user)}]),
+ mnesia:create_table(httpd_group,
+ [{type, bag},
+ {disc_copies, [node()]},
+ {attributes, record_info(fields,
+ httpd_group)}]),
+ mnesia:wait_for_tables([httpd_user, httpd_group], 60000).
+
+start() ->
+ mnesia:start(),
+ mnesia:wait_for_tables([httpd_user, httpd_group], 60000).
</code>
<p>To create the Mnesia tables we use two records defined in
diff --git a/lib/inets/doc/src/http.xml b/lib/inets/doc/src/httpc.xml
index f6f8338113..e143ba2c1a 100644
--- a/lib/inets/doc/src/http.xml
+++ b/lib/inets/doc/src/httpc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,26 +13,26 @@
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.
-
+
</legalnotice>
- <title>http</title>
+ <title>httpc</title>
<prepared>Ingela Anderton Andin</prepared>
<responsible></responsible>
<docno></docno>
<date></date>
<rev></rev>
</header>
- <module>http</module>
+ <module>httpc</module>
<modulesummary>An HTTP/1.1 client </modulesummary>
<description>
- <p>This module provides the API to a HTTP/1.1 client according to
- RFC 2616, caching is currently not supported.</p>
+ <p>This module provides the API to a HTTP/1.1 compatible client according
+ to RFC 2616, caching is currently not supported.</p>
<note>
<p>When starting the Inets application a manager process for the
default profile will be started. The functions in this API
@@ -64,6 +64,8 @@ request_id() = ref()
profile() = atom()
path() = string() representing a file path or directory path
ip_address() = See inet(3)
+socket_opt() = See the Options used by gen_tcp(3) and
+ ssl(3) connect(s)
]]></code>
</section>
@@ -130,38 +132,23 @@ ssl_options() = {verify, code()} |
<p>The client can be stopped using inets:stop(httpc, Pid) or
inets:stop(httpc, Profile).</p>
- <marker id="cancel_request"></marker>
+ <marker id="request1"></marker>
</section>
<funcs>
<func>
- <name>cancel_request(RequestId) -> </name>
- <name>cancel_request(RequestId, Profile) -> ok</name>
- <fsummary>Cancels an asynchronous HTTP-request.</fsummary>
- <type>
- <v>RequestId = request_id() - A unique identifier as returned
- by request/4</v>
- <v>Profile = profile()</v>
- </type>
- <desc>
- <p>Cancels an asynchronous HTTP-request. </p>
-
- <marker id="request1"></marker>
- </desc>
- </func>
-
- <func>
<name>request(Url) -> </name>
<name>request(Url, Profile) -> {ok, Result} | {error, Reason}</name>
<fsummary>Sends a get HTTP-request</fsummary>
<type>
- <v>Url = url() </v> <v>Result = {status_line(), headers(),
- body()} | {status_code(), body()} | request_id() </v>
+ <v>Url = url() </v>
+ <v>Result = {status_line(), headers(), body()} |
+ {status_code(), body()} | request_id() </v>
<v>Profile = profile()</v>
<v>Reason = term() </v>
</type>
<desc>
- <p>Equivalent to http:request(get, {Url, []}, [], []).</p>
+ <p>Equivalent to httpc:request(get, {Url, []}, [], []).</p>
<marker id="request2"></marker>
</desc>
@@ -177,23 +164,30 @@ ssl_options() = {verify, code()} |
<v>Request = request()</v>
<v>HTTPOptions = http_options()</v>
<v>http_options() = [http_option()]</v>
- <v>http_option() = {timeout, timeout()} |
+ <v>http_option() = {timeout, timeout()} |
{connect_timeout, timeout()} |
- {ssl, ssl_options()} |
- {autoredirect, boolean()} |
+ {ssl, ssl_options()} |
+ {autoredirect, boolean()} |
{proxy_auth, {userstring(), passwordstring()}} |
- {version, http_version()} |
- {relaxed, boolean()}</v>
+ {version, http_version()} |
+ {relaxed, boolean()}</v>
<v>timeout() = integer() >= 0 | infinity</v>
<v>Options = options()</v>
<v>options() = [option()]</v>
- <v>option() = {sync, boolean()} |
- {stream, stream_to()} |
- {body_format, body_format()} |
- {full_result, boolean()} |
- {headers_as_is, boolean()}</v>
- <v>stream_to() = self | {self, once} | filename() </v>
- <v>body_format() = string() | binary() </v>
+ <v>option() = {sync, boolean()} |
+ {stream, stream_to()} |
+ {body_format, body_format()} |
+ {full_result, boolean()} |
+ {headers_as_is, boolean() |
+ {socket_opts, socket_opts()} |
+ {receiver, receiver()}}</v>
+ <v>stream_to() = none | self | {self, once} | filename() </v>
+ <v>socket_opts() = [socket_opt()]</v>
+ <v>receiver() = pid() | function()/1 | {Module, Function, Args} </v>
+ <v>Module = atom() </v>
+ <v>Function = atom() </v>
+ <v>Args = list() </v>
+ <v>body_format() = string | binary </v>
<v>Result = {status_line(), headers(), body()} |
{status_code(), body()} | request_id() </v>
<v>Profile = profile() </v>
@@ -203,29 +197,25 @@ ssl_options() = {verify, code()} |
<desc>
<p>Sends a HTTP-request. The function can be both synchronous
and asynchronous. In the later case the function will return
- {ok, RequestId} and later on message(s) will be sent to the
- calling process on the format: </p>
-<pre>
- {http, {RequestId, Result}}
- {http, {RequestId, {error, Reason}}}
- {http, {RequestId, stream_start, Headers}
- {http, {RequestId, stream, BinBodyPart}
- {http, {RequestId, stream_end, Headers}
- {http, {RequestId, saved_to_file}}.
-</pre>
+ {ok, RequestId} and later on the information will be delivered
+ to the <c>receiver</c> depending on that value. </p>
<p>Http option (<c>http_option()</c>) details: </p>
<taglist>
<tag><c><![CDATA[timeout]]></c></tag>
<item>
<p>Timeout time for the request. </p>
+ <p>The clock start ticking as soon as the request has been
+ sent. </p>
+ <p>Time is in milliseconds. </p>
<p>Defaults to <c>infinity</c>. </p>
</item>
<tag><c><![CDATA[connect_timeout]]></c></tag>
<item>
<p>Connection timeout time, used during the initial request,
- when the client is connecting to the server. </p>
+ when the client is <em>connecting</em> to the server. </p>
+ <p>Time is in milliseconds. </p>
<p>Defaults to the value of the <c>timeout</c> option. </p>
</item>
@@ -329,8 +319,92 @@ ssl_options() = {verify, code()} |
<p>Defaults to <c>false</c>. </p>
</item>
+ <tag><c><![CDATA[socket_opts]]></c></tag>
+ <item>
+ <p>Socket options to be used for this and subsequent
+ request(s). </p>
+ <p>Overrides any value set by the
+ <seealso marker="set_options">set_options</seealso>
+ function. </p>
+ <p>Note that the validity of the options are <em>not</em>
+ checked in any way. </p>
+ <p>Note that this may change the socket behaviour
+ (see <seealso marker="inet#setopts">inet:setopts/2</seealso>)
+ for an already existing, and therefor already connected
+ request handler. </p>
+ <p>By defaults the socket options set by the
+ <seealso marker="#set_options">set_options/1,2</seealso>
+ function is used when establishing connection. </p>
+ </item>
+
+ <tag><c><![CDATA[receiver]]></c></tag>
+ <item>
+ <p>Defines how the client will deliver the result for a
+ asynchroneous request (<c>sync</c> has the value
+ <c>false</c>). </p>
+
+ <taglist>
+ <tag><c><![CDATA[pid()]]></c></tag>
+ <item>
+ <p>Message(s) will be sent to this process in the format: </p>
+<pre>
+{http, ReplyInfo}
+</pre>
+ </item>
+
+ <tag><c><![CDATA[function/1]]></c></tag>
+ <item>
+ <p>Information will be delivered to the receiver via calls
+ to the provided fun: </p>
+<pre>
+Receiver(ReplyInfo)
+</pre>
+ </item>
+
+ <tag><c><![CDATA[{Module, Funcion, Args}]]></c></tag>
+ <item>
+ <p>Information will be delivered to the receiver via calls
+ to the callback function: </p>
+<pre>
+apply(Module, Function, [ReplyInfo | Args])
+</pre>
+ </item>
+
+ </taglist>
+ <p>In all cases above, <c>ReplyInfo</c> has the following
+ structure: </p>
+
+<pre>
+{RequestId, saved_to_file}
+{RequestId, {error, Reason}}
+{RequestId, Result}
+{RequestId, stream_start, Headers}
+{RequestId, stream_start, Headers, HandlerPid}
+{RequestId, stream, BinBodyPart}
+{RequestId, stream_end, Headers}
+</pre>
+
+ <p>Defaults to the <c>pid()</c> of the process calling the request
+ function (<c>self()</c>). </p>
+ </item>
</taglist>
+ <marker id="cancel_request"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>cancel_request(RequestId) -> </name>
+ <name>cancel_request(RequestId, Profile) -> ok</name>
+ <fsummary>Cancels an asynchronous HTTP-request.</fsummary>
+ <type>
+ <v>RequestId = request_id() - A unique identifier as returned
+ by request/4</v>
+ <v>Profile = profile()</v>
+ </type>
+ <desc>
+ <p>Cancels an asynchronous HTTP-request. </p>
+
<marker id="set_options"></marker>
</desc>
</func>
@@ -341,17 +415,30 @@ ssl_options() = {verify, code()} |
<fsummary>Sets options to be used for subsequent requests.</fsummary>
<type>
<v>Options = [Option]</v>
- <v>Option = {proxy, {Proxy, NoProxy}} | {max_sessions, MaxSessions} |
- {max_keep_alive_length, MaxKeepAlive} | {keep_alive_timeout, KeepAliveTimeout} |
- {max_pipeline_length, MaxPipeline} | {pipeline_timeout, PipelineTimeout} |
- {cookies | CookieMode} |
- {ipfamily, IpFamily} | {ip, IpAddress} | {port, Port} |
- {verbose, VerboseMode} </v>
+ <v>Option = {proxy, {Proxy, NoProxy}} |
+ {max_sessions, MaxSessions} |
+ {max_keep_alive_length, MaxKeepAlive} |
+ {keep_alive_timeout, KeepAliveTimeout} |
+ {max_pipeline_length, MaxPipeline} |
+ {pipeline_timeout, PipelineTimeout} |
+ {cookies, CookieMode} |
+ {ipfamily, IpFamily} |
+ {ip, IpAddress} |
+ {port, Port} |
+ {socket_opts, socket_opts()} |
+ {verbose, VerboseMode} </v>
<v>Proxy = {Hostname, Port}</v>
<v>Hostname = string() </v>
<d>ex: "localhost" or "foo.bar.se"</d>
<v>Port = integer()</v>
<d>ex: 8080 </d>
+ <v>socket_opts() = [socket_opt()]</v>
+ <d>The options are appended to the socket options used by the
+ client. </d>
+ <d>These are the default values when a new request handler
+ is started (for the initial connect). They are passed directly
+ to the underlying transport (gen_tcp or ssl) <em>without</em>
+ verification! </d>
<v>NoProxy = [NoProxyDesc]</v>
<v>NoProxyDesc = DomainDesc | HostName | IPDesc</v>
<v>DomainDesc = "*.Domain"</v>
@@ -439,12 +526,13 @@ ssl_options() = {verify, code()} |
same behavior as active once for sockets.</p>
<marker id="verify_cookie"></marker>
+ <marker id="store_cookie"></marker>
</desc>
</func>
<func>
- <name>verify_cookie(SetCookieHeaders, Url) -> </name>
- <name>verify_cookie(SetCookieHeaders, Url, Profile) -> ok | {error, Reason}</name>
+ <name>store_cookie(SetCookieHeaders, Url) -> </name>
+ <name>store_cookie(SetCookieHeaders, Url, Profile) -> ok | {error, Reason}</name>
<fsummary>Saves the cookies defined in SetCookieHeaders in the client profile's cookie database.</fsummary>
<type>
<v>SetCookieHeaders = headers() - where field = "set-cookie"</v>
@@ -454,7 +542,7 @@ ssl_options() = {verify, code()} |
<desc>
<p>Saves the cookies defined in SetCookieHeaders
in the client profile's cookie database. You need to
- call this function if you set the option cookies to verify.
+ call this function if you set the option cookies to <c>verify</c>.
If no profile is specified the default profile will be used.
</p>
@@ -476,6 +564,43 @@ ssl_options() = {verify, code()} |
when making a request to Url using the profile Profile.
If no profile is specified the default profile will be used.
</p>
+
+ <marker id="reset_cookies"></marker>
+ </desc>
+ </func>
+
+
+ <func>
+ <name>reset_cookies() -> void()</name>
+ <name>reset_cookies(Profile) -> void()</name>
+ <fsummary>Reset the cookie database.</fsummary>
+ <type>
+ <v>Profile = profile()</v>
+ </type>
+ <desc>
+ <p>Resets (clears) the cookie database for the specified Profile.
+ If no profile is specified the default profile will be used.
+ </p>
+ </desc>
+ </func>
+
+
+ <func>
+ <name>which_cookies() -> cookies()</name>
+ <name>which_cookies(Profile) -> cookies()</name>
+ <fsummary>Dumps out the entire cookie database.</fsummary>
+ <type>
+ <v>Profile = profile()</v>
+ <v>cookies() = [cooie_stores()]</v>
+ <v>cookie_stores() = {cookies, icookies()} | {session_cookies, icookies()}</v>
+ <v>icookies() = [icookie()]</v>
+ <v>cookie() = term()</v>
+ </type>
+ <desc>
+ <p>This function produces a list of the entire cookie database.
+ It is intended for debugging/testing purposes.
+ If no profile is specified the default profile will be used.
+ </p>
</desc>
</func>
</funcs>
@@ -483,6 +608,7 @@ ssl_options() = {verify, code()} |
<section>
<title>SEE ALSO</title>
<p>RFC 2616, <seealso marker="inets">inets(3)</seealso>,
+ <seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>,
<seealso marker="ssl:ssl">ssl(3)</seealso>
</p>
</section>
diff --git a/lib/inets/doc/src/httpd.xml b/lib/inets/doc/src/httpd.xml
index 60afcc6cfe..7dabeb33e9 100644
--- a/lib/inets/doc/src/httpd.xml
+++ b/lib/inets/doc/src/httpd.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>httpd</title>
@@ -93,7 +93,7 @@
followed by the value followed by a new line. Ex:
<code>
- {server_root, "/urs/local/www"} -> ServerRoot /usr/local/www
+{server_root, "/urs/local/www"} -> ServerRoot /usr/local/www
</code>
<p>With a few exceptions, that are documented
@@ -103,9 +103,9 @@
as:</p>
<pre>
<![CDATA[
- <Directory Dir>
- <Properties handled as described above>
- </Directory>
+<Directory Dir>
+ <Properties handled as described above>
+</Directory>
]]>
</pre>
</item>
@@ -239,9 +239,9 @@
as an Apache like file as well as directly in the property list. Such
a file may look like:</p>
<pre>
- \011 # MIME type\011\011\011Extension
- \011 text/html\011\011\011html htm
- \011 text/plain\011\011\011asc txt
+# MIME type Extension
+text/html html htm
+text/plain asc txt
</pre>
<p>Defaults to [{"html","text/html"},{"htm","text/html"}]</p>
@@ -869,19 +869,19 @@ bytes
ModData = #mod{}
-record(mod, {
-\011\011data = [],
-\011\011socket_type = ip_comm,
-\011\011socket,
-\011\011config_db,
-\011\011method,
-\011\011absolute_uri,
-\011\011request_uri,
-\011\011http_version,
-\011\011request_line,
-\011\011parsed_header = [],
-\011\011entity_body,
-\011\011connection
-\011 }).
+ data = [],
+ socket_type = ip_comm,
+ socket,
+ config_db,
+ method,
+ absolute_uri,
+ request_uri,
+ http_version,
+ request_line,
+ parsed_header = [],
+ entity_body,
+ connection
+ }).
</code>
<p>The fields of the <c>mod</c> record has the following meaning:
</p>
diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml
index 1566ee29d1..642e5213b0 100644
--- a/lib/inets/doc/src/httpd_util.xml
+++ b/lib/inets/doc/src/httpd_util.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>httpd_util</title>
@@ -218,7 +218,8 @@
<marker id="lookup_mime"></marker>
<p><c>lookup_mime</c> returns the mime type associated with a
specific file suffix as specified in the <c>mime.types</c>
- file (located in the <path unix="$SERVER_ROOT/conf/mime.types" windows="%SERVER_ROOT%\\\\conf\\\\mime.types">config directory</path>).</p>
+ file (located in the
+ <path unix="$SERVER_ROOT/conf/mime.types" windows="%SERVER_ROOT%\conf\mime.types">config directory</path>).</p>
<marker id="lookup_mime_default"></marker>
</desc>
@@ -239,7 +240,7 @@
<p><c>lookup_mime_default</c> returns the mime type associated
with a specific file suffix as specified in the
<c>mime.types</c> file (located in the
- <path unix="$SERVER_ROOT/conf/mime.types" windows="%SERVER_ROOT%\\\\conf\\\\mime.types">config directory</path>).
+ <path unix="$SERVER_ROOT/conf/mime.types" windows="%SERVER_ROOT%\conf\mime.types">config directory</path>).
If no appropriate association can be found
the value of DefaultType is
returned.</p>
diff --git a/lib/inets/doc/src/inets.xml b/lib/inets/doc/src/inets.xml
index e5fe32f32f..81dfe7e944 100644
--- a/lib/inets/doc/src/inets.xml
+++ b/lib/inets/doc/src/inets.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2007</year><year>2009</year>
+ <year>2007</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>inets</title>
@@ -129,7 +129,7 @@
</type>
<desc>
<p>Dynamically starts an inets service after the inets
- application has been started.\011</p>
+ application has been started. </p>
<note>
<p>Dynamically started services will not be handled by
application takeover and failover behavior when inets is
diff --git a/lib/inets/doc/src/make.dep b/lib/inets/doc/src/make.dep
index d96c6dc5b8..8deb7e7a5a 100644
--- a/lib/inets/doc/src/make.dep
+++ b/lib/inets/doc/src/make.dep
@@ -1,3 +1,23 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1999-2010. 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.
+#
+# %CopyrightEnd%
+#
+#
+
# ----------------------------------------------------
# >>>> Do not edit this file <<<<
# This file was automaticly generated by
@@ -9,7 +29,7 @@
# TeX files that the DVI file depend on
# ----------------------------------------------------
-book.dvi: book.tex ftp.tex ftp_client.tex http.tex http_client.tex \
+book.dvi: book.tex ftp.tex ftp_client.tex httpc.tex http_client.tex \
http_server.tex httpd.tex httpd_conf.tex httpd_socket.tex \
httpd_util.tex inets.tex inets_services.tex \
mod_alias.tex mod_auth.tex mod_esi.tex mod_security.tex \
diff --git a/lib/inets/doc/src/mod_esi.xml b/lib/inets/doc/src/mod_esi.xml
index d4541a1d15..6bad77dc0a 100644
--- a/lib/inets/doc/src/mod_esi.xml
+++ b/lib/inets/doc/src/mod_esi.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>mod_esi</title>
@@ -94,7 +94,7 @@
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
- <em>End of HTTP header</em> that is <c>"\\r\ \\r\ "</c>
+ <em>End of HTTP header</em> that is <c>"\r\n\r\n"</c>
the server will
assume that no HTTP header fields will be generated.</p>
</desc>
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 687e127d0b..e95c8d6e97 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>Inets Release Notes</title>
@@ -32,21 +32,108 @@
<file>notes.xml</file>
</header>
- <section><title>Inets 5.2.0.1</title>
+ <section><title>Inets 5.3</title>
<section><title>Improvements and New Features</title>
- <p>-</p>
<!--
+ <p>-</p>
+-->
+
<list>
<item>
- <p>The documentation is now built with open source tools
- (<em>xsltproc</em> and <em>fop</em>) that exists on most
- platforms. One visible change is that the frames are removed.</p>
- <p>Own Id: OTP-8249</p>
+ <p>[httpc] - Allow users to pass socket options to the transport
+ module when making requests. </p>
+ <p>See the <c>socket_opts</c> option in the
+ <seealso marker="httpc#request2">request/4</seealso> or
+ <seealso marker="httpc#set_options">set_options/1,2</seealso>
+ for more info, </p>
+ <p>Own Id: OTP-8352</p>
</item>
- </list>
+ <item>
+ <p>[httpc] Fix bug crafting Host header when port is not 80. </p>
+ <p>The host header should include the port number as well as the
+ host name when making a request to a server listening on a port
+ other than the HTTP default of 80. Currently, only the host
+ name is included. This is important to make the http client
+ more compliant with the HTTP specification. </p>
+ <p>Own Id: OTP-8371</p>
+ <p>Kelly McLaughlin</p>
+ </item>
+
+ <item>
+ <p>[httpc|httpd] http_chunk data handling/passing improvement. </p>
+ <p>This is a modification to the http_chunk module to forward any
+ full chunk received, regardless of whether the size field for the
+ following chunk has been received yet. This allows http_chunk to
+ be used in situations where a long term HTTP connection is used to
+ send periodic status updates as individual chunks. Previously a
+ given chunk would not be forwarded to the client process until the
+ size for the next chunk had been read which rendered the module
+ difficult to use for the scenario described. </p>
+ <p>Bernard Duggan</p>
+ <p>Own Id: OTP-8351</p>
+ </item>
+
+ <item>
+ <p>Include the inets test suite in the release of the
+ application. </p>
+ <p>Own Id: OTP-8349</p>
+ </item>
+
+ <item>
+ <p>[httpc] - It is now possible to configure the client to
+ deliver an async reply to more receivers then the calling
+ process. </p>
+ <p>See the
+ <seealso marker="httpc#request2">receiver</seealso>
+ option for more info, </p>
+ <p>Own Id: OTP-8106</p>
+ </item>
+
+ <item>
+ <p>[httpd] - Methods "PUT" and "DELETE" now allowed. </p>
+ <p>Own Id: OTP-8103</p>
+ </item>
+
+ <item>
+ <p>[httpc] Several more or less critical fixes:</p>
+ <p>
+ <list type="bulleted">
+ <item>
+ <p>Initial call between the httpc manager and request
+ handler was synchronous. </p>
+ <p>When the manager starts a new request handler,
+ this is no longer a synchronous operation. Previously,
+ the new request handler made the connection to the
+ server and issuing of the first request (the reason
+ for starting it) in the gen_server init function.
+ If the connection for some reason "took some time",
+ the manager hanged, leaving all other activities by
+ that manager also hanging. </p>
+ </item>
+<!--
+ <item>
+ <p>Copying of data between processes</p>
+ <p>TBD</p>
+ </item>
+ <item>
+ <p>Reading of requests</p>
+ <p>TBD</p>
+ </item>
-->
+ </list>
+ </p>
+ <p>As a side-effect of these changes, some modules was also
+ renamed, and a new api module,
+ <seealso marker="httpc">httpc</seealso>, has been introduced
+ (the old module <c>http</c> is <em>not</em> removed, but is
+ now just wrapper for <c>httpc</c>). </p>
+ <p>Own Id: OTP-8016</p>
+ <p>*** POTENTIAL INCOMPATIBILITY ***</p>
+ </item>
+ </list>
</section>
<section><title>Fixed Bugs and Malfunctions</title>
@@ -57,13 +144,32 @@
<list>
<item>
- <p>Fixing minor Dialyzer and copyright problem.</p>
+ <p>[httpd] The server did not fully support the documented module
+ callback api. Specifically, the load function should be able to
+ return the atom <c>ok</c>, but this was not accepted. </p>
+ <p>Own Id: OTP-8359</p>
</item>
+ <item>
+ <p>Fixing various documentation-related bugs (bad quotes).</p>
+ <p>Own Id: OTP-8327</p>
+ </item>
+
+ <item>
+ <p>Fixing minor Dialyzer and copyright problem(s). </p>
+ <p>Own Id: OTP-8315</p>
+ </item>
+
+ <item>
+ <p>[httpc] - Added basic sanity check of option value
+ combinations.</p>
+ <p>Own Id: OTP-8056</p>
+ </item>
</list>
</section>
- </section> <!-- 5.2.0.1 -->
+ </section> <!-- 5.3 -->
<section><title>Inets 5.2</title>
@@ -173,7 +279,7 @@
<p>Timeout out requests are retried. </p>
</item>
</list>
- <p>Jean-S�bastien P�dron</p>
+ <p>Jean-S&#233;bastien P&#233;dron</p>
<p>Own Id: OTP-8248</p>
</item>
diff --git a/lib/inets/doc/src/notes_history.xml b/lib/inets/doc/src/notes_history.xml
index 53375c9aa7..6480bad758 100644
--- a/lib/inets/doc/src/notes_history.xml
+++ b/lib/inets/doc/src/notes_history.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>Inets Release Notes History</title>
@@ -385,8 +385,7 @@
</item>
<item>
<p>[httpc, httpd] - In some cases if a body contained the
- sequence "\\r\
- 0" and was chunked encoded this sequence
+ sequence "\r\n0" and was chunked encoded this sequence
was incorrectly interpreted as the last chunk.</p>
<p>Own Id: OTP-6264 Aux Id: OTP-6005 </p>
</item>
@@ -968,8 +967,7 @@
design was changed to use gen_tcp active once semantics.
The API is not effected except for the function
ftp:quote/2 which now returns a list of strings (ftp
- result lines) where the line endings "\\r\
- " has been
+ result lines) where the line endings "\r\n" has been
removed. This was the original intention for the return
value of ftp:quote/2 but it was non trivial to make a
good such solution with the old design and a compromise
@@ -1055,13 +1053,11 @@
<p>Own Id: OTP-5551 Aux Id: seq9854 </p>
</item>
<item>
- <p>The HTTP server now handles "GET /\\r\
- \\r\
- " as well as
- "GET / \\r\
- \\r\
- ". According to the RFC the whitespace is
- not needed.</p>
+ <p>The HTTP server now handles
+ "GET /\r\n\r\n"
+ as well as
+ "GET / \r\n\r\n".
+ According to the RFC the whitespace is not needed.</p>
<p>Own Id: OTP-5552 Aux Id: seq8426 </p>
</item>
</list>
diff --git a/lib/inets/doc/src/ref_man.xml b/lib/inets/doc/src/ref_man.xml
index 7ec2c041c8..45d5dfcd0e 100644
--- a/lib/inets/doc/src/ref_man.xml
+++ b/lib/inets/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
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.
-
+
</legalnotice>
<title>Inets Reference Manual</title>
@@ -36,7 +36,7 @@
<xi:include href="inets.xml"/>
<xi:include href="ftp.xml"/>
<xi:include href="tftp.xml"/>
- <xi:include href="http.xml"/>
+ <xi:include href="httpc.xml"/>
<xi:include href="httpd.xml"/>
<xi:include href="httpd_conf.xml"/>
<xi:include href="httpd_socket.xml"/>