]> granicus.if.org Git - apache/commitdiff
Avoid unnecessariy initialisation before we test handler name.
authorGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 22:48:38 +0000 (22:48 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 22:48:38 +0000 (22:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024449 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c

index 107dc478654f4349c4bab372d18c5ca8280af194..ea53d0570db864bbaf5bbff939e6f44d2811d314 100644 (file)
@@ -699,23 +699,29 @@ static int balancer_init(apr_pool_t *p, apr_pool_t *plog,
  */
 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);