diff options
author | Micael Karlberg <[email protected]> | 2011-03-09 15:42:59 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-03-09 15:42:59 +0100 |
commit | f8aac645c1c74626049b3a30eeedb6339cd43e2c (patch) | |
tree | fcda8e85564df7a84808c77e58e893d943a298a9 /lib/inets/src/http_lib | |
parent | 6c8f96a4a762e8bd9dd2ef758a5312791c064dd0 (diff) | |
parent | 62e056af8c4fa058faa5087614c6b837a07f06e6 (diff) | |
download | otp-f8aac645c1c74626049b3a30eeedb6339cd43e2c.tar.gz otp-f8aac645c1c74626049b3a30eeedb6339cd43e2c.tar.bz2 otp-f8aac645c1c74626049b3a30eeedb6339cd43e2c.zip |
Merge branch 'dev' into bmk/snmp/support_ipv6_transport_address
Diffstat (limited to 'lib/inets/src/http_lib')
-rw-r--r-- | lib/inets/src/http_lib/http_chunk.erl | 10 |
1 files changed, 8 insertions, 2 deletions
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 %% |