From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.86.23.1 with SMTP id 1cs132896fgw; Fri, 4 Sep 2009 06:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.224.12.13 as permitted sender) client-ip=10.224.12.13; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.224.12.13 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.224.12.13]) by 10.224.12.13 with SMTP id v13mr12454701qav.25.1252072057066 (num_hops = 1); Fri, 04 Sep 2009 06:47:37 -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:mime-version :received:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=yAA2rGQVwFNRmSnxs49VciPfd0a0zNBIfZRQGcGSfk4=; b=Tv1hFHqv25c+UqYhCJQJRZBiz46nluPVbeoRfqA/zGfm968BtyUqBffC/GV9EGhxW8 H2AIslcZB3eV7e4dy3CJC4HQVhHKG66PQc3fkPNVL8VbAvMCcOo/CAqx1vDan/SbvdUc sR0+nKgOHCUGQdPsHMc7n+1L3lYRt/GCrB5m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=YfRbWbfjFBJmcrAEqf9z3XuFyDSDwdrNbtWdNgPmNQvuDf9W1ZadN+WnqYtUUfQSex irT1Wa+pHyIYtL3tBFyPPwwwIaX2DhYWqOizHsPJ2vmKgUCApttSnxNxG6SIKD78QWMC 2AhPbzaYAD6nQ/B6sOlrz4FneXCEHzkwxFf7E= Received: by 10.224.12.13 with SMTP id v13mr2158432qav.25.1252072056941; Fri, 04 Sep 2009 06:47:36 -0700 (PDT) Received: by 10.176.151.15 with SMTP id y15gr1634yqd.0; Fri, 04 Sep 2009 06:47:29 -0700 (PDT) X-Sender: ibc@aliax.net X-Apparently-To: rack-devel@googlegroups.com Received: by 10.204.23.210 with SMTP id s18mr446510bkb.6.1252072047831; Fri, 04 Sep 2009 06:47:27 -0700 (PDT) Received: by 10.204.23.210 with SMTP id s18mr446509bkb.6.1252072047809; Fri, 04 Sep 2009 06:47:27 -0700 (PDT) Return-Path: Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by gmr-mx.google.com with ESMTP id 14si108075fxm.3.2009.09.04.06.47.27; Fri, 04 Sep 2009 06:47:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.227 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) client-ip=209.85.220.227; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.220.227 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) smtp.mail=ibc@aliax.net Received: by mail-fx0-f227.google.com with SMTP id 27so789853fxm.35 for ; Fri, 04 Sep 2009 06:47:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.15 with SMTP id s15mr4587710fau.77.1252072047605; Fri, 04 Sep 2009 06:47:27 -0700 (PDT) In-Reply-To: <20090904013525.GA12750@dcvr.yhbt.net> References: <200909040102.14378.ibc@aliax.net> <20090904013525.GA12750@dcvr.yhbt.net> Date: Fri, 4 Sep 2009 15:47:27 +0200 Message-ID: Subject: Re: CommonLogger (and Clogger) generates strange symbols in the response body From: =?UTF-8?Q?I=C3=B1aki_Baz_Castillo?= To: rack-devel@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 2009/9/4 Eric Wong : >> As you can see, the number above each real body line is the length of th= e line >> below it (in hexadecimal when > 10). > > 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. > 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. =C2=A0This 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. --=20 I=C3=B1aki Baz Castillo