Re: Test failure with Apache::Test 1.03, Apache/2.0.40 and perl-5.8.1-to-be

2003-07-11 Thread Randy Kobes
On Fri, 11 Jul 2003, Stas Bekman wrote:

> [EMAIL PROTECTED] wrote:
[ .. ]
> > Now I get a different failure ("Alias" is now invalid):
[ .. ]

> > waiting for server to start: .Syntax error on line 76 of
> > /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf:
> > Invalid command 'Alias', perhaps mis-spelled or defined by a
> > module not included in the server configuration !!!
>
> Do you have mod_alias available?
>
> % prefork/bin/httpd -l | grep mod_alias
>mod_alias.c
>
> I suppose we could run this command to check for prerequisites
> and die if they aren't available?

I'm not sure what the best way to go about this is, but maybe the
following might help in deciding ... I think the problem arises
when Apache-Test either doesn't find the right httpd.conf
corresponding to the found httpd (as might happen, for example,
when httpd is a symlink to the real one), or it finds and parses
a bogus one (this happened to me a couple of times when the
installed httpd.conf wasn't edited to include the minimal
LoadModule directives, and I forgot to check). So it's not
necessarily a problem with using an incorrect httpd (although
that may still happen), but rather incorrect or missing
information from httpd.conf is being used.

If the above is on the right track, one possibility is to
do the following (in cases where possible LoadModule directives
are needed by Apache-Test):
- die if an httpd.conf isn't found in a directory conf/ in an
expected relative location to httpd (or perhaps add an option
allowing a user to specify where httpd.conf is, if it's in
a different relative to httpd).
- test the configuration, and if an "Invalid Command ..." error
is generated, suggest to the user to either supply the right
httpd.conf, or check the validity of the existing one.

-- 
best regards,
randy


Re: [patch] have_apache_mpm()

2003-07-11 Thread William A. Rowe, Jr.
At 12:21 PM 7/11/2003, Geoffrey Young wrote:

>in either case, I still think have_apache_mpm() is a decent API for 
>Apache-Test, no matter how it's implemented behind the scenes.  does it make 
>sense to get that in first as I last proposed then change the implementation 
>later?  I guess the other option is to dump have_apache_mpm() in favor of a 
>more generic query_apache() (or have both :)

That is what I'd like to see (the later.)  Every time you test 'is_Prefork' you
miss the logic you are testing relative to other MPM's which share the same
or similar characteristics.  Avoiding threads?  That's one query test.  Fork or
created process?  That's another.

Although Apache may only distribute 2-8 different MPMs, third parties are
already out there creating their own custom MPMs.  If we can find some sane
way of collecting and advertising the associated features, that would be much
more robust than looking for an MPM name.

Bill




Re: [patch] have_apache_mpm()

2003-07-11 Thread Stas Bekman
Geoffrey Young wrote:

William A. Rowe, Jr. wrote:
 > At 07:02 PM 7/9/2003, Geoffrey Young wrote:
 >
 >
 >> William A. Rowe, Jr. wrote:
 >>
 >>> It seems like the API for ap_mpm_query would be simpler to
 >>> follow, just extended to run outside-of-apache.
 >>
 >> probably, and it would certainly be safer than checking -V
 >> output. the issue I see with this is that thus far Apache-Test is
 >> pure perl, so it seems overkill to get into the C API and XS for
 >> just for one small feature.  unless I'm missing something, that
 >> is :)
 >
 >
 > You are :-)  It sounds like httpd -V should grow some ap_mpm_query
 > output for the user to know what sorts of flags are toggled for
 > that build of httpd?
ok, I see - something similar to apxs -q?  that would definitely be useful.
We already have this functionality in Apache::Build in modperl-2.0. Perhaps it 
needs to be abstracted so it can be used from Apache::Test without having 
mod_perl enabled.

I'm no vacation for the next two weeks, but when I get back I'll take a 
stab at the interface and see what I can do (if nobody beats me to it).

