couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r881407 - /couchdb/trunk/src/couchdb/couch_httpd.erl
Date Tue, 17 Nov 2009 17:41:57 GMT
Author: damien
Date: Tue Nov 17 17:41:56 2009
New Revision: 881407

URL: http://svn.apache.org/viewvc?rev=881407&view=rev
Log:
Fix for broken multipart parsing code as mentioned in COUCHDB-570.

Modified:
    couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=881407&r1=881406&r2=881407&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Tue Nov 17 17:41:56 2009
@@ -679,10 +679,9 @@
     {partial, Skip} ->
         <<DataChunk:Skip/binary, Rest/binary>> = Buffer,
         Callback2 = Callback(DataChunk),
-        {Buffer2, DataFun2} = DataFun(),
-        Buffer3 = iolist_to_binary(Buffer2),
+        {NewData, DataFun2} = DataFun(),
         read_until(Mp#mp{data_fun=DataFun2,
-                buffer= <<Buffer3/binary, Rest/binary>>}, 
+                buffer= iolist_to_binary([Rest | NewData])},
                 Pattern, Callback2);
     {exact, Skip} ->
         PatternLen = size(Pattern),
@@ -761,8 +760,8 @@
 partial_find(B, D, N, K) ->
     <<B1:K/binary, _/binary>> = B,
     case D of
-        <<_Skip:N/binary, B1:K/binary>> ->
-            {partial, N, K};
+        <<_Skip:N/binary, B1/binary>> ->
+            {partial, N};
         _ ->
             partial_find(B, D, 1 + N, K - 1)
     end.



Mime
View raw message