Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E23F9972B for ; Mon, 6 Feb 2012 18:22:21 +0000 (UTC) Received: (qmail 26497 invoked by uid 500); 6 Feb 2012 18:22:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 26428 invoked by uid 500); 6 Feb 2012 18:22:19 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 26420 invoked by uid 99); 6 Feb 2012 18:22:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 18:22:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 206.225.164.30 as permitted sender) Received: from [206.225.164.30] (HELO EXHUB020-3.exch020.serverdata.net) (206.225.164.30) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 18:22:12 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.190]) by EXHUB020-3.exch020.serverdata.net ([206.225.164.30]) with mapi; Mon, 6 Feb 2012 10:21:49 -0800 From: Jens Alfke To: "user@couchdb.apache.org" Date: Mon, 6 Feb 2012 10:21:48 -0800 Subject: Multipart vs chunked Thread-Topic: Multipart vs chunked Thread-Index: Aczk/DEYM8vs+ApxSo6RoKc1pAePZQ== Message-ID: <5E8EB1DF-FCD8-4EDC-AA67-88DF00FE26A1@couchbase.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 tl;dr: CouchDB* doesn=92t seem to correctly parse MIME multipart uploads wh= en the HTTP transfer is chunked. It generates an Erlang exception. I spent the weekend trying to implement multipart document+attachment uploa= ds in my client code. In doing so I ran into what I think is a bug in Couch= DB =97 after I=92d gotten the client side working, every upload produced an= Erlang exception on the server. I tried changing around the client-side co= de so it precomputed the body length instead of sending the body in =91chun= ked=92 encoding, and that made CouchDB happier. The exception looks like: [error] [emulator] Error in process <0.15079.3> with exit value: {badarith,= [{couch_httpd_db,'-receive_request_data/2-fun-0-',3},{couch_httpd,read_unti= l,3},{couch_httpd,parse_part_body,1},{couch_httpd,parse_multipart_request,3= },{couch_doc,'-doc_from_multi_part_stream/2-fun-1-'...=20 Is this a known bug, or should I file something? =97Jens * Well, Couchbase Single Server 2.0.0dev4, which I think is basically Couch= DB 1.1.1.