in either case, I still think have_apache_mpm() is a decent API for 
Apache-Test, no matter how it's implemented behind the scenes.  does it 
make sense to get that in first as I last proposed then change the 
implementation later?  I guess the other option is to dump 
have_apache_mpm() in favor of a more generic query_apache() (or have 
both :)
+1
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Test failure with Apache::Test 1.03, Apache/2.0.40 and perl-5.8.1-to-be

2003-07-11 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
Randy Kobes wrote:
On Sun, 6 Jul 2003, Slaven Rezic wrote:

make test fails with following output:
/usr/perl5.8.1/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
APACHE= APXS= APACHE_PORT= APACHE_USER= APACHE_GROUP= \
/usr/perl5.8.1/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd  -d /home/slavenr/.cpan/build/Apache-Test-1.03/t -f 
/home/slavenr/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf -DAPACHE2
using Apache/2.0.40 (prefork MPM)
waiting for server to start: .Syntax error on line 22 of
/home/slavenr/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf:
Invalid command 'TransferLog', perhaps mis-spelled or defined
by a module not included in the server configuration !!!
server has died with status 255 (t/logs/error_log wasn't
created, start the server in the debug mode) make: ***
[run_tests] Terminated

I think this is due to it parsing the system httpd.conf (obtained
from the location of httpd) and adding to the httpd.conf of
Apache-Test any enabled LoadModule directives it finds. I guess
this could fail, or get confused, if the httpd.conf of httpd
being used isn't a functional one - one possibility is that the
httpd specified is a symlink, or is from an Apache source
distribution that has not yet been edited.
I'm not sure whether I've replied to this one. Slaven, this has been fixed in 
the current cvs. please verify that it now works for you.


Now I get a different failure ("Alias" is now invalid):
$ sudo make test
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= \
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0 
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd  -d /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t -f /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf -DAPACHE2 
using Apache/2.0.40 (prefork MPM)

waiting for server to start: .Syntax error on line 76 of /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf:
Invalid command 'Alias', perhaps mis-spelled or defined by a module not included in the server configuration
!!! 
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)
make: *** [run_tests] Terminated
Exit 2
Do you have mod_alias available?
% prefork/bin/httpd -l | grep mod_alias
  mod_alias.c
I suppose we could run this command to check for prerequisites and die if they 
 aren't available?

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread Stas Bekman
David Wheeler wrote:
On Friday, July 11, 2003, at 09:27  AM, Sander Temme wrote:
The above patch doesn't work. But this does:

Ehm... works for me. I think you're working in the mod_perl space and I'm
just concentrating on the Apache core. Maybe there are side effects 
that I'm
not seeing?

Yes, the redirect_ok subroutine, which is relevant to using lwp to send 
requests to the server.. It might work to have it return 0 instead of 
undef, though.

I don't think it will... I need redirect to be 1 under the circumstances
that I described: during those apache/acceptpathinfo and modules/alias 
tests
that need it. So, unless there is a compelling reason (like
$args->{requests_redirectable} existing and containing pertinent
information), we should leave $RedirectOK alone here.

Oops, of course. The problem was actually my stupid use of local in a 
block where it actually wouldn't do anything. So try this, instead:

--- TestRequest.pm.~1.81.~Fri Jul 11 09:02:32 2003
+++ TestRequest.pmFri Jul 11 10:43:36 2003
@@ -88,14 +88,13 @@
 $UA = undef;
 }
