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]



Reply via email to