couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1059885 - /couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl
Date Mon, 17 Jan 2011 11:32:35 GMT
Author: fdmanana
Date: Mon Jan 17 11:32:35 2011
New Revision: 1059885

URL: http://svn.apache.org/viewvc?rev=1059885&view=rev
Log:
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


Modified:
    couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl

Modified: couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl?rev=1059885&r1=1059884&r2=1059885&view=diff
==============================================================================
--- couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl (original)
+++ couchdb/branches/1.1.x/src/couchdb/couch_httpd_proxy.erl Mon Jan 17 11:32:35 2011
@@ -150,7 +150,7 @@ stream_chunked_body({stream, MReq, 0, Bu
     {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, Bu
     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,
     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
     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}]),



Mime
View raw message