couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <j...@apache.org>
Subject [jira] Created: (COUCHDB-253) Replicator should not use chunked transfer-encoding on GET requests
Date Fri, 13 Feb 2009 15:13:59 GMT
Replicator should not use chunked transfer-encoding on GET requests
-------------------------------------------------------------------

                 Key: COUCHDB-253
                 URL: https://issues.apache.org/jira/browse/COUCHDB-253
             Project: CouchDB
          Issue Type: Bug
          Components: Database Core
            Reporter: Adam Kocoloski
             Fix For: 0.9


Hi, I screwed this up when we switched to ibrowse.  We're telling ibrowse to use chunked t-e
on every replicator HTTP request.  We don't send a body with the GET request, so ibrowse just
puts a 0 in the body.  Mochiweb chooses to interpret this as "close the connection".  That's
obviously not what we want.  Quick patch below to skip chunked if the request is a GET:

diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl
index ff92658..fa3623d 100644
--- a/src/couchdb/couch_rep.erl
+++ b/src/couchdb/couch_rep.erl
@@ -179,11 +179,16 @@ do_http_request(Url, Action, Headers, JsonBody, Retries) ->
     _ ->
         iolist_to_binary(?JSON_ENCODE(JsonBody))
     end,
-    Options = [
+    
+    Options = 
+    case Action of
+        get -> [];
+        _ ->   [{transfer_encoding, {chunked, 65535}}]
+    end ++ [
         {content_type, "application/json; charset=utf-8"},
-        {max_pipeline_size, 101},
-        {transfer_encoding, {chunked, 65535}}
+        {max_pipeline_size, 101}
     ],
+    
     case ibrowse:send_req(Url, Headers, Action, Body, Options) of
     {ok, Status, ResponseHeaders, ResponseBody} ->
         ResponseCode = list_to_integer(Status),


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message