couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r830056 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl
Date Tue, 27 Oct 2009 04:40:18 GMT
Author: davisp
Date: Tue Oct 27 04:40:18 2009
New Revision: 830056

URL: http://svn.apache.org/viewvc?rev=830056&view=rev
Log:
Fixed a minor bug with attachments of zero length.

The Erlang PID handling the request would crash after headers were sent so that the browser
never noticed but my cURL client did.


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

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=830056&r1=830055&r2=830056&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Tue Oct 27 04:40:18 2009
@@ -876,8 +876,11 @@
                 {"Cache-Control", "must-revalidate"},
                 {"Content-Type", binary_to_list(Type)}
                 ], integer_to_list(Len)),
-            couch_doc:att_foldl(Att,
-                    fun(BinSegment, _) -> send(Resp, BinSegment) end,[])
+            couch_doc:att_foldl(
+                Att,
+                fun(BinSegment, _) -> send(Resp, BinSegment) end,
+                {ok, Resp} % Seed in case of 0 byte attachment.
+            )
         end)
     end;
 



Mime
View raw message