Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 80329 invoked from network); 23 Mar 2010 11:54:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Mar 2010 11:54:07 -0000 Received: (qmail 18948 invoked by uid 500); 23 Mar 2010 11:54:07 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 18885 invoked by uid 500); 23 Mar 2010 11:54:06 -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 18866 invoked by uid 99); 23 Mar 2010 11:54:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 11:54:06 +0000 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fdmanana@gmail.com designates 209.85.220.209 as permitted sender) Received: from [209.85.220.209] (HELO mail-fx0-f209.google.com) (209.85.220.209) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 11:54:00 +0000 Received: by fxm1 with SMTP id 1so6615675fxm.33 for ; Tue, 23 Mar 2010 04:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=eW9dtLiZoVYHS5VJ6TgPtYz6knqhfrBVUpD/Kd/o3uE=; b=vLOrUo1eJFpMC1vIFuTmeDZG/Jc54bZ7fpNo+i4Hb2DmnXvr4SmtU2xTgFagPHO9CI //iWD59IifZJQfegahCTe14tlyRtRQxq+x6bAIJVvHxRxNmnepZOvV9ZUcnJT+apT9mk Soz4yq6dI6obbHRrkmGL8OsgmDLbzdXzKHEWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=GE1QgFXQtctpQZ1d2ng5ogY3KhRa5rQ6dC5Qhzu85ZWpKx7L4d9LM7aQad8XFjtQuY sTrYgLwv/TW6b8KY0es4qMzRrdfod4W75qkCvQYLrGBcrfOyEk0Ld18t1og00lOR2I2j X6/9ejfbc40/SDmzlpecdYxOHdtPlaPG+iToQ= MIME-Version: 1.0 Received: by 10.204.129.218 with SMTP id p26mr5532160bks.145.1269345218712; Tue, 23 Mar 2010 04:53:38 -0700 (PDT) Reply-To: fdmanana@gmail.com In-Reply-To: <20100323090513.GA5628@uk.tiscali.com> References: <20100317204512.GA15930@uk.tiscali.com> <20100317215320.GA16659@uk.tiscali.com> <560F52C4-A702-466F-9A7B-227FB3B81C0D@merrells.com> <7D81536C-491E-47FC-A2A0-BFEB2E3020B7@merrells.com> <20100318121929.GA6866@uk.tiscali.com> <20100323090513.GA5628@uk.tiscali.com> Date: Tue, 23 Mar 2010 11:53:38 +0000 Message-ID: Subject: Re: standalone attachments and content-encoding header From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=00151747b0b8dbe1cc048276767e --00151747b0b8dbe1cc048276767e Content-Type: text/plain; charset=UTF-8 On Tue, Mar 23, 2010 at 9:05 AM, Brian Candler wrote: > On Tue, Mar 23, 2010 at 12:09:44AM +0000, Filipe David Manana wrote: > > By accepting an already gzip encoded attachment (through the PUT > standalone > > attachment API) we risk not storing the real length of the attachment > > (length of the uncompressed form) in the attachment's metadata, and only > the > > length of the attachment's encoded form. > > That would happen only if the attachment is streamed with a chunked > transfer > > encoding request (that i.e. no content-length header in the upload > request). > > I thought content-length referred to the actual number of bytes transferred > (i.e. the encoded form), not the original uncompressed object? So to get > the > "real" size you'd have to decompress anyway? > True. I guess I shouldn't reply anymore during late evening :) The problem I see here is that not supplying, in an attachment stub, the length of the attachment in uncompressed form breaks the existing API. Currently the "length" field of an attachment stub is always the length of the attachment in its identity (uncompressed) form. If you upload attachment A in uncompressed form, the "length" field in the attachment stub will match the length of the attachment in uncompressed form. On the other hand, if you upload that same attachment in compressed form, that "length" field will match the length of the attachment in compressed form. Uncompressing the attachment just to calculate its identity length seems a bit heavy, no? -- Filipe David Manana, fdmanana@gmail.com "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men." --00151747b0b8dbe1cc048276767e--