ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> modperl
modperl
Re: [mp2] CGI.pm param's always empty from only some clients (bug or mistake on my part?)
by Kyle Dawkins other posts by this author
Oct 30 2003 11:18PM messages near this date
[mp2] CGI.pm param's always empty from only some clients (bug or mistake on my part?) | Re: [mp2] CGI.pm param's always empty from only some clients (bug or mistake on my part?)
Scott et al.

>  After porting one of my mod_perl apps from 1 to 2, I thought that I
>  had it working but then later found that for some users, POST form
>  data was not available. In other words, when they would submit the
>  form data all of the CGI.pm param()'s were empty even though in my
>  Apache access_log I could see that they had made a POST request. About
>  50% of users were affected and I still have not found a pattern amongst
>  them that distinguishes them from those who are unaffected. GET
>  requests with form data from these same people seem to work fine
>  (although this app needs to POST it's data unfortunately).

Cool... exactly the same thing happened to me, except that it wasn't 
when I switched
from mp1 to mp2 (which I haven't done), it was when I upgraded from 
Jaguar to
Panther, which comes with 5.8.1RC3 and a pre-built Apache/mod_perl.  So 
I'm still
using mp1, yet the exact same thing happens to me; all the POST values 
are lost.

I sniffed around and it seems to be that something is funky with the 
way that CGI.pm is initialising itself under mod_perl; remember that 
when a mod_perl process accesses $r-> args, all future calls to that 
will return nothing.  It seems to me that this is happening too early 
in the case of a POST, but it's not in my code anywhere... so I suspect 
it's buried somewhere in the bowels of Apache and CGI and their 
interactions with each other.

Seems I was luckier than Scott though since I had wrapped all calls to 
get parameters from CGI.pm with a few methods of my own.  To get around 
the weirdness, I just replaced the instance of CGI.pm with an instance 
of Apache::Request, and everything started working again.

Not sure if this helps, but maybe it'll get you on the right track.

Cheers

Kyle Dawkins
Central Park Software
Thread:
Scott Beuker
Kyle Dawkins
Geoffrey Young
Stas Bekman
Geoffrey Young
Geoffrey Young
Stas Bekman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved