From 74d6f70b44a0fa03b83b9882dd23bf32af0703fa Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Fri, 7 Jan 2011 02:06:12 +0000 Subject: [PATCH] Don't convert chunks into binaries Allow chunks to be IO lists. These lists will get flattened by the ERTS in a much more efficient way than converting them to raw binaries in Erlang code. --- src/ibrowse_http_client.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl index ea75948..3ca397f 100644 --- a/src/ibrowse_http_client.erl +++ b/src/ibrowse_http_client.erl @@ -543,7 +543,7 @@ do_send_body1(Source, Resp, State, TE) -> maybe_chunked_encode(Data, false) -> Data; maybe_chunked_encode(Data, true) -> - [?dec2hex(size(to_binary(Data))), "\r\n", Data, "\r\n"]. + [?dec2hex(iolist_size(Data)), "\r\n", Data, "\r\n"]. do_close(#state{socket = undefined}) -> ok; do_close(#state{socket = Sock,