-if (my $redir = $args->{requests_redirectable}) {
+if (exists $args->{requests_redirectable}) {
+my $redir = $args->{requests_redirectable};
 if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
 $RedirectOK = 1;
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
@@ -298,9 +297,9 @@
 sub UPLOAD {
 my($url, $pass, $keep) = prepare(@_);
-if (exists $keep->{redirect_ok}) {
-local $RedirectOK = $keep->{redirect_ok};
-}
+local $RedirectOK = exists $keep->{redirect_ok} ?
+  $keep->{redirect_ok} : $RedirectOK;
+
 if ($keep->{filename}) {
 return upload_file($url, $keep->{filename}, $pass);
 }
@@ -461,9 +460,8 @@
 *$name = sub {
 my($url, $pass, $keep) = prepare(@_);
-if (exists $keep->{redirect_ok}) {
-local $RedirectOK = $keep->{redirect_ok};
-}
+local $RedirectOK = exists $keep->{redirect_ok} ?
+  $keep->{redirect_ok} : $RedirectOK;
 return lwp_call($method, undef, $url, @$pass);
 };
That looks good. I've committed it. Thanks David!
--
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread David Wheeler
On Friday, July 11, 2003, at 09:27  AM, Sander Temme wrote:
The above patch doesn't work. But this does:
Ehm... works for me. I think you're working in the mod_perl space and 
I'm
just concentrating on the Apache core. Maybe there are side effects 
that I'm
not seeing?
Yes, the redirect_ok subroutine, which is relevant to using lwp to send 
requests to the server.. It might work to have it return 0 instead of 
undef, though.

I don't think it will... I need redirect to be 1 under the 
circumstances
that I described: during those apache/acceptpathinfo and modules/alias 
tests
that need it. So, unless there is a compelling reason (like
$args->{requests_redirectable} existing and containing pertinent
information), we should leave $RedirectOK alone here.
Oops, of course. The problem was actually my stupid use of local in a 
block where it actually wouldn't do anything. So try this, instead:

--- TestRequest.pm.~1.81.~  Fri Jul 11 09:02:32 2003
+++ TestRequest.pm  Fri Jul 11 10:43:36 2003
@@ -88,14 +88,13 @@
 $UA = undef;
 }
-if (my $redir = $args->{requests_redirectable}) {
+if (exists $args->{requests_redirectable}) {
+my $redir = $args->{requests_redirectable};
 if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
 $RedirectOK = 1;
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
@@ -298,9 +297,9 @@
 sub UPLOAD {
 my($url, $pass, $keep) = prepare(@_);
-if (exists $keep->{redirect_ok}) {
-local $RedirectOK = $keep->{redirect_ok};
-}
+local $RedirectOK = exists $keep->{redirect_ok} ?
+  $keep->{redirect_ok} : $RedirectOK;
+
 if ($keep->{filename}) {
 return upload_file($url, $keep->{filename}, $pass);
 }
@@ -461,9 +460,8 @@
 *$name = sub {
 my($url, $pass, $keep) = prepare(@_);
-if (exists $keep->{redirect_ok}) {
-local $RedirectOK = $keep->{redirect_ok};
-}
+local $RedirectOK = exists $keep->{redirect_ok} ?
+  $keep->{redirect_ok} : $RedirectOK;
 return lwp_call($method, undef, $url, @$pass);
 };
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED]  ICQ: 15726394
http://kineticode.com/ Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]
Kineticode. Setting knowledge in motion.[sm]


Re: [patch] have_apache_mpm()

2003-07-11 Thread Geoffrey Young

William A. Rowe, Jr. wrote:
> At 07:02 PM 7/9/2003, Geoffrey Young wrote:
>
>
>> William A. Rowe, Jr. wrote:
>>
>>> It seems like the API for ap_mpm_query would be simpler to
>>> follow, just extended to run outside-of-apache.
>>
>> probably, and it would certainly be safer than checking -V
>> output. the issue I see with this is that thus far Apache-Test is
>> pure perl, so it seems overkill to get into the C API and XS for
>> just for one small feature.  unless I'm missing something, that
>> is :)
>
>
> You are :-)  It sounds like httpd -V should grow some ap_mpm_query
> output for the user to know what sorts of flags are toggled for
> that build of httpd?
ok, I see - something similar to apxs -q?  that would definitely be 
useful.

I'm no vacation for the next two weeks, but when I get back I'll take 
a stab at the interface and see what I can do (if nobody beats me to it).

in either case, I still think have_apache_mpm() is a decent API for 
Apache-Test, no matter how it's implemented behind the scenes.  does 
it make sense to get that in first as I last proposed then change the 
implementation later?  I guess the other option is to dump 
have_apache_mpm() in favor of a more generic query_apache() (or have 
both :)

thanks for the feedback.
...
> APR_HAS_THREADS only tells you if APR was built to support
> threading. I always build my core against the threaded APR so that
> all of the entry points for a threaded module are available.  If
> the module is smart enough to check ap_mpm_query for threading (as
> mod_auth_digest and mod_ssl do) then they can skip all of the
> interlock calls when running under prefork (even though they were
> compiled against a threaded APR.)
>
> That same module can now be loaded under prefork and worker.
excellent.  thanks again.
--Geoff



Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread Sander Temme
on 7/11/03 9:06, David Wheeler at [EMAIL PROTECTED] wrote:

> The above patch doesn't work. But this does:

Ehm... works for me. I think you're working in the mod_perl space and I'm
just concentrating on the Apache core. Maybe there are side effects that I'm
not seeing? 
 
> --- TestRequest.pm.~1.81.~Fri Jul 11 09:02:32 2003
> +++ TestRequest.pmFri Jul 11 09:03:59 2003
> @@ -95,7 +95,7 @@
> $RedirectOK = 0;
> }
> } else {
> -$RedirectOK = $redir;
> +$RedirectOK = 0;
> }
> 
> $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
> 
> IOW, $RedirectOK needs a value. Sender, does this work for you?

I don't think it will... I need redirect to be 1 under the circumstances
that I described: during those apache/acceptpathinfo and modules/alias tests
that need it. So, unless there is a compelling reason (like
$args->{requests_redirectable} existing and containing pertinent
information), we should leave $RedirectOK alone here.

S.

-- 
Covalent Technologies [EMAIL PROTECTED]
Engineering groupVoice: (415) 856 4214
303 Second Street #375 South   Fax: (415) 856 4210
San Francisco CA 94107

   PGP Fingerprint: 7A8D B189 E871 80CB 9521  9320 C11E 7B47 964F 31D9

===
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
===



Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread David Wheeler
On Friday, July 11, 2003, at 02:22  AM, Stas Bekman wrote:
diff -u -r1.81 TestRequest.pm
--- Apache-Test/lib/Apache/TestRequest.pm   8 Jul 2003 07:56:24 
-
1.81
+++ Apache-Test/lib/Apache/TestRequest.pm   11 Jul 2003 04:28:45 
-
@@ -88,14 +88,12 @@
 $UA = undef;
 }
 -if (my $redir = $args->{requests_redirectable}) {
+if (defined (my $redir = $args->{requests_redirectable})) {
 if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
 $RedirectOK = 1;
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
  $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
In other words, if $redir is defined, do something with it to the 
effect of
$RedirectOK. If it isn't defined, go with the default value which is 
1.
Looks right to me. I was just looking at the diff that you've posted 
earlier hence the awkward fixup suggestion. You probably don't even 
need defined. I'll let David decide how he wants it.
Gee, thanks!
David Wheeler was trying to make $RedirectOK to be a non-global flag, 
so you can change it locally to your specific test. He will soonish 
reply confirming whether this still works for him or not. I don't have 
the test suite that he has, so I can't test.
The above patch doesn't work. But this does:
--- TestRequest.pm.~1.81.~  Fri Jul 11 09:02:32 2003
+++ TestRequest.pm  Fri Jul 11 09:03:59 2003
@@ -95,7 +95,7 @@
 $RedirectOK = 0;
 }
 } else {
-$RedirectOK = $redir;
+$RedirectOK = 0;
 }
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};
IOW, $RedirectOK needs a value. Sender, does this work for you?
Regards,
David
--
David Wheeler AIM: dwTheory
[EMAIL PROTECTED]  ICQ: 15726394
http://kineticode.com/ Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]
Kineticode. Setting knowledge in motion.[sm]


