From dev-return-2565-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Fri Feb 13 15:14:29 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 10948 invoked from network); 13 Feb 2009 15:14:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2009 15:14:29 -0000 Received: (qmail 16386 invoked by uid 500); 13 Feb 2009 15:14:27 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 16349 invoked by uid 500); 13 Feb 2009 15:14:27 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 16332 invoked by uid 99); 13 Feb 2009 15:14:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 07:14:27 -0800 X-ASF-Spam-Status: No, hits=-1998.8 required=10.0 tests=ALL_TRUSTED,FS_REPLICA X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 15:14:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 97C00234C48B for ; Fri, 13 Feb 2009 07:13:59 -0800 (PST) Message-ID: <1133596167.1234538039612.JavaMail.jira@brutus> Date: Fri, 13 Feb 2009 07:13:59 -0800 (PST) From: "Adam Kocoloski (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Created: (COUCHDB-253) Replicator should not use chunked transfer-encoding on GET requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.