Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Rewindable rack input
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Saimon Moore  
View profile  
 More options Mar 12 2009, 8:23 pm
From: Saimon Moore <saimonmo...@gmail.com>
Date: Thu, 12 Mar 2009 17:23:37 -0700 (PDT)
Local: Thurs, Mar 12 2009 8:23 pm
Subject: Rewindable rack input
Hi Jon,

I'm giving cloudkit a spin (using version 0.11.0) and I've come up
with a problem when using passenger (passenger-2.1.1 beta) to serve
the rack app. (i.e. the bug doesn't appear with mongrel)

I've tentatively tracked this down to Request#json and in particular
sending the #rewind message to the request body (i.e rack input).
For whatever reason, using mongrel the body was an instance of
Rack::Lint::InputWrapper. Using passenger, it was an instance of
TCPSocket which doesn't have a #rewind message.

My solution was to see how rails 2.3 handled this problem. Josh Peek
wrote a rewindable_input middleware which basically wraps rack input
in a StringIO to ensure it's rewindable. Using this middleware => no
more exception.

See code here:
http://gist.github.com/78368

I'm not sure where the actual fault lies (This could be a bug in
passenger) but perhaps you want to investigate further....

Regards,

Saimon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Crosby  
View profile  
 More options Mar 13 2009, 4:51 pm
From: Jon Crosby <jon.r.cro...@gmail.com>
Date: Fri, 13 Mar 2009 13:51:20 -0700
Local: Fri, Mar 13 2009 4:51 pm
Subject: Re: [cloudkit] Rewindable rack input

On Thu, Mar 12, 2009 at 5:23 PM, Saimon Moore <saimonmo...@gmail.com> wrote:

> Hi Jon,

> I'm giving cloudkit a spin (using version 0.11.0) and I've come up
> with a problem when using passenger (passenger-2.1.1 beta) to serve
> the rack app. (i.e. the bug doesn't appear with mongrel)

> I've tentatively tracked this down to Request#json and in particular
> sending the #rewind message to the request body (i.e rack input).
> For whatever reason, using mongrel the body was an instance of
> Rack::Lint::InputWrapper. Using passenger, it was an instance of
> TCPSocket which doesn't have a #rewind message.

Saimon, thank you for tracking this down and bringing it up on the list. If
passenger is setting rack.input to something that does not respond to
#rewind, then it is violating the spec for Rack. That being the case, I like
the pragmatic solution that you provided, wrapping the input so that it is
rewindable in all cases. I'll do some experiments with Passenger just to
confirm this and if everything checks out, a patch for CloudKit may be in
order.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Garver  
View profile  
 More options Apr 6 2009, 7:53 pm
From: Ryan Garver <ragar...@gmail.com>
Date: Mon, 6 Apr 2009 16:53:52 -0700 (PDT)
Local: Mon, Apr 6 2009 7:53 pm
Subject: Re: Rewindable rack input
Thanks Saimon, this helped me out a lot.  I'm using cloudkit 0.11.1
and passenger 2.1.3.  This problem originally revealed itself as a
"Premature end of script headers" error in the apache logs, but
eventually I arrived at your conclusion that the issue was with
#rewind.   Looking forward to an official fix on this from cloudkit or
passenger, whoever wants the honor ;)

On Mar 13, 1:51 pm, Jon Crosby <jon.r.cro...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jon Crosby  
View profile  
 More options Apr 12 2009, 6:26 pm
From: Jon Crosby <jon.r.cro...@gmail.com>
Date: Sun, 12 Apr 2009 15:26:02 -0700
Local: Sun, Apr 12 2009 6:26 pm
Subject: Re: [cloudkit] Re: Rewindable rack input
The issue of Passenger and Rack is being discussed in detail on the
Rack list now:

http://groups.google.com/group/rack-devel/browse_thread/thread/4324ac...

Let's keep an eye on that thread for a few days and see where it goes.
If a solution is not implemented, we can go with the Rails fix for
now.

-Jon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »