diff options
author | Micael Karlberg <bmk@erlang.org> | 2011-06-15 17:22:06 +0200 |
---|---|---|
committer | Micael Karlberg <bmk@erlang.org> | 2011-06-15 17:22:06 +0200 |
commit | 7c27ae290554d9577ac7c93c5d0c6106b647dc52 (patch) | |
tree | 9b96c847df27501e71d38d5d199a85fe18525844 /lib/inets | |
parent | 9d4dd02d9faf0e2a8d51b0b9a033b888afb98a0e (diff) | |
parent | e4605d7a3b9f9be9e437689a79df0f568df8fdac (diff) | |
download | otp-7c27ae290554d9577ac7c93c5d0c6106b647dc52.tar.gz otp-7c27ae290554d9577ac7c93c5d0c6106b647dc52.tar.bz2 otp-7c27ae290554d9577ac7c93c5d0c6106b647dc52.zip |
[httpc] Remove unnecessary usage of iolist_to_binary when
processing body (for PUT and POST).
Filipe David Manana
OTP-9317
Merge branch 'bmk/inets/httpc/remove_unnecessary_iolist_to_binary_usage2/OTP-9317' into bmk/inets/inets57_integration2
Conflicts:
lib/inets/doc/src/notes.xml
lib/inets/src/inets_app/inets.appup.src
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/doc/src/notes.xml | 7 | ||||
-rw-r--r-- | lib/inets/src/http_client/httpc.erl | 14 | ||||
-rw-r--r-- | lib/inets/src/inets_app/inets.appup.src | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index f9f02a21e2..47198b1b91 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -61,6 +61,13 @@ <list> <item> + <p>[httpc] Remove unnecessary usage of iolist_to_binary when + processing body (for PUT and POST). </p> + <p>Filipe David Manana</p> + <p>Own Id: OTP-9317</p> + </item> + + <item> <p>[ftp] FTP client doesn't work with IPv6 host.</p> <p>Attila Rajmund Nohl</p> <p>Own Id: OTP-9342 Aux Id: seq11853</p> diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index 6ffa5e8ba5..8aaa9ec402 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -518,17 +518,15 @@ mk_chunkify_fun(ProcessBody) -> eof -> {ok, <<"0\r\n\r\n">>, eof_body}; {ok, Data, NewAcc} -> - {ok, mk_chunk_bin(Data), NewAcc} + Chunk = [ + integer_to_list(iolist_size(Data), 16), + "\r\n", + Data, + "\r\n"], + {ok, Chunk, NewAcc} end end. -mk_chunk_bin(Data) -> - Bin = iolist_to_binary(Data), - iolist_to_binary([hex_size(Bin), "\r\n", Bin, "\r\n"]). - -hex_size(Bin) -> - hd(io_lib:format("~.16B", [size(Bin)])). - handle_answer(RequestId, false, _) -> {ok, RequestId}; diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src index 4aa53ae581..b64e266175 100644 --- a/lib/inets/src/inets_app/inets.appup.src +++ b/lib/inets/src/inets_app/inets.appup.src @@ -20,6 +20,7 @@ [ {"5.6", [ + {load_module, httpc, soft_purge, soft_purge, []}, {load_module, http_transport, soft_purge, soft_purge, []}, {update, ftp, soft, soft_purge, soft_purge, []} ] @@ -48,6 +49,7 @@ [ {"5.6", [ + {load_module, httpc, soft_purge, soft_purge, []}, {load_module, http_transport, soft_purge, soft_purge, []}, {update, ftp, soft, soft_purge, soft_purge, []} ] |