httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1024449 - /httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
Date Tue, 19 Oct 2010 22:48:38 GMT
Author: minfrin
Date: Tue Oct 19 22:48:38 2010
New Revision: 1024449

URL: http://svn.apache.org/viewvc?rev=1024449&view=rev
Log:
Avoid unnecessariy initialisation before we test handler name.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=1024449&r1=1024448&r2=1024449&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue Oct 19 22:48:38 2010
@@ -699,23 +699,29 @@ static int balancer_init(apr_pool_t *p, 
  */
 static int balancer_handler(request_rec *r)
 {
-    void *sconf = r->server->module_config;
-    proxy_server_conf *conf = (proxy_server_conf *)
-        ap_get_module_config(sconf, &proxy_module);
+    void *sconf;
+    proxy_server_conf *conf;
     proxy_balancer *balancer, *bsel = NULL;
     proxy_worker *worker, *wsel = NULL;
     proxy_worker **workers = NULL;
-    apr_table_t *params = apr_table_make(r->pool, 10);
+    apr_table_t *params;
     int access_status;
     int i, n;
     const char *name;
 
     /* is this for us? */
-    if (strcmp(r->handler, "balancer-manager"))
+    if (strcmp(r->handler, "balancer-manager")) {
         return DECLINED;
+    }
+
     r->allowed = (AP_METHOD_BIT << M_GET);
-    if (r->method_number != M_GET)
+    if (r->method_number != M_GET) {
         return DECLINED;
+    }
+
+    sconf = r->server->module_config;
+    conf = (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
+    params = apr_table_make(r->pool, 10);
 
     if (r->args) {
         char *args = apr_pstrdup(r->pool, r->args);



Mime
View raw message