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

modules/cluster/mod_heartmonitor.c

index 1ab9c5bcdadc0ab83dbee8038ee5fcddbe93cd74..706a7d19ce043c4cd1f33e543ef88a26d72c5cd6 100644 (file)
@@ -731,14 +731,13 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
 static int hm_handler(request_rec *r)
 {
     apr_bucket_brigade *input_brigade;
-    apr_size_t len=MAX_MSG_LEN;
+    apr_size_t len;
     char *buf;
     apr_status_t status;
     apr_table_t *tbl;
     hm_server_t hmserver;
     char *ip;
-    hm_ctx_t *ctx = ap_get_module_config(r->server->module_config,
-                                         &heartmonitor_module);
+    hm_ctx_t *ctx;
 
     if (strcmp(r->handler, "hearthbeat")) {
         return DECLINED;
@@ -746,6 +745,11 @@ static int hm_handler(request_rec *r)
     if (r->method_number != M_POST) {
         return HTTP_METHOD_NOT_ALLOWED;
     }
+
+    len = MAX_MSG_LEN;
+    ctx = ap_get_module_config(r->server->module_config,
+            &heartmonitor_module);
+
     buf = apr_pcalloc(r->pool, MAX_MSG_LEN);
     input_brigade = apr_brigade_create(r->connection->pool, r->connection->bucket_alloc);
     status = ap_get_brigade(r->input_filters, input_brigade, AP_MODE_READBYTES, APR_BLOCK_READ, MAX_MSG_LEN);