Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Empty CGI stdinput
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
  5 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
 
Cyrille  
View profile  
 More options Sep 17 2009, 12:29 am
From: Cyrille <cbonne...@gmail.com>
Date: Wed, 16 Sep 2009 21:29:06 -0700 (PDT)
Local: Thurs, Sep 17 2009 12:29 am
Subject: Empty CGI stdinput
Hi guys,

I am using a CGI hack to make SwfUpload work with Rails 2.2.1.

The hack I use is described here:

http://swfupload.org/forum/generaldiscussion/1202

It works fine locally with Webrick, but on my staging server (running
passenger 2.2.5), it fails because the CGI stdinput is empty...

To be more descriptive, in the code (http://gist.github.com/55772) on
line 14, if I output @session.cgi.stdinput, I get an empty string on
my staging server.

On my local machine, I get the uploaded data with my session cookie at
the end (as expected).

I am confused: why would the standard input be empty?? Where do I go
from there? How could I debug what is going on?

Any suggestion welcome.

Cyrille


 
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.
Hongli Lai  
View profile  
 More options Sep 17 2009, 3:28 am
From: Hongli Lai <hon...@phusion.nl>
Date: Thu, 17 Sep 2009 09:28:30 +0200
Local: Thurs, Sep 17 2009 3:28 am
Subject: Re: [phusion-passenger] Empty CGI stdinput

I'm not sure. Can you check whether @session.cgi is of class
PhusionPassenger::Railz::CGIFixed?

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)


 
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.
Cyrille  
View profile  
 More options Sep 17 2009, 5:14 am
From: Cyrille <cbonne...@gmail.com>
Date: Thu, 17 Sep 2009 02:14:56 -0700 (PDT)
Local: Thurs, Sep 17 2009 5:14 am
Subject: Re: Empty CGI stdinput
Hi there,

Yes it is. And @session.cgi.stdinput is of class UNIXSocket.

If I check @session.cgi.stdinput.eof? it says true.

So apparently the socket is closed... Is that expected?
Is it possible that the socket content has already been read? If so,
is there a way I can access the request body?

Cheers

Cyrille

On Sep 17, 7:28 pm, Hongli Lai <hon...@phusion.nl> 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.
Hongli Lai  
View profile  
 More options Sep 17 2009, 6:21 am
From: Hongli Lai <hon...@phusion.nl>
Date: Thu, 17 Sep 2009 12:21:04 +0200
Local: Thurs, Sep 17 2009 6:21 am
Subject: Re: [phusion-passenger] Re: Empty CGI stdinput

On Thu, Sep 17, 2009 at 11:14 AM, Cyrille <cbonne...@gmail.com> wrote:

> Hi there,

> Yes it is. And @session.cgi.stdinput is of class UNIXSocket.

> If I check @session.cgi.stdinput.eof? it says true.

> So apparently the socket is closed... Is that expected?
> Is it possible that the socket content has already been read? If so,
> is there a way I can access the request body?

Yes, the socket is closed and its contents has probably already been
read by Rails. If you can access the Rails request object you can
extract the parameters from there.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)


 
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.
Cyrille  
View profile  
 More options Sep 20 2009, 8:12 pm
From: Cyrille <cbonne...@gmail.com>
Date: Sun, 20 Sep 2009 17:12:06 -0700 (PDT)
Local: Sun, Sep 20 2009 8:12 pm
Subject: Re: Empty CGI stdinput
Hi,

thanks for your reply.

I just wanted to point out how I fixed it, in case it helps someone
else:

in the cookie_store, I only have access to the @session object, so to
keep the hack confined there, I had to use the query string instead,
like so:

        cookie_name = @cookie_options["name"]
        reg = %r{#{cookie_name}=(.+)}
        md = reg.match @session.cgi.env_table["QUERY_STRING"]
        if md
          cookie = md[1]
        else
          reg = %r{#{cookie_name}=(.+)&}
          md = reg.match @session.cgi.env_table["QUERY_STRING"]
          if md
            cookie = md[1]
          end
        end

Ugly, but it works.

Cheers

Cyrille

On Sep 17, 10:21 pm, Hongli Lai <hon...@phusion.nl> 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.
End of messages
« Back to Discussions « Newer topic     Older topic »