Joe Orton wrote:
>
ok, joe, thanks for responding.
I don't know what to take away from all the joint questions, though... guess
we all need some more (round) tuits :)
> But either
> way: setting ->proxyreq = PROXYREQ_REVERSE is the only correct thing to
> do for the code in t/response/TestModules/proxy.pm - it enables a
> reverse proxy.
to that end, this patch seems to do the trick. tested against 2.0.54 and
httpd trunk. someone else will need to test 2.0.47 since I'm getting odd
compile warnings and coredumps in httpd at the moment on fc3 (unrelated to
mod_perl) for that version.
--Geoff
Index: xs/tables/current/Apache2/ConstantsTable.pm
===================================================================
--- xs/tables/current/Apache2/ConstantsTable.pm (revision 265759)
+++ xs/tables/current/Apache2/ConstantsTable.pm (working copy)
@@ -227,7 +227,12 @@
'TAKE23',
'TAKE123',
'TAKE13'
- ]
+ ],
+ 'proxy' => [
+ 'PROXYREQ_REVERSE',
+ 'PROXYREQ_NONE',
+ 'PROXYREQ_PROXY',
+ ],
},
'APR::Const' => {
'uri' => [
@@ -459,7 +464,7 @@
],
'common' => [
'APR_SUCCESS'
- ]
+ ],
}
};
Index: t/apache/constants.t
===================================================================
--- t/apache/constants.t (revision 265759)
+++ t/apache/constants.t (working copy)
@@ -6,7 +6,7 @@
use Apache::TestUtil;
# -compile puts constants into the Apache2:: namespace
-use Apache2::Const -compile => qw(:http :common :mpmq
+use Apache2::Const -compile => qw(:http :common :mpmq :proxy
TAKE23 &OPT_EXECCGI
DECLINE_CMD DIR_MAGIC_TYPE
CRLF);
@@ -15,7 +15,7 @@
# caller namespace. also defaults to :common
use Apache2::Const;
-plan tests => 17;
+plan tests => 18;
ok t_cmp(REDIRECT, 302, 'REDIRECT');
@@ -37,6 +37,10 @@
9,
'Apache2::Const::MPMQ_MAX_SPARE_DAEMONS');
+ok t_cmp(Apache2::Const::PROXYREQ_REVERSE,
+ 2,
+ 'Apache2::Const::PROXYREQ_REVERSE');
+
# the rest of the tests don't fit into the t_cmp() meme
# for one reason or anothre...
Index: t/response/TestModules/proxy.pm
===================================================================
--- t/response/TestModules/proxy.pm (revision 265759)
+++ t/response/TestModules/proxy.pm (working copy)
@@ -11,7 +11,7 @@
my $uri_real = "/TestModules__proxy_real";
-use Apache2::Const -compile => qw(DECLINED OK);
+use Apache2::Const -compile => qw(DECLINED OK PROXYREQ_REVERSE);
sub proxy {
my $r = shift;
@@ -23,7 +23,7 @@
my $real_url = sprintf "http://%s:%d%s",
$s->server_hostname, $s->port, $uri_real;
- $r->proxyreq(1);
+ $r->proxyreq(Apache2::Const::PROXYREQ_REVERSE);
$r->uri($real_url);
$r->filename("proxy:$real_url");
$r->handler('proxy-server');
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]