From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.239.138.72 with SMTP id o8cs382976hbo; Wed, 12 May 2010 08:17:32 -0700 (PDT) Received-SPF: pass (google.com: domain of rack-devel+bncCOyNj53IGxCKjavfBBoEeoFPZQ@googlegroups.com designates 10.150.119.36 as permitted sender) client-ip=10.150.119.36; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCOyNj53IGxCKjavfBBoEeoFPZQ@googlegroups.com designates 10.150.119.36 as permitted sender) smtp.mail=rack-devel+bncCOyNj53IGxCKjavfBBoEeoFPZQ@googlegroups.com; dkim=pass header.i=rack-devel+bncCOyNj53IGxCKjavfBBoEeoFPZQ@googlegroups.com Received: from mr.google.com ([10.150.119.36]) by 10.150.119.36 with SMTP id r36mr4499354ybc.23.1273677451968 (num_hops = 1); Wed, 12 May 2010 08:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received:received-spf:received:mime-version:received :sender:received:date:message-id:subject:from:to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe:content-type; bh=Ez46UFJaZOBHoiWquSVe8LX3mhuM9b8K60C5oc4Db78=; b=e4nN/maw/WpFwlnyEHSDd9NCuiP+XMq2w444gllsy6wdSh48BzOcNuRmn1iiLWMc0m uj+88OC2M6gWETx4tJk6prXKbA3xBBsuRm9egdLdenrcFvNwOVFpHfaEPBHLDlC1Davl Lv4Uedcxuf4TFCKBiE8QNkftpYvEVmUWRP7mA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:sender:date:message-id :subject:from:to:x-original-authentication-results:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe:content-type; b=rcmjAqN4AwE3L1byL4+t5v4+yPIeBRdsNZprs35ew92WZDFR+/usBP5mfnqA4rLyuf cLM4r/HUkTizfKw9TMogFqp5hp0xe2Vn8tl+U7M8X8mgro7Rc+EGnHYErBzI159pA3kg +UbY8uFGI9qcLdn3T8VaZQDplTnssQRhK8gsc= Received: by 10.150.119.36 with SMTP id r36mr921663ybc.23.1273677450075; Wed, 12 May 2010 08:17:30 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.150.242.38 with SMTP id p38ls15856292ybh.6.p; Wed, 12 May 2010 08:17:27 -0700 (PDT) Received: by 10.151.16.19 with SMTP id t19mr7738400ybi.6.1273677446629; Wed, 12 May 2010 08:17:26 -0700 (PDT) Received: by 10.115.100.10 with SMTP id c10mr1838860wam.35.1273670692626; Wed, 12 May 2010 06:24:52 -0700 (PDT) Received: by 10.115.100.10 with SMTP id c10mr1838858wam.35.1273670692597; Wed, 12 May 2010 06:24:52 -0700 (PDT) Return-Path: Received: from mail-gw0-f51.google.com (mail-gw0-f51.google.com [74.125.83.51]) by gmr-mx.google.com with ESMTP id r3si231419waj.3.2010.05.12.06.24.51; Wed, 12 May 2010 06:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of maxcantor@gmail.com designates 74.125.83.51 as permitted sender) client-ip=74.125.83.51; Received: by gwj21 with SMTP id 21so338138gwj.24 for ; Wed, 12 May 2010 06:24:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.251.8 with SMTP id y8mr12604204ybh.222.1273670690584; Wed, 12 May 2010 06:24:50 -0700 (PDT) Sender: rack-devel@googlegroups.com Received: by 10.151.155.14 with HTTP; Wed, 12 May 2010 06:24:50 -0700 (PDT) Date: Wed, 12 May 2010 09:24:50 -0400 Message-ID: Subject: Patch: Make CGI handler obey rack spec for the greater good From: Max Cantor To: rack-devel@googlegroups.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of maxcantor@gmail.com designates 74.125.83.51 as permitted sender) smtp.mail=maxcantor@gmail.com; dkim=pass (test mode) header.i=@gmail.com X-Original-Sender: max@maxcantor.net Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 The default CGI handler included in rack doesn't obey the rack spec; its input stream is not rewindable, and thus generates Errno::ESPIPE illegal seek errors. You can see the Sinatra guys needed a workaround for it here: https://sinatra.lighthouseapp.com/projects/9779/tickets/227-errnoespipe-illegal-seek-with-cgi-sinatra This patch wraps the CGI handler's input stream in a rewindable input object, which makes the handler adhere to the rack spec. http://github.com/visudo/rack/commit/0ca92960d4d9e2e79d31028b3383f0bde7230344 - Max Cantor Developer, Designer & Web Specialist (216) 539-5836 http://inspiranity.com