Re: APR::SockAddr

2008-01-07 Thread Axel Huizinga

Philippe M. Chiasson schrieb:


Axel Huizinga wrote:


Hi,

Suddenly on of my mod_perl handlers is broken with the following error:

Can't locate object method "ip_get" via package "APR::SockAddr"

at line:
my $ip = $self->{r}->connection->remote_addr->ip_get;

(temporary replaced by  $ENV{'REMOTE_ADDR'} - now the handler works 
again)


I didn't change the code before the error appeared - can the 
configuration cause this behavior?



Missing:

use APR::SockAddr ();

somewhere ?


Ok - thanks - works again.

Axel


Re: Un-baking a baked cookie

2008-01-07 Thread Peter Haworth
On Sat, 05 Jan 2008 00:56:49 -0500, Colin Wetherbee wrote:
> > On Jan 4, 2008 9:47 PM, Colin Wetherbee <[EMAIL PROTECTED]>
> > wrote:
> >>  From the Apache2::Cookie documentation, bake() "adds a Set-
> >>  Cookie header to the outgoing headers table." Is there a way to
> >>  undo this without manually editing the headers, preferably with
> >>  Apache2::Cookie methods?
>
> I'm trying to work out a way to not have to rely on undoing cookies,
> but I haven't had any luck so far. It's for a complicated
> authentication system.

Then don't bake them until you're ready to send them. I have a similar
situation in which my session information might change during the
course of the request, but each step wants to make sure that if it's
the last one, those changes get into the cookie. Instead of baking
when setting the cookie value, I just stuff it into a hash based on
the cookie name (which lets me handle multiple cookies this way should
the need arise). My application has a method which calls Apache's
send_http_header() method, amongst other things, so I just bake all
the saved cookies in this method before calling send_http_header().

-- 
Peter Haworth   [EMAIL PROTECTED]
"Oh, good grief. This is version *0.01*!
 Sheesh, not everything is going to look like Hemmingway writing C."
-- Dan Sugalski


two common questions

2008-01-07 Thread lists user
1. Do you run common web program under modperl handlers? or just run
them under Registry?
For me I mostly wrote web scripts with CGI methods like using CGI.pm
and CGI::Session, and run them under Modperl::Registry.
I don't know if there's a site which is fully run by pure modperl
handlers, not the registry scripts.

2. I heard that Apache::DBI will break the entire database sometime,
is it true? When will we use or not use Apache::DBI?

Thanks!


PerlFixupHandler - %ENV

2008-01-07 Thread Anthony Gardner
I'm trying to write a FixupHandler to clean up the query_string before it gets 
to the response phase. Problem is, I can't. After cleaning it up, I reassign to 
$ENV{QUERY_STRING} but in the called response script, the original QUERY_STRING 
is present.

I can add new keys to %ENV at the PerlFixupHandler stage and they're made 
available to the called response script, but not the changed QUERY_STRING!!

Any pointers would be great.Thx

-Ants


Disclaimer: Technically, I'm always wrong!!
   
-
 Sent from Yahoo! - a smarter inbox.

Re: two common questions

2008-01-07 Thread Adam Prime

lists user wrote:

1. Do you run common web program under modperl handlers? or just run
them under Registry?
For me I mostly wrote web scripts with CGI methods like using CGI.pm
and CGI::Session, and run them under Modperl::Registry.
I don't know if there's a site which is fully run by pure modperl
handlers, not the registry scripts.


Nearly all of our code at work is handlers.


2. I heard that Apache::DBI will break the entire database sometime,
is it true? When will we use or not use Apache::DBI?


We've been running Apache::DBI for 6 years (or so) without issue.

Adam



Re: two common questions

2008-01-07 Thread Michael Peters
lists user wrote:
> 1. Do you run common web program under modperl handlers? or just run
> them under Registry?
> For me I mostly wrote web scripts with CGI methods like using CGI.pm
> and CGI::Session, and run them under Modperl::Registry.
> I don't know if there's a site which is fully run by pure modperl
> handlers, not the registry scripts.