Re: Test failure with Apache::Test 1.03, Apache/2.0.40 and perl-5.8.1-to-be

2003-07-11 Thread slaven
> Randy Kobes wrote:
> > On Sun, 6 Jul 2003, Slaven Rezic wrote:
> > 
> >>make test fails with following output:
> >>
> >>/usr/perl5.8.1/bin/perl -Iblib/arch -Iblib/lib \
> >>t/TEST -clean
> >>APACHE= APXS= APACHE_PORT= APACHE_USER= APACHE_GROUP= \
> >>/usr/perl5.8.1/bin/perl -Iblib/arch -Iblib/lib \
> >>t/TEST -verbose=0
> >>*** root mode: changing the fs ownership to 'nobody' (99:99)
> >>/usr/sbin/httpd  -d /home/slavenr/.cpan/build/Apache-Test-1.03/t -f 
> >>/home/slavenr/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf -DAPACHE2
> >>using Apache/2.0.40 (prefork MPM)
> >>
> >>waiting for server to start: .Syntax error on line 22 of
> >>/home/slavenr/.cpan/build/Apache-Test-1.03/t/conf/httpd.conf:
> >>Invalid command 'TransferLog', perhaps mis-spelled or defined
> >>by a module not included in the server configuration !!!
> >>server has died with status 255 (t/logs/error_log wasn't
> >>created, start the server in the debug mode) make: ***
> >>[run_tests] Terminated
> > 
> > 
> > I think this is due to it parsing the system httpd.conf (obtained
> > from the location of httpd) and adding to the httpd.conf of
> > Apache-Test any enabled LoadModule directives it finds. I guess
> > this could fail, or get confused, if the httpd.conf of httpd
> > being used isn't a functional one - one possibility is that the
> > httpd specified is a symlink, or is from an Apache source
> > distribution that has not yet been edited.
> 
> I'm not sure whether I've replied to this one. Slaven, this has been fixed in 
> the current cvs. please verify that it now works for you.
> 

Now I get a different failure ("Alias" is now invalid):

$ sudo make test
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= \
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0 
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd  -d /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t 
-f /home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf 
-DAPACHE2 
using Apache/2.0.40 (prefork MPM)

waiting for server to start: .Syntax error on line 76 of 
/home/slavenr/work2/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf:
Invalid command 'Alias', perhaps mis-spelled or defined by a module not 
included in the server configuration
!!! 
server has died with status 255 (t/logs/error_log wasn't created, start the 
server in the debug mode)
make: *** [run_tests] Terminated
Exit 2


This is with the latest CVS version.

Regards,
Slaven


Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread Stas Bekman
Sander Temme wrote:
on 7/10/03 18:00, Stas Bekman at [EMAIL PROTECTED] wrote:

Does this work?
else if ($redir) {
  $RedirectOK = $redir;
}

It does. However, isn't this the same condition as in the top if clause?
Wouldn't you want to:
Index: Apache-Test/lib/Apache/TestRequest.pm
===
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest
.pm,v
retrieving revision 1.81
diff -u -r1.81 TestRequest.pm
--- Apache-Test/lib/Apache/TestRequest.pm   8 Jul 2003 07:56:24 -
1.81
+++ Apache-Test/lib/Apache/TestRequest.pm   11 Jul 2003 04:28:45 -
@@ -88,14 +88,12 @@
 $UA = undef;
 }
 
