Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A461D9C08 for ; Mon, 6 Feb 2012 21:17:23 +0000 (UTC) Received: (qmail 12482 invoked by uid 500); 6 Feb 2012 21:17:23 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 12435 invoked by uid 500); 6 Feb 2012 21:17:22 -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 12427 invoked by uid 99); 6 Feb 2012 21:17:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 21:17:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 21:17:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 237FACC026 for ; Mon, 6 Feb 2012 21:16:59 +0000 (UTC) Date: Mon, 6 Feb 2012 21:16:59 +0000 (UTC) From: "Jens Alfke (Created) (JIRA)" To: dev@couchdb.apache.org Message-ID: <1793749112.3723.1328563019146.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (COUCHDB-1403) Multipart upload fails with exception if request body is chunked MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Multipart upload fails with exception if request body is chunked ---------------------------------------------------------------- Key: COUCHDB-1403 URL: https://issues.apache.org/jira/browse/COUCHDB-1403 Project: CouchDB Issue Type: Bug Components: HTTP Interface Affects Versions: 1.1.1 Environment: Mac OS X 10.7.3, Couchbase Single Server 2.0.0dev4 (based on CouchDB 1.1.1) Reporter: Jens Alfke Priority: Minor CouchDB doesn't correctly parse MIME multipart PUT/POST requests when the HTTP transfer is chunked. It generates an Erlang exception, and the client sees that the socket was closed unexpectedly. [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_until,3},{couch_httpd,parse_part_body,1},{couch_httpd,parse_multipart_request,3},{couch_doc,'-doc_from_multi_part_stream/2-fun-1-'... The source looks like: receive_request_data(Req) -> receive_request_data(Req, couch_httpd:body_length(Req)). receive_request_data(Req, LenLeft) when LenLeft > 0 -> Robert Newson commented on the user@ list: "Pretty obvious bug, yes. We're attempting to evaluate whether the atom 'chunked' is greater than zero." The obvious workaround -- don't use chunked -- may not be available to clients. This level of encoding is generally performed by the browser or client HTTP library, and the app level code may not have control over whether it's performed. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira