aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-03-07 15:56:56 +0100
committerMicael Karlberg <[email protected]>2011-03-07 15:56:56 +0100
commit4c7786f58f8f101723b00e839baa068f8cf34579 (patch)
tree69b1b7b94e22ea8646c97dd81b2cdfceb895a3e6
parentf85c79166c0fcf39eaab62e39f392aa7ce83c9bf (diff)
parentad60a3f78e08c636514573e57a4240b259e2dcae (diff)
downloadotp-4c7786f58f8f101723b00e839baa068f8cf34579.tar.gz
otp-4c7786f58f8f101723b00e839baa068f8cf34579.tar.bz2
otp-4c7786f58f8f101723b00e839baa068f8cf34579.zip
Merge branch 'bmk/inets/httpd/dont_send_empty_chunk/OTP-9091' into dev
httpd_response:send_chunk handles empty list and empty binary - i.e. no chunk is sent, but it does not handle a list with an empty binary [<<>>]. This will be sent as an empty chunk - which in turn will be encoded by http_chunk to the same as a final chunk, which will make the http client believe that the end of the page is reached.
-rw-r--r--lib/inets/doc/src/notes.xml83
-rw-r--r--lib/inets/src/http_lib/http_chunk.erl10
-rw-r--r--lib/inets/src/inets_app/inets.appup.src14
-rw-r--r--lib/inets/vsn.mk2
4 files changed, 77 insertions, 32 deletions
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 11b0af4310..5da9d98002 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2002</year><year>2010</year>
+ <year>2002</year><year>2011</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,50 +32,78 @@
<file>notes.xml</file>
</header>
- <section><title>Inets 5.5.1</title>
+ <section><title>Inets 5.5.2</title>
- <section><title>Fixed Bugs and Malfunctions</title>
+ <section><title>Improvements and New Features</title>
+ <p>-</p>
+
+<!--
<list>
<item>
- <p> Fix format_man_pages so it handles all man sections
- and remove warnings/errors in various man pages. </p>
<p>
- Own Id: OTP-8600</p>
+ Miscellaneous inet6 related problems.</p>
+ <p>Own Id: OTP-8927</p>
</item>
+ </list>
+-->
+
+ </section>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
<item>
- <p>
- [httpc] Pipelined and queued requests not processed when
- connection closed remotelly.</p>
- <p>
- Own Id: OTP-8906</p>
+ <p>[httpd] httpd_response:send_chunk handles empty list and
+ empty binary - i.e. no chunk is sent, but it does
+ not handle a list with an empty binary [&lt;&lt;&gt;&gt;].
+ This will be sent as an empty chunk - which in turn
+ will be encoded by http_chunk to the same as a final
+ chunk, which will make the http client believe that
+ the end of the page is reached.</p>
+ <p>Own Id: OTP-8906</p>
</item>
</list>
</section>
+ </section> <!-- 5.5.2 -->
+
+
+ <section><title>Inets 5.5.1</title>
<section><title>Improvements and New Features</title>
<list>
<item>
- <p>
- Miscellaneous inet6 related problems.</p>
- <p>
- Own Id: OTP-8927</p>
+ <p>Miscellaneous inet6 related problems.</p>
+ <p>Own Id: OTP-8927</p>
</item>
<item>
- <p>
- Updated http-server to make sure URLs in error-messages
- are URL-encoded. Added support in http-client to use
- URL-encoding. Also added the missing include directory
- for the inets application.</p>
- <p>
- Own Id: OTP-8940 Aux Id: seq11735 </p>
+ <p>Updated http-server to make sure URLs in error-messages
+ are URL-encoded. Added support in http-client to use
+ URL-encoding. Also added the missing include directory
+ for the inets application.</p>
+ <p>Own Id: OTP-8940 Aux Id: seq11735 </p>
</item>
</list>
</section>
-</section>
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>Fix format_man_pages so it handles all man sections
+ and remove warnings/errors in various man pages. </p>
+ <p>Own Id: OTP-8600</p>
+ </item>
+ <item>
+ <p>[httpc] Pipelined and queued requests not processed when
+ connection closed remotelly.</p>
+ <p>Own Id: OTP-8906</p>
+ </item>
+ </list>
+ </section>
-<section><title>Inets 5.5</title>
+ </section> <!-- 5.5.1 -->
+
+
+ <section><title>Inets 5.5</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
@@ -120,9 +148,10 @@
</list>
</section>
-</section>
+ </section> <!-- 5.5 -->
+
-<section><title>Inets 5.4</title>
+ <section><title>Inets 5.4</title>
<section><title>Improvements and New Features</title>
<!--
diff --git a/lib/inets/src/http_lib/http_chunk.erl b/lib/inets/src/http_lib/http_chunk.erl
index 621bc68eae..57647438e9 100644
--- a/lib/inets/src/http_lib/http_chunk.erl
+++ b/lib/inets/src/http_lib/http_chunk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2011. 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
@@ -17,7 +17,8 @@
%% %CopyrightEnd%
%%
%% Description: Implements chunked transfer encoding see RFC2616 section
-%% 3.6.1
+%% 3.6.1
+
-module(http_chunk).
-include("http_internal.hrl").
@@ -28,6 +29,7 @@
%% little at a time on a socket.
-export([decode_size/1, ignore_extensions/1, decode_data/1, decode_trailer/1]).
+
%%%=========================================================================
%%% API
%%%=========================================================================
@@ -81,6 +83,9 @@ encode(Chunk) when is_binary(Chunk)->
HEXSize = list_to_binary(http_util:integer_to_hexlist(size(Chunk))),
<<HEXSize/binary, ?CR, ?LF, Chunk/binary, ?CR, ?LF>>;
+encode([<<>>]) ->
+ [];
+
encode(Chunk) when is_list(Chunk)->
HEXSize = http_util:integer_to_hexlist(erlang:iolist_size(Chunk)),
[HEXSize, ?CR, ?LF, Chunk, ?CR, ?LF].
@@ -88,6 +93,7 @@ encode(Chunk) when is_list(Chunk)->
encode_last() ->
<<$0, ?CR, ?LF, ?CR, ?LF >>.
+
%%-------------------------------------------------------------------------
%% handle_headers(HeaderRecord, ChunkedHeaders) -> NewHeaderRecord
%%
diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src
index 0194c65db9..07da8ca961 100644
--- a/lib/inets/src/inets_app/inets.appup.src
+++ b/lib/inets/src/inets_app/inets.appup.src
@@ -1,7 +1,7 @@
%% This is an -*- erlang -*- file.
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2011. 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
@@ -18,6 +18,11 @@
{"%VSN%",
[
+ {"5.5.1",
+ [
+ {load_module, http_chunk, soft_purge, soft_purge, []}
+ ]
+ },
{"5.5",
[
{restart_application, inets}
@@ -30,7 +35,12 @@
}
],
[
- {"5.4",
+ {"5.5.1",
+ [
+ {load_module, http_chunk, soft_purge, soft_purge, []}
+ ]
+ },
+ {"5.5",
[
{restart_application, inets}
]
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index 67737ee552..b1de3fef43 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2011. 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