-if (my $redir = $args->{requests_redirectable}) {
+if (defined (my $redir = $args->{requests_redirectable})) {
 if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
 $RedirectOK = 1;
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
 
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};

In other words, if $redir is defined, do something with it to the effect of
$RedirectOK. If it isn't defined, go with the default value which is 1. 
Looks right to me. I was just looking at the diff that you've posted earlier 
hence the awkward fixup suggestion. You probably don't even need defined. I'll 
let David decide how he wants it.

What
exactly is this code trying to do?
David Wheeler was trying to make $RedirectOK to be a non-global flag, so you 
can change it locally to your specific test. He will soonish reply confirming 
whether this still works for him or not. I don't have the test suite that he 
has, so I can't test.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread Sander Temme
on 7/10/03 18:00, Stas Bekman at [EMAIL PROTECTED] wrote:

> 
> Does this work?
> 
> else if ($redir) {
>$RedirectOK = $redir;
> }

It does. However, isn't this the same condition as in the top if clause?
Wouldn't you want to:

Index: Apache-Test/lib/Apache/TestRequest.pm
===
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest
.pm,v
retrieving revision 1.81
diff -u -r1.81 TestRequest.pm
--- Apache-Test/lib/Apache/TestRequest.pm   8 Jul 2003 07:56:24 -
1.81
+++ Apache-Test/lib/Apache/TestRequest.pm   11 Jul 2003 04:28:45 -
@@ -88,14 +88,12 @@
 $UA = undef;
 }
 
-if (my $redir = $args->{requests_redirectable}) {
+if (defined (my $redir = $args->{requests_redirectable})) {
 if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
 $RedirectOK = 1;
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
 
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};

In other words, if $redir is defined, do something with it to the effect of
$RedirectOK. If it isn't defined, go with the default value which is 1. What
exactly is this code trying to do?

S.

-- 
Covalent Technologies [EMAIL PROTECTED]
Engineering groupVoice: (415) 856 4214
303 Second Street #375 South   Fax: (415) 856 4210
San Francisco CA 94107

   PGP Fingerprint: 7A8D B189 E871 80CB 9521  9320 C11E 7B47 964F 31D9

===
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
===



TestRequest.pm.patch
Description: Binary data


Re: [PATCH] Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

2003-07-11 Thread Stas Bekman
Sander Temme wrote:
on 7/10/03 12:56, Sander Temme at [EMAIL PROTECTED] wrote:

parameter to the request invocations in t/apache/acceptpathinfo.t. Neither
produces any result. Am I looking in the right place?

Breadcrumbing my way through Apache-Test/lib/Apache/TestRequest.pm by
liberally sprinkling print statements, I get to the following around line
97:
 

+if (my $redir = $args->{requests_redirectable}) {
+if (ref $redir and (@$redir > 1 or $redir->[0] ne 'POST')) {
+$RedirectOK = 1;
+} else {
+$RedirectOK = 0;
+}
+} else {
+$RedirectOK = $redir;
+}
+

We arrive at this if statement in all failing acceptpathinfo and
modules/alias tests, and end up in the else clause because $redir is
undefined. The result is that we reset RedirectOK to something undefined,
hence don't follow the redirection. Getting rid of the else clause gets me
my passing tests back, since RedirectOK stays at its default value of '1'.
Like so:
Index: Apache-Test/lib/Apache/TestRequest.pm
===
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest
.pm,v
retrieving revision 1.81
diff -u -r1.81 TestRequest.pm
--- Apache-Test/lib/Apache/TestRequest.pm   8 Jul 2003 07:56:24 -
1.81
+++ Apache-Test/lib/Apache/TestRequest.pm   10 Jul 2003 21:05:34 -
@@ -94,8 +94,6 @@
 } else {
 $RedirectOK = 0;
 }
-} else {
-$RedirectOK = $redir;
 }
 
 $args->{keep_alive} ||= $ENV{APACHE_TEST_HTTP11};

(also attached to avoid breakage by line wrappage). Tested on Darwin 6.6,
Perl 5.6.0, against Apache 2.0.47.
Does that sound sound?
Does this work?
else if ($redir) {
$RedirectOK = $redir;
}
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com