dougm 02/05/20 17:22:24
Modified: src/modules/perl modperl_apache_includes.h
xs/Apache/RequestRec Apache__RequestRec.h
xs/maps apache_structures.map modperl_functions.map
xs/tables/current/ModPerl FunctionTable.pm
Log:
add support for $r->proxyreq to detect proxy requests
Revision Changes Path
1.14 +1 -0 modperl-2.0/src/modules/perl/modperl_apache_includes.h
Index: modperl_apache_includes.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_apache_includes.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- modperl_apache_includes.h 13 May 2002 03:17:54 -0000 1.13
+++ modperl_apache_includes.h 21 May 2002 00:22:24 -0000 1.14
@@ -16,6 +16,7 @@
#include "http_request.h"
#include "http_connection.h"
#include "http_core.h"
+#include "http_vhost.h"
#include "ap_mpm.h"
#include "apr_lib.h"
1.3 +27 -0 modperl-2.0/xs/Apache/RequestRec/Apache__RequestRec.h
Index: Apache__RequestRec.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestRec/Apache__RequestRec.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Apache__RequestRec.h 21 May 2002 00:07:00 -0000 1.2
+++ Apache__RequestRec.h 21 May 2002 00:22:24 -0000 1.3
@@ -12,3 +12,30 @@
return retval;
}
+
+static MP_INLINE
+int mpxs_Apache__RequestRec_proxyreq(pTHX_ request_rec *r, SV *val)
+{
+ int retval = r->proxyreq;
+
+ if (!val && !r->proxyreq &&
+ r->parsed_uri.scheme &&
+ !(r->parsed_uri.hostname &&
+ strEQ(r->parsed_uri.scheme, ap_http_method(r)) &&
+ ap_matches_request_vhost(r, r->parsed_uri.hostname,
+ r->parsed_uri.port_str ?
+ r->parsed_uri.port :
+ ap_default_port(r))))
+ {
+ retval = r->proxyreq = 1;
+ r->uri = r->unparsed_uri;
+ /* else mod_proxy will segfault */
+ r->filename = apr_pstrcat(r->pool, "modperl-proxy:", r->uri, NULL);
+ }
+
+ if (val) {
+ r->proxyreq = SvIV(val);
+ }
+
+ return retval;
+}
1.16 +1 -1 modperl-2.0/xs/maps/apache_structures.map
Index: apache_structures.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- apache_structures.map 19 May 2002 20:11:55 -0000 1.15
+++ apache_structures.map 21 May 2002 00:22:24 -0000 1.16
@@ -11,7 +11,7 @@
main
the_request
assbackwards
- proxyreq
+~ proxyreq
header_only
protocol
proto_num
1.38 +1 -0 modperl-2.0/xs/maps/modperl_functions.map
Index: modperl_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- modperl_functions.map 19 May 2002 20:11:55 -0000 1.37
+++ modperl_functions.map 21 May 2002 00:22:24 -0000 1.38
@@ -10,6 +10,7 @@
MODULE=Apache::RequestRec PACKAGE=Apache::RequestRec
mpxs_Apache__RequestRec_content_type | | r, type=Nullsv
+ mpxs_Apache__RequestRec_proxyreq | | r, val=Nullsv
MODULE=Apache::RequestUtil PACKAGE=guess
mpxs_Apache__RequestRec_push_handlers
1.65 +19 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
Index: FunctionTable.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- FunctionTable.pm 19 May 2002 20:11:55 -0000 1.64
+++ FunctionTable.pm 21 May 2002 00:22:24 -0000 1.65
@@ -2,7 +2,7 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ! WARNING: generated by ModPerl::ParseSource/0.01
-# ! Sun May 19 12:59:55 2002
+# ! Mon May 20 16:47:17 2002
# ! do NOT edit, any changes will be lost !
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -4516,6 +4516,24 @@
{
'type' => 'SV **',
'name' => 'sp'
+ }
+ ]
+ },
+ {
+ 'return_type' => 'int',
+ 'name' => 'mpxs_Apache__RequestRec_proxyreq',
+ 'args' => [
+ {
+ 'type' => 'PerlInterpreter *',
+ 'name' => 'my_perl'
+ },
+ {
+ 'type' => 'request_rec *',
+ 'name' => 'r'
+ },
+ {
+ 'type' => 'SV *',
+ 'name' => 'val'
}
]
},