httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1781031 - /httpd/httpd/trunk/modules/metadata/mod_remoteip.c
Date Tue, 31 Jan 2017 08:39:12 GMT
Author: jorton
Date: Tue Jan 31 08:39:11 2017
New Revision: 1781031

URL: http://svn.apache.org/viewvc?rev=1781031&view=rev
Log:
* modules/metadata/mod_remoteip.c (register_hooks,
  remoteip_hook_pre_connection): Reference the filter by handle rather
  than name (avoiding tree lookup by name on use).

Modified:
    httpd/httpd/trunk/modules/metadata/mod_remoteip.c

Modified: httpd/httpd/trunk/modules/metadata/mod_remoteip.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_remoteip.c?rev=1781031&r1=1781030&r2=1781031&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Tue Jan 31 08:39:11 2017
@@ -82,7 +82,7 @@ typedef struct {
 } remoteip_req_t;
 
 /* For PROXY protocol processing */
-static const char *remoteip_filter_name = "REMOTEIP_INPUT";
+static ap_filter_rec_t *remoteip_filter;
 
 typedef struct {
     char line[108];
@@ -881,7 +881,7 @@ static int remoteip_hook_pre_connection(
     }
 
     /* add our filter */
-    if (!ap_add_input_filter(remoteip_filter_name, NULL, NULL, c)) {
+    if (!ap_add_input_filter_handle(remoteip_filter, NULL, NULL, c)) {
         /* XXX: Shouldn't this WARN in log? */
         return DECLINED;
     }
@@ -1232,8 +1232,9 @@ static void register_hooks(apr_pool_t *p
 {
     /* mod_ssl is CONNECTION + 5, so we want something higher (earlier);
      * mod_reqtimeout is CONNECTION + 8, so we want something lower (later) */
-    ap_register_input_filter(remoteip_filter_name, remoteip_input_filter, NULL,
-                             AP_FTYPE_CONNECTION + 7);
+    remoteip_filter = 
+        ap_register_input_filter("REMOTEIP_INPUT", remoteip_input_filter, NULL,
+                                 AP_FTYPE_CONNECTION + 7);
 
     ap_hook_pre_config(remoteip_hook_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_post_config(remoteip_hook_post_config, NULL, NULL, APR_HOOK_MIDDLE);



Mime
View raw message