r->content equivalent in Apache2

2007-05-03 Thread Carlos Ramirez
I'm porting an existing mod_perl 1.x module to mod_perl 2 and I can't seem to find the equivalent to r->content in the Apache2 API? In the mod_perl 1.0 module, I currently have: my %params = $r->method eq 'POST' ? $r->content : $r->args(); but running under mod_perl 2 I get the following e

Re: Problem with Apache-DBI and local MySQL database

2007-05-03 Thread Perrin Harkins
On 5/3/07, Chris Allen <[EMAIL PROTECTED]> wrote: [Fri May 04 01:44:04 2007] [error] [client 10.3.10.2] DBD driver has not implemented the AutoCommit attribute at /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm line 277.\n DBD::mysql::db selectrow_array failed: Lost connection to MySQL server duri

Re: Apache::Request question

2007-05-03 Thread Jonathan Vanasco
On May 3, 2007, at 9:44 PM, Joe Schaefer wrote: The "Unknown Error" string is operating system dependent. On my linux box it would be reported as "Success", since the error code in any case is 0. "Missing input data" comes from the apreq ala APR::Request::Error::NODATA, and counts as a trivial

Re: Apache::Request question

2007-05-03 Thread Joe Schaefer
Jonathan Vanasco <[EMAIL PROTECTED]> writes: > On May 3, 2007, at 9:19 PM, Joe Schaefer wrote: > >> Here's what I was alluding to on apreq-dev when you asked about it: > > that code makes sense... > > it makes me wonder more though: > > a) > what's the deal with > Missing input

Re: Apache::Request question

2007-05-03 Thread Jonathan Vanasco
On May 3, 2007, at 9:19 PM, Joe Schaefer wrote: Here's what I was alluding to on apreq-dev when you asked about it: that code makes sense... it makes me wonder more though: a) what's the deal with Missing input data Unknown Error : 0 are thos

Re: Apache::Request question

2007-05-03 Thread Joe Schaefer
Jonathan Vanasco <[EMAIL PROTECTED]> writes: > i'm standardizing my some functions to release into cpan and am at a bit of a > loss on catching apreq errors. Here's what I was alluding to on apreq-dev when you asked about it: my $body = eval { $req->body }; if ($@) { if ($@ == APR::R

Problem with Apache-DBI and local MySQL database

2007-05-03 Thread Chris Allen
Dear All, I am running: apache 2.2.3 / mod_perl / DBI v1.54, DBD::mysql v4.004 / Apache::DBI I am connecting to 2 MySQL databases: 1 on the local machine through a domain socket 1 over the LAN. 100% of the queries to the LAN connected db work fine 80% of the queries to the local db work f

Re: Help with $r being corrupted

2007-05-03 Thread Victor Danilchenko
Frank Wiles wrote: Actually it isn't an issue of methods being forgotten, more likely you aren't using Apache2::RequestUtil in your code. Preferably preloading it. Well, the production code which has this problem is running under mod_perl 1 and Apache 1.3 right now, but I do load

Re: Help with sending custom headers in mod_perl2

2007-05-03 Thread Perrin Harkins
On 5/2/07, Victor Danilchenko <[EMAIL PROTECTED]> wrote: I seem to be missing something very obvious... I have: $r->header_out("Refresh"=>"0; URL=$uri\n"); I think you're looking for this: $r->headers_out->add("Refresh"=>"0; URL=$uri\n"); You were trying to use mod_perl 1 syntax. Se

Re: Apache::Request question

2007-05-03 Thread Jonathan Mangin
Sorry, I don't know the answer. My little testing on Solaris gives me similar results, and I'd like to back up your request. - Original Message - From: "Jonathan Vanasco" <[EMAIL PROTECTED]> To: "modperl mod_perl" Sent: Thursday, May 03, 2007 3:09 PM Subject: Apache::Request question

Re: Help with $r being corrupted

2007-05-03 Thread Frank Wiles
On Wed, 02 May 2007 22:57:59 -0400 Victor Danilchenko <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a custom handler which is supposed to do some stuff > with the request, and run it through the Mason parser. The trouble is > that ever once in a while -- rarely -- the request object

Apache::Request question

2007-05-03 Thread Jonathan Vanasco
I'm posting to mp , as this is perl-glue related. as a note, I'm using OS X as a dev box , and apreq doesn't compile right on it - so that might be the problem - i'm standardizing my some functions to release into cpan and am at a bit of a loss on catching apreq errors. I have this c

Re: location

2007-05-03 Thread Jonathan Vanasco
On May 3, 2007, at 12:43 PM, Torsten Foertsch wrote: Note that all these functions are methods of the $r object. oh! ok, now i see. that makes total sense. i thought i had to access these methods via their own packages, not that they were exported into the ApacheRequestRec class.

RE: location

2007-05-03 Thread Adam Prime x443
You're probably using Apache2::RequestUtil in startup.pl, or some other file you're also use'ing prior if you aren't getting an error already when you try to call $r->location. Adam -Original Message- From: Jonathan Vanasco [mailto:[EMAIL PROTECTED] Sent: Thursday, May 03, 2007 12:10 PM

Re: location

2007-05-03 Thread Torsten Foertsch
On Thursday 03 May 2007 18:09, Jonathan Vanasco wrote: > On May 3, 2007, at 10:54 AM, Torsten Foertsch wrote: > > You see the location function is created directly in the > > Apache2::RequestRec > > namespace (the PACKAGE = ...). > > > > The perl equivalent would be a file named Apache2/RequestUtil

request for comments - ApacheRequest Builder

2007-05-03 Thread Jonathan Vanasco
Last night I standardized out some redundant code in my framework implementations to be a standardized package Its fairly simple in function: It creates conservative defaults for ApacheRequest objects ( no uploads, 10k max ) You register URIs with it on startup to enable uploads / upgrade

Re: location

2007-05-03 Thread Jonathan Vanasco
On May 3, 2007, at 10:54 AM, Torsten Foertsch wrote: You see the location function is created directly in the Apache2::RequestRec namespace (the PACKAGE = ...). The perl equivalent would be a file named Apache2/RequestUtil.pm that starts with a "package Apache2::RequestRec" line. When you

Re: location

2007-05-03 Thread Torsten Foertsch
On Thursday 03 May 2007 16:34, Jonathan Vanasco wrote: > On May 3, 2007, at 2:54 AM, Torsten Foertsch wrote: > > http://perl.apache.org/docs/2.0/api/Apache2/ > > RequestUtil.html#C_location_ > > Thats even odder... > > $r is a RequestRec, not RequestUtil > > And according to those docs, RequestUtil

Re: location

2007-05-03 Thread Jonathan Vanasco
On May 3, 2007, at 2:54 AM, Torsten Foertsch wrote: http://perl.apache.org/docs/2.0/api/Apache2/ RequestUtil.html#C_location_ Thats even odder... $r is a RequestRec, not RequestUtil And according to those docs, RequestUtil ISA RequestRec , not the other way around. location really shoul