From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs145625fgw; Fri, 4 Sep 2009 12:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.115.100.26 as permitted sender) client-ip=10.115.100.26; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.115.100.26 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.115.100.26]) by 10.115.100.26 with SMTP id c26mr5944649wam.24.1252091610690 (num_hops = 1); Fri, 04 Sep 2009 12:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:date:from:to :subject:message-id:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent:reply-to:sender:precedence:x-google-loop:mailing-list :list-id:list-post:list-help:list-unsubscribe:x-beenthere-env :x-beenthere; bh=VcE4l9h30SfY3nw79rLc/DHdo/O+kxLLVmiyLmDk0gE=; b=W0YWXK7XYm9SyNnMzz+3+5HYN/tmd8g9YsNGONsBudUf87y7lIk/u1lQbcHPdRzbUp p01wu/pIo2iY3eLUE+laKy7xQs85Xv1UM/AliTs6OJsm3Qnu6Rv1RRcVrxsZjlXpXwfa dTLpNHFQe2rr7iSdkyvYH7rM/mJ02r5Ul08n0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:date :from:to:subject:message-id:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent:reply-to:sender:precedence:x-google-loop:mailing-list :list-id:list-post:list-help:list-unsubscribe:x-beenthere-env :x-beenthere; b=t+F5W2q/2i9UwcTTB6VMe4oLMnk8sm+GLD8RH97Dm8Vss8Pc0eTR/1ysj6CrjT0xqv tt/vDBg0b99Tyzv+iX5HKDt3qp6hIrvfKoOUoluyZLBkQ+ty9/7qw/zo3BRcPAPtfA+K ffPiNL7JVzL4pThRDLQR9OoJBzrwOptcx+ovA= Received: by 10.115.100.26 with SMTP id c26mr1126292wam.24.1252091610627; Fri, 04 Sep 2009 12:13:30 -0700 (PDT) Received: by 10.106.203.33 with SMTP id a33gr1635prg.0; Fri, 04 Sep 2009 12:13:27 -0700 (PDT) X-Sender: normalperson@yhbt.net X-Apparently-To: rack-devel@googlegroups.com Received: by 10.141.35.18 with SMTP id n18mr3341836rvj.15.1252091606503; Fri, 04 Sep 2009 12:13:26 -0700 (PDT) Received: by 10.141.35.18 with SMTP id n18mr3341835rvj.15.1252091606487; Fri, 04 Sep 2009 12:13:26 -0700 (PDT) Return-Path: Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by gmr-mx.google.com with ESMTP id 24si324679pzk.6.2009.09.04.12.13.26; Fri, 04 Sep 2009 12:13:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) client-ip=64.71.152.64; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of normalperson@yhbt.net designates 64.71.152.64 as permitted sender) smtp.mail=normalperson@yhbt.net Received: from localhost (unknown [12.186.229.34]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id EB1591F509; Fri, 4 Sep 2009 19:13:25 +0000 (UTC) Date: Fri, 4 Sep 2009 12:13:25 -0700 From: Eric Wong To: rack-devel@googlegroups.com Subject: Re: CommonLogger (and Clogger) generates strange symbols in the response body Message-ID: <20090904191325.GA29915@dcvr.yhbt.net> References: <200909040102.14378.ibc@aliax.net> <20090904013525.GA12750@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com Iņaki Baz Castillo wrote: > > This is chunked transfer encoding as defined in rfc 2616, section 3.6.1. > > Any HTTP/1.1 client should be able to interpret and decode it correctly. > > Thanks a lot, I didn't know it. No problem > > Both CommonLogger (from Rack 1.0) and Clogger (by default) wraps the > > original response body with something that responds to #each to > > correctly calculate the size of the body.  This can throw off the > > Rack::ContentLength middleware that your server probably already loads > > for you (the Thin and Mongrel handlers both appear to load both > > Rack::Chunked and Rack::ContentLength). > > > > For performance reasons, the next version of Rack will instead log the > > existing "Content-Length" header if one exists, and '-' if it doesn't; > > skipping the wrapping of the body[1]. > > Does it mean that with the next version I would get a non chunked > transfer encoded body even if I use CommonLogger? > > Thanks a lot. Yes, however you might want to load the Rack::ContentLength middleware in front of CommonLogger to ensure the length can get logged correctly as a result. -- Eric Wong