From 778a60894820bbecd2f3b62619e4c284c9e53ca9 Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Thu, 16 Dec 2010 11:22:02 +0000 Subject: Grammar and typo fixes for the httpc module documentation --- lib/inets/doc/src/httpc.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index c20358178b..69e1009bc2 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -36,7 +36,7 @@

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 + that do not explicitly use a profile will access the default profile. A profile keeps track of proxy options, cookies and other options that can be applied to more than one request.

@@ -209,7 +209,7 @@ ssl_options() = {verify, code()} |

Timeout time for the request.

-

The clock start ticking as soon as the request has been +

The clock starts ticking as soon as the request has been sent.

Time is in milliseconds.

Defaults to infinity.

@@ -246,11 +246,11 @@ ssl_options() = {verify, code()} | -

Should the client automatically retreive the information +

Should the client automatically retrieve 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 + is not allowed. In these cases the 30X-result will always be returned.

Defaults to true.

@@ -296,11 +296,11 @@ ssl_options() = {verify, code()} |

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 self the the following stream messages + using the option self the following stream messages will be sent to that process: {http, {RequestId, stream_start, Headers}, {http, {RequestId, stream, BinBodyPart}, {http, {RequestId, stream_end, Headers}. When - streaming to to the calling processes using the option + streaming to the calling processes using the option {self, once} the first message will have an additional element e.i. {http, {RequestId, stream_start, Headers, Pid}, this is the process id that should be used as an argument to @@ -338,7 +338,7 @@ ssl_options() = {verify, code()} | 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 + will be automatically added, all necessary headers have to be provided by the user.

Defaults to false.

@@ -354,17 +354,17 @@ ssl_options() = {verify, code()} | checked in any way.

Note that this may change the socket behaviour (see inet:setopts/2) - for an already existing, and therefor already connected + for an already existing one, and therefore an already connected request handler.

-

By defaults the socket options set by the +

By default the socket options set by the set_options/1,2 - function is used when establishing connection.

+ function are used when establishing the connection.

-

Defines how the client will deliver the result for a - asynchroneous request (sync has the value +

Defines how the client will deliver the result for an + asynchronous request (sync has the value false).

@@ -480,7 +480,7 @@ apply(Module, Function, [ReplyInfo | Args]) Default is 120000 (= 2 min). If a persistent connection is idle longer than the keep_alive_timeout the client will close the connection. - The server may also have a such a time out but you should + The server may also have such a timeout but you should not count on it! MaxPipeline = integer() Default is 2. @@ -527,7 +527,7 @@ apply(Module, Function, [ReplyInfo | Args]) 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 + user perceived delay as earlier requests 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.

-- cgit v1.2.3 From 748dbeb1524122229373c5964334a8d8f18a525d Mon Sep 17 00:00:00 2001 From: Christian von Roques Date: Wed, 15 Dec 2010 17:36:09 -0400 Subject: inets/httpc: Polish documentation * Assure store_cookies (and verify_cookies) is documented instead of the nonexistent store_cookie and verify_cookie. * Make sure the cookies option is not called cookie in comments. * Sprinkle ... arround symbols and code snippets in text. * Grammar, wording, and punctuation fixes. * Formalize See gen_tcp:connect/3,4 using . --- lib/inets/doc/src/http_client.xml | 8 ++-- lib/inets/doc/src/httpc.xml | 88 ++++++++++++++++++------------------- lib/inets/src/http_client/httpc.erl | 2 +- 3 files changed, 49 insertions(+), 49 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/http_client.xml b/lib/inets/doc/src/http_client.xml index 672ea3fa98..4542211d71 100644 --- a/lib/inets/doc/src/http_client.xml +++ b/lib/inets/doc/src/http_client.xml @@ -42,10 +42,10 @@ dynamically in runtime. Each client profile will spawn a new process to handle each request unless there is a possibility to use a persistent connection with or without pipelining. - The client will add a host header and an empty - te header if there are no such headers present in the request.

+ The client will add a host header and an empty + te header if there are no such headers present in the request.

-

The clients supports ipv6 as long as the underlying mechanisms also do +

The client supports ipv6 as long as the underlying mechanisms also do so.

@@ -87,7 +87,7 @@ httpc:request("http://www.erlang.org").

An ordinary asynchronous request. The result will be sent - to the calling process on the form {http, {ReqestId, Result}}

+ to the calling process in the form {http, {ReqestId, Result}}

5 > {ok, RequestId} = httpc:request(get, {"http://www.erlang.org", []}, [], [{sync, false}]). diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 69e1009bc2..5d1f027e24 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -117,7 +117,7 @@ ssl_options() = {verify, code()} | application or started dynamically in runtime by calling the inets application API inets:start(httpc, ServiceConfig), or inets:start(httpc, ServiceConfig, How) - see inets(3) Below follows a + see inets(3). Below follows a description of the available configuration options.

{profile, profile()} @@ -129,8 +129,8 @@ ssl_options() = {verify, code()} | as session cookies.
-

The client can be stopped using inets:stop(httpc, Pid) or - inets:stop(httpc, Profile).

+

The client can be stopped using inets:stop(httpc, Pid) or + inets:stop(httpc, Profile).

@@ -148,7 +148,7 @@ ssl_options() = {verify, code()} | Reason = term() -

Equivalent to httpc:request(get, {Url, []}, [], []).

+

Equivalent to httpc:request(get, {Url, []}, [], []).

@@ -201,7 +201,7 @@ ssl_options() = {verify, code()} |

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 + {ok, RequestId} and later on the information will be delivered to the receiver depending on that value.

Http option (http_option()) details:

@@ -267,12 +267,12 @@ ssl_options() = {verify, code()} | HTTP/0.9 client. By default this is an HTTP/1.1 client. When using HTTP/1.0 persistent connections will not be used.

-

Defaults to the trsing "HTTP/1.1".

+

Defaults to the string "HTTP/1.1".

-

If set to true workarounds for known server deviations from +

If set to true workarounds for known server deviations from the HTTP-standard are enabled.

Defaults to false.

@@ -297,20 +297,20 @@ ssl_options() = {verify, code()} |

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 self the following stream messages - will be sent to that process: {http, {RequestId, + will be sent to that process: {http, {RequestId, stream_start, Headers}, {http, {RequestId, stream, - BinBodyPart}, {http, {RequestId, stream_end, Headers}. When - streaming to the calling processes using the option + BinBodyPart}, {http, {RequestId, stream_end, Headers}. When + streaming to to the calling processes using the option {self, once} the first message will have an additional - element e.i. {http, {RequestId, stream_start, Headers, Pid}, + element e.i. {http, {RequestId, stream_start, Headers, Pid}, this is the process id that should be used as an argument to - http:stream_next/1 to trigger the next message to be sent to + http:stream_next/1 to trigger the next message to be sent to the calling process.

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

+ message {http, {RequestId, saved_to_file}} will be sent.

Defaults to none.

@@ -358,13 +358,13 @@ ssl_options() = {verify, code()} | request handler.

By default the socket options set by the set_options/1,2 - function are used when establishing the connection.

+ function are used when establishing a connection.

-

Defines how the client will deliver the result for an - asynchronous request (sync has the value +

Defines how the client will deliver the result of an + asynchroneous request (sync has the value false).

@@ -395,7 +395,7 @@ apply(Module, Function, [ReplyInfo | Args])
-

In all cases above, ReplyInfo has the following +

In all of the above cases, ReplyInfo has the following structure:

@@ -470,46 +470,46 @@ apply(Module, Function, [ReplyInfo | Args])
         IpDesc = string()
         ex: "134.138" or "[FEDC:BA98" (all IP-addresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP-address).
         MaxSessions = integer() 
-        Default is 2. 
+        Default is 2.
           Maximum number of persistent connections to a host.
 	MaxKeepAlive = integer() 
-        Default is 5. 
+        Default is 5.
           Maximum number of outstanding requests on the same connection to 
           a host.
         KeepAliveTimeout = integer() 
-        Default is 120000 (= 2 min). 
+        Default is 120000 (= 2 min).
           If a persistent connection is idle longer than the 
-          keep_alive_timeout the client will close the connection. 
-          The server may also have such a timeout but you should
+          keep_alive_timeout the client will close the connection.
+          The server may also have such a time out but you should
           not count on it!
 	MaxPipeline = integer() 
-        Default is 2. 
+        Default is 2.
           Maximum number of outstanding requests on a pipelined connection to a host.
         PipelineTimeout = integer() 
-        Default is 0, 
+        Default is 0,
           which will result in pipelining not being used. 
           If a persistent connection is idle longer than the 
-          pipeline_timeout the client will close the connection. 
+          pipeline_timeout the client will close the connection. 
         CookieMode = enabled | disabled | verify 
-        Default is disabled. 
+        Default is disabled.
           If Cookies are enabled all valid cookies will automatically be 
           saved in the client manager's cookie database. 
-          If the option verify is used the function http:verify_cookie/2 
-          has to be called for the cookie to be saved.
+          If the option verify is used the function store_cookies/2
+          has to be called for the cookies to be saved.
         IpFamily = inet | inet6 | inet6fb4 
-        By default inet. 
+        By default inet.
           When it is set to inet6fb4 you can use both ipv4 and ipv6. 
           It first tries inet6 and if that does not works falls back to inet. 
           The option is here to provide a workaround for buggy ipv6 stacks to ensure that 
           ipv4 will always work.
 	IpAddress = ip_address() 
         If the host has several network interfaces, this option specifies which one to use. 
-          See gen_tcp:connect/3,4 for more info. 
+          See gen_tcp:connect/3,4 for more info. 
 	Port = integer() 
         Specify which local port number to use. 
-          See gen_tcp:connect/3,4 for more info. 
+          See gen_tcp:connect/3,4 for more info. 
         VerboseMode = false | verbose | debug | trace 
-        Default is false. 
+        Default is false.
           This option is used to switch on (or off) 
           different levels of erlang trace on the client. 
           It is a debug feature.
@@ -523,14 +523,14 @@ apply(Module, Function, [ReplyInfo | Args])
             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
+            provide a guideline for how many requests 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 delay as earlier requests 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. 

+ default value of the max_sessions option.

@@ -549,14 +549,14 @@ apply(Module, Function, [ReplyInfo | Args])

Triggers the next message to be streamed, e.i. same behavior as active once for sockets.

- - + + - store_cookie(SetCookieHeaders, Url) -> - store_cookie(SetCookieHeaders, Url, Profile) -> ok | {error, Reason} + store_cookies(SetCookieHeaders, Url) -> + store_cookies(SetCookieHeaders, Url, Profile) -> ok | {error, Reason} Saves the cookies defined in SetCookieHeaders in the client profile's cookie database. SetCookieHeaders = headers() - where field = "set-cookie" @@ -566,7 +566,7 @@ apply(Module, Function, [ReplyInfo | Args])

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 have set the option cookies to verify. If no profile is specified the default profile will be used.

@@ -578,14 +578,14 @@ apply(Module, Function, [ReplyInfo | Args]) cookie_header(Url) -> cookie_header(Url, Profile) -> header() | {error, Rason} Returns the cookie header that would be sent when - making a request to Url using the profile Profile. + making a request to Url using the profile Profile. Url = url() Profile = profile()

Returns the cookie header that would be sent - when making a request to Url using the profile Profile. + when making a request to Url using the profile Profile. If no profile is specified the default profile will be used.

@@ -602,7 +602,7 @@ apply(Module, Function, [ReplyInfo | Args]) Profile = profile()
-

Resets (clears) the cookie database for the specified Profile. +

Resets (clears) the cookie database for the specified Profile. If no profile is specified the default profile will be used.

diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index ae754fab94..04fae13b20 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -252,7 +252,7 @@ set_option(Key, Value, Profile) -> %% Description: Store the cookies from %% in the cookie database %% for the profile . This function shall be used when the option -%% cookie is set to verify. +%% cookies is set to verify. %%------------------------------------------------------------------------- store_cookies(SetCookieHeaders, Url) -> store_cookies(SetCookieHeaders, Url, default_profile()). -- cgit v1.2.3 From e38a935df26ca0f37fa17c6df771430de18f9043 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 9 Jan 2011 18:09:29 +0100 Subject: Fix typo in httpc documentation --- lib/inets/doc/src/httpc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 5d1f027e24..bcdd2913e0 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -576,7 +576,7 @@ apply(Module, Function, [ReplyInfo | Args]) cookie_header(Url) -> - cookie_header(Url, Profile) -> header() | {error, Rason} + cookie_header(Url, Profile) -> header() | {error, Reason} Returns the cookie header that would be sent when making a request to Url using the profile Profile. -- cgit v1.2.3 From addf1fff40528d7de0b8ac0e290c8db4aee4694b Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 3 Mar 2011 19:12:36 +0100 Subject: Handling encoding of empty chunks. --- lib/inets/doc/src/notes.xml | 49 +++++++++++++++++++++++++++++---- lib/inets/src/http_lib/http_chunk.erl | 10 +++++-- lib/inets/src/inets_app/inets.appup.src | 12 +++++++- lib/inets/vsn.mk | 2 +- 4 files changed, 64 insertions(+), 9 deletions(-) (limited to 'lib/inets') diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index 11b0af4310..6fa3acd7e1 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -1,4 +1,4 @@ - + @@ -34,6 +34,21 @@
Inets 5.5.1 +
Improvements and New Features +

-

+ + + +
+
Fixed Bugs and Malfunctions @@ -52,6 +67,10 @@
+
+ + +
Inets 5.5.1
Improvements and New Features @@ -73,9 +92,28 @@
-
+
Fixed Bugs and Malfunctions + + +

Fix format_man_pages so it handles all man sections + and remove warnings/errors in various man pages.

+

+ Own Id: OTP-8600

+
+ +

+ [httpc] Pipelined and queued requests not processed when + connection closed remotelly.

+

+ Own Id: OTP-8906

+
+
+
-
Inets 5.5 +
+ + +
Inets 5.5
Fixed Bugs and Malfunctions @@ -120,9 +158,10 @@
-
+ + -
Inets 5.4 +
Inets 5.4
Improvements and New Features