From 6153ba7599f2ce1ab22959a40b6ca33b4238f0d0 Mon Sep 17 00:00:00 2001
From: Micael Karlberg Sends an arbitrary FTP command and returns verbatimly a list
diff --git a/lib/inets/doc/src/http.xml b/lib/inets/doc/src/http.xml
deleted file mode 100644
index f6f8338113..0000000000
--- a/lib/inets/doc/src/http.xml
+++ /dev/null
@@ -1,491 +0,0 @@
-
-
-
- This module provides the API to a HTTP/1.1 client according to
- RFC 2616, caching is currently not supported. When starting the Inets application a manager process for the
- default profile will be started. The functions in this API
- that does not explicitly use a profile will accesses the
- default profile. A profile keeps track of proxy options,
- cookies and other options that can be applied to more than one
- request. If the scheme
- https is used the ssl application needs to be started. Also note that pipelining will only be used if the pipeline
- timeout is set, otherwise persistent connections without
- pipelining will be used e.i. the client always waits for
- the previous response before sending the next request. There are some usage examples in the Type definitions that are used more than once in
- this module: Type definitions that are related to HTTP: For more information about HTTP see rfc 2616 Some type definitions relevant when using https,
- for details A HTTP client can be configured to start when starting the inets
- application or started dynamically in runtime by calling the
- inets application API The client can be stopped using inets:stop(httpc, Pid) or
- inets:stop(httpc, Profile). Cancels an asynchronous HTTP-request. Equivalent to http:request(get, {Url, []}, [], []). 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: Http option ( Timeout time for the request. Defaults to Connection timeout time, used during the initial request,
- when the client is connecting to the server. Defaults to the value of the If using SSL, these SSL-specific options are used. Defaults to Should the client automatically retreive the information
- from the new URI and return that as the result instead
- of a 30X-result code. Note that for some 30X-result codes automatic redirect
- is not allowed in these cases the 30X-result will always
- be returned. Defaults to A proxy-authorization header using the provided user name and
- password will be added to the request. Can be used to make the client act as an Defaults to the trsing If set to true workarounds for known server deviations from
- the HTTP-standard are enabled. Defaults to Option ( Shall the request be synchronous or asynchronous. Defaults to Streams the body of a 200 or 206 response to the calling
- process or to a file. When streaming to the calling process
- using the option Note that it is possible that chunked encoding will add
- headers so that there are more headers in the stream_end
- message than in the stream_start.
- When streaming to a file and the request is asynchronous the
- message {http, {RequestId, saved_to_file}} will be sent. Defaults to Defines if the body shall be delivered as a string or as a
- binary. This option is only valid for the synchronous
- request. Defaults to Should a "full result" be returned to the caller (that is,
- the body, the headers and the entire status-line) or not
- (the body and the status code). Defaults to Shall the headers provided by the user be made
- lower case or be regarded as case sensitive. Note that the http standard requires them to be
- case insenstive. This feature should only be used if there is
- no other way to communicate with the server or for testing
- purpose. Also note that when this option is used no headers
- will be automatically added, all necessary headers has to be
- provided by the user. Defaults to Sets options to be used for subsequent
- requests. If possible the client will keep its connections
- alive and use persistent connections
- with or without pipeline depending on configuration
- and current circumstances. The HTTP/1.1 specification does not
- provide a guideline for how many requests that would be
- ideal to be sent on a persistent connection,
- this very much depends on the
- application. Note that a very long queue of requests may cause a
- user perceived delays as earlier request may take a long time
- to complete. The HTTP/1.1 specification does suggest a
- limit of 2 persistent connections per server, which is the
- default value of the max_sessions option. Triggers the next message to be streamed, e.i.
- same behavior as active once for sockets. 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.
- If no profile is specified the default profile will be used.
- Returns the cookie header that would be sent
- when making a request to Url using the profile Profile.
- If no profile is specified the default profile will be used.
- RFC 2616, The server is configured using an erlang property list.
For the available properties see
-
-
-
-
-
-
- {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}}.
-
-
-
-\011 GroupName: Member1 Member2 .... MemberN
+GroupName: Member1 Member2 .... MemberN
-\011 UserName:Password -\011 UserName:Password +UserName:Password +UserName:Password
-\011 <Limit POST GET HEAD> -\011 order allow deny -\011 require group group1 -\011 allow from 123.145.244.5 -\011 </Limit> +<Limit POST GET HEAD> + order allow deny + require group group1 + allow from 123.145.244.5 +</Limit>
-"Content-Type:text/plain\
-Accept-Ranges:none\
-\
-some very
-\011plain text"
+
+ "Content-Type:text/plain\nAccept-Ranges:none\n\nsome very
+ plain text"
+
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.
@@ -387,7 +385,7 @@ some very the extra overhead. An URL which calls an Erlang erl function has the following syntax (regular expression):
-\011 http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
+http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
*** above depends on how the ErlScriptAlias config directive has been used
@@ -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,[])))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.
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:
-\011text/x-server-parsed-html shtml shtm + text/x-server-parsed-html shtml shtm
This makes files ending with
-\011text/x-server-parsed-html html htm + text/x-server-parsed-html html htm@@ -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:
-\011<!--#command tag1="value1" tag2="value2" --> + <!--#command tag1="value1" tag2="value2" -->
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,[
The unescaped version of any search query the client
sent, with all shell-special characters escaped with
-
- -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).
To create the Mnesia tables we use two records defined in
diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml
new file mode 100644
index 0000000000..680473cc38
--- /dev/null
+++ b/lib/inets/doc/src/httpc.xml
@@ -0,0 +1,581 @@
+
+
+
+ This module provides the API to a HTTP/1.1 compatible client according
+ to RFC 2616, caching is currently not supported. When starting the Inets application a manager process for the
+ default profile will be started. The functions in this API
+ that does not explicitly use a profile will accesses the
+ default profile. A profile keeps track of proxy options,
+ cookies and other options that can be applied to more than one
+ request. If the scheme
+ https is used the ssl application needs to be started. Also note that pipelining will only be used if the pipeline
+ timeout is set, otherwise persistent connections without
+ pipelining will be used e.i. the client always waits for
+ the previous response before sending the next request. There are some usage examples in the Type definitions that are used more than once in
+ this module: Type definitions that are related to HTTP: For more information about HTTP see rfc 2616 Some type definitions relevant when using https,
+ for details A HTTP client can be configured to start when starting the inets
+ application or started dynamically in runtime by calling the
+ inets application API The client can be stopped using inets:stop(httpc, Pid) or
+ inets:stop(httpc, Profile). Equivalent to httpc:request(get, {Url, []}, [], []). 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 the information will be delivered
+ to the Http option ( Timeout time for the request. The clock start ticking as soon as the request has been
+ sent. Time is in milliseconds. Defaults to Connection timeout time, used during the initial request,
+ when the client is connecting to the server. Time is in milliseconds. Defaults to the value of the If using SSL, these SSL-specific options are used. Defaults to Should the client automatically retreive the information
+ from the new URI and return that as the result instead
+ of a 30X-result code. Note that for some 30X-result codes automatic redirect
+ is not allowed in these cases the 30X-result will always
+ be returned. Defaults to A proxy-authorization header using the provided user name and
+ password will be added to the request. Can be used to make the client act as an Defaults to the trsing If set to true workarounds for known server deviations from
+ the HTTP-standard are enabled. Defaults to Option ( Shall the request be synchronous or asynchronous. Defaults to Streams the body of a 200 or 206 response to the calling
+ process or to a file. When streaming to the calling process
+ using the option Note that it is possible that chunked encoding will add
+ headers so that there are more headers in the stream_end
+ message than in the stream_start.
+ When streaming to a file and the request is asynchronous the
+ message {http, {RequestId, saved_to_file}} will be sent. Defaults to Defines if the body shall be delivered as a string or as a
+ binary. This option is only valid for the synchronous
+ request. Defaults to Should a "full result" be returned to the caller (that is,
+ the body, the headers and the entire status-line) or not
+ (the body and the status code). Defaults to Shall the headers provided by the user be made
+ lower case or be regarded as case sensitive. Note that the http standard requires them to be
+ case insenstive. This feature should only be used if there is
+ no other way to communicate with the server or for testing
+ purpose. Also note that when this option is used no headers
+ will be automatically added, all necessary headers has to be
+ provided by the user. Defaults to Defines how the client will deliver the result for a
+ asynchroneous request ( Message(s) will be sent to this process in the format: Information will be delivered to the receiver via calls
+ to the provided fun: Information will be delivered to the receiver via calls
+ to the callback function: In all cases above, Defaults to the Cancels an asynchronous HTTP-request. Sets options to be used for subsequent
+ requests. If possible the client will keep its connections
+ alive and use persistent connections
+ with or without pipeline depending on configuration
+ and current circumstances. The HTTP/1.1 specification does not
+ provide a guideline for how many requests that would be
+ ideal to be sent on a persistent connection,
+ this very much depends on the
+ application. Note that a very long queue of requests may cause a
+ user perceived delays as earlier request may take a long time
+ to complete. The HTTP/1.1 specification does suggest a
+ limit of 2 persistent connections per server, which is the
+ default value of the max_sessions option. Triggers the next message to be streamed, e.i.
+ same behavior as active once for sockets. 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 Returns the cookie header that would be sent
+ when making a request to Url using the profile Profile.
+ If no profile is specified the default profile will be used.
+ Resets (clears) the cookie database for the specified Profile.
+ If no profile is specified the default profile will be used.
+ 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.
+ RFC 2616, With a few exceptions, that are documented
@@ -103,9 +103,9 @@
as:
+
+
+
+
+
+{http, ReplyInfo}
+
+
+Receiver(ReplyInfo)
+
+
+apply(Module, Function, [ReplyInfo | Args])
+
+
+{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}
+
+
+
- {server_root, "/urs/local/www"} -> ServerRoot /usr/local/www
+{server_root, "/urs/local/www"} -> ServerRoot /usr/local/www
-
- \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
Defaults to [{"html","text/html"},{"htm","text/html"}]
@@ -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 + }).The fields of the
Dynamically starts an inets service after the inets - application has been started.\011
+ application has been started.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 @@
-
+The documentation is now built with open source tools - (xsltproc and fop) that exists on most - platforms. One visible change is that the frames are removed.
-Own Id: OTP-8249
+[httpc] Fix bug crafting Host header when port is not 80.
+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.
+Own Id: OTP-8371
+Kelly McLaughlin
[httpc|httpd] http_chunk data handling/passing improvement.
+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.
+Bernard Duggan
+Own Id: OTP-8351
+Include the inets test suite in the release of the + application.
+Own Id: OTP-8349
+[httpc] - It is now possible to configure the client to + deliver an async reply to more receivers then the calling + process.
+See the
+
Own Id: OTP-8106
+[httpd] - Methods "PUT" and "DELETE" now allowed.
+huntermorris@gmail.com
+Own Id: OTP-8103
+[httpc] Several more or less critical fixes:
+
+ Initial call between the httpc manager and request
+ handler was synchronous. 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.
+
+
As a side-effect of these changes, some modules was also
+ renamed, and a new api module,
+
Own Id: OTP-8016
+*** POTENTIAL INCOMPATIBILITY ***
+Fixing minor Dialyzer and copyright problem.
+[httpd] The server did not fully support the documented module
+ callback api. Spicifically, the load function should be able to
+ return the atom
Own Id: OTP-8359
Fixing various documentation-related bugs (bad quotes).
+Own Id: OTP-8327
+Fixing minor Dialyzer and copyright problem(s).
+Own Id: OTP-8315
+[httpc] - Added basic sanity check of option value + combinations.
+adam.kocoloski@gmail.com
+Own Id: OTP-8056
+[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.
Own Id: OTP-6264 Aux Id: OTP-6005
Own Id: OTP-5551 Aux Id: seq9854
The HTTP server now handles "GET /\\r\ - \\r\ - " as well as - "GET / \\r\ - \\r\ - ". According to the RFC the whitespace is - not needed.
+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.
Own Id: OTP-5552 Aux Id: seq8426