Depends on what you want to do. New applications are usually written as handlers
since they perform a little bit better. But if you need to have something run
under both mod_perl and CGI then you use Registry scripts.

> 2. I heard that Apache::DBI will break the entire database sometime,
> is it true? When will we use or not use Apache::DBI?

Where did you hear that? Apache::DBI doesn't do anything except give you
persistent database handles. How can that "break the entire database"?
Sounds like someone had a bug and blamed it on Apache::DBI...

-- 
Michael Peters
Developer
Plus Three, LP



Re: Un-baking a baked cookie

2008-01-07 Thread Rafael Caceres
Colin,
At least with CGI.pm, what I do is 'bake' an empty cookie. That has the
desired effect.

Rafael Caceres
On Fri, 2008-01-04 at 21:47 -0500, Colin Wetherbee wrote:
> Good evening.
> 
> Is it possible to un-bake a baked cookie?
> 
>  From the Apache2::Cookie documentation, bake() "adds a Set-Cookie 
> header to the outgoing headers table."  Is there a way to undo this 
> without manually editing the headers, preferably with Apache2::Cookie 
> methods?
> 
> (As an aside, would somebody mind briefly explaining the difference 
> between the Set-Cookie and Set-Cookie2 headers?  Is Set-Cookie2 
> preferred now?  Can it be implemented by just changing instances of 
> bake() to bake2()?)
> 
> Thanks.
> 
> Colin
> 
> !DSPAM:477ef043147221748623000!
> 
> 
> 
>  Information from NOD32 
> This message was checked by NOD32 Antivirus System for Linux Mail Servers.
>   part000.txt - is OK
> http://www.eset.com
> 



Re: PerlFixupHandler - %ENV

2008-01-07 Thread Geoffrey Young



Anthony Gardner wrote:

I'm trying to write a FixupHandler to clean up the query_string
before it gets to the response phase. Problem is, I can't. After
cleaning it up, I reassign to $ENV{QUERY_STRING} but in the called
response script, the original QUERY_STRING is present.

I can add new keys to %ENV at the PerlFixupHandler stage and they're
made available to the called response script, but not the changed
QUERY_STRING!!

Any pointers would be great.Thx


try calling

  $r->subprocess_env();

in a void context.  see

http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_subprocess_env_

HTH

--Geoff



Re: PerlFixupHandler - %ENV

2008-01-07 Thread Anthony Gardner
col. thx for that. I'll have a play.

merci.

Geoffrey Young <[EMAIL PROTECTED]> wrote: 

Anthony Gardner wrote:
> I'm trying to write a FixupHandler to clean up the query_string
> before it gets to the response phase. Problem is, I can't. After
> cleaning it up, I reassign to $ENV{QUERY_STRING} but in the called
> response script, the original QUERY_STRING is present.
> 
> I can add new keys to %ENV at the PerlFixupHandler stage and they're
> made available to the called response script, but not the changed
> QUERY_STRING!!
> 
> Any pointers would be great.Thx

try calling

   $r->subprocess_env();

in a void context.  see
 
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_subprocess_env_

HTH

--Geoff




Disclaimer: Technically, I'm always wrong!!
   
-
 Sent from Yahoo! - a smarter inbox.

Re: Compile Problems with perl-5.10.0

2008-01-07 Thread James Kosin

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James Kosin wrote:
| + make 'OPTIMIZE=-O2 -g -pipe -march=i386 -mcpu=i686'
| cd "src/modules/perl" && make
| make[1]: Entering directory 
`/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl'
| gcc -I/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl 
-I/usr/src/redhat/BUILD/mod_perl-2.0.3/xs -I/usr/include/apr-0 
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -I/usr/include/gdbm 
-I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE -DMOD_PERL 
-DMP_COMPAT_1X -DLINUX=2 -DAP_HAVE_DESIGNATED_INITIALIZER -O2 -g -pipe 
-march=i386 -mcpu=i686 -fPIC \

| ~-c mod_perl.c && mv mod_perl.o mod_perl.lo
| gcc -I/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl 
-I/usr/src/redhat/BUILD/mod_perl-2.0.3/xs -I/usr/include/apr-0 
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -I/usr/include/gdbm 
-I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE -DMOD_PERL 
-DMP_COMPAT_1X -DLINUX=2 -DAP_HAVE_DESIGNATED_INITIALIZER -O2 -g -pipe 
-march=i386 -mcpu=i686 -fPIC \

| ~-c modperl_interp.c && mv modperl_interp.o modperl_interp.lo
| modperl_interp.c: In function `modperl_interp_unselect':
| modperl_interp.c:294: error: structure has no member named `xmg_magic'
| modperl_interp.c: In function `modperl_interp_select':
| modperl_interp.c:509: error: structure has no member named `xmg_magic'
| make[1]: *** [modperl_interp.lo] Error 1
| make[1]: Leaving directory 
`/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl'

| make: *** [modperl_lib] Error 2
| error: Bad exit status from /var/tmp/rpm-tmp.83996 (%build)
|
| ===
| any idea on how to fix this or what I'm doing wrong???
|
| Thanks
| James Kosin
The latest snapshot seems to compile and work with perl-5.10.0; though I 
have a minor issue with Bugzilla now.


James Kosin
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHgn77kNLDmnu1kSkRAl4aAJ9cHFdTgjAjo2icT9t374NMd/CfVQCdEXrx
K8yoSUxAylM4PSkh4BJKbhI=
=iQbJ
-END PGP SIGNATURE-

--
Scanned by ClamAV - http://www.clamav.net



Re: Compile Problems with perl-5.10.0

2008-01-07 Thread James Kosin

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James Kosin wrote:
| + make 'OPTIMIZE=-O2 -g -pipe -march=i386 -mcpu=i686'
| cd "src/modules/perl" && make
| make[1]: Entering directory 
`/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl'
| gcc -I/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl 
-I/usr/src/redhat/BUILD/mod_perl-2.0.3/xs -I/usr/include/apr-0 
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -I/usr/include/gdbm 
-I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE -DMOD_PERL 
-DMP_COMPAT_1X -DLINUX=2 -DAP_HAVE_DESIGNATED_INITIALIZER -O2 -g -pipe 
-march=i386 -mcpu=i686 -fPIC \

| ~-c mod_perl.c && mv mod_perl.o mod_perl.lo
| gcc -I/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl 
-I/usr/src/redhat/BUILD/mod_perl-2.0.3/xs -I/usr/include/apr-0 
-I/usr/include/apr-0  -I/usr/include/httpd -D_REENTRANT -D_GNU_SOURCE 
-DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe 
-I/usr/local/include -I/usr/include/gdbm 
-I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE -DMOD_PERL 
-DMP_COMPAT_1X -DLINUX=2 -DAP_HAVE_DESIGNATED_INITIALIZER -O2 -g -pipe 
-march=i386 -mcpu=i686 -fPIC \

| ~-c modperl_interp.c && mv modperl_interp.o modperl_interp.lo
| modperl_interp.c: In function `modperl_interp_unselect':
| modperl_interp.c:294: error: structure has no member named `xmg_magic'
| modperl_interp.c: In function `modperl_interp_select':
| modperl_interp.c:509: error: structure has no member named `xmg_magic'
| make[1]: *** [modperl_interp.lo] Error 1
| make[1]: Leaving directory 
`/usr/src/redhat/BUILD/mod_perl-2.0.3/src/modules/perl'

| make: *** [modperl_lib] Error 2
| error: Bad exit status from /var/tmp/rpm-tmp.83996 (%build)
|
| ===
| any idea on how to fix this or what I'm doing wrong???
|
| Thanks
| James Kosin
The latest snapshot seems to compile and work with perl-5.10.0; though I 
have a minor issue with Bugzilla now.


James Kosin
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHgn77kNLDmnu1kSkRAl4aAJ9cHFdTgjAjo2icT9t374NMd/CfVQCdEXrx
K8yoSUxAylM4PSkh4BJKbhI=
=iQbJ
-END PGP SIGNATURE-

--
Scanned by ClamAV - http://www.clamav.net