summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-01-17 11:32:35 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-01-17 11:32:35 +0000
commit171a52ad70850bc7a9cd46a584ed4c795b27919f (patch)
tree9ef32905df1429e19785e2ede47ed05b3f36d3d8
parent43a32a5e88b0e296ccf4bdb1b56a7b087fccf814 (diff)
Merged revision 1059884 from trunk
Removed unnecessary iolist_to_binary/1 calls These IOlist to binary conversions are not necessary since ibrowse accepts IOlists as outputs of streaming functions. Also, having the IOlists getting converted into binaries by the erts (instead of user Erlang code) is more git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1059885 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/couchdb/couch_httpd_proxy.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_httpd_proxy.erl b/src/couchdb/couch_httpd_proxy.erl
index e4b94f22..ad83f1db 100644
--- a/src/couchdb/couch_httpd_proxy.erl
+++ b/src/couchdb/couch_httpd_proxy.erl
@@ -150,7 +150,7 @@ stream_chunked_body({stream, MReq, 0, Buf, BRem}) ->
{CRem, Data} = read_chunk_length(MReq),
case CRem of
0 ->
- BodyData = iolist_to_binary(lists:reverse(Buf, Data)),
+ BodyData = lists:reverse(Buf, Data),
{ok, BodyData, {trailers, MReq, [], ?PKT_SIZE}};
_ ->
stream_chunked_body(
@@ -159,7 +159,7 @@ stream_chunked_body({stream, MReq, 0, Buf, BRem}) ->
end;
stream_chunked_body({stream, MReq, CRem, Buf, BRem}) when BRem =< 0 ->
% Time to empty our buffers to the upstream socket.
- BodyData = iolist_to_binary(lists:reverse(Buf)),
+ BodyData = lists:reverse(Buf),
{ok, BodyData, {stream, MReq, CRem, [], ?PKT_SIZE}};
stream_chunked_body({stream, MReq, CRem, Buf, BRem}) ->
% Buffer some more data from the client.
@@ -181,7 +181,7 @@ stream_chunked_body({stream, MReq, CRem, Buf, BRem}) ->
stream_chunked_body(NewState);
stream_chunked_body({trailers, MReq, Buf, BRem}) when BRem =< 0 ->
% Empty our buffers and send data upstream.
- BodyData = iolist_to_binary(lists:reverse(Buf)),
+ BodyData = lists:reverse(Buf),
{ok, BodyData, {trailers, MReq, [], ?PKT_SIZE}};
stream_chunked_body({trailers, MReq, Buf, BRem}) ->
% Read another trailer into the buffer or stop on an
@@ -191,7 +191,7 @@ stream_chunked_body({trailers, MReq, Buf, BRem}) ->
case mochiweb_socket:recv(Socket, 0, ?TIMEOUT) of
{ok, <<"\r\n">>} ->
mochiweb_socket:setopts(Socket, [{packet, raw}]),
- BodyData = iolist_to_binary(lists:reverse(Buf, <<"\r\n">>)),
+ BodyData = lists:reverse(Buf, <<"\r\n">>),
{ok, BodyData, eof};
{ok, Footer} ->
mochiweb_socket:setopts(Socket, [{packet, raw}]),