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

modules/generators/mod_asis.c

index c67650393fc418cdbcfb3ad8f9fb9bd4852cef7c..0809a8446bd8f357b002d7394104c11fced23940 100644 (file)
 
 static int asis_handler(request_rec *r)
 {
-    conn_rec *c = r->connection;
-    apr_file_t *f = NULL;
+    apr_file_t *f;
     apr_status_t rv;
     const char *location;
 
-    if(strcmp(r->handler,ASIS_MAGIC_TYPE) && strcmp(r->handler,"send-as-is"))
+    if (strcmp(r->handler, ASIS_MAGIC_TYPE) && strcmp(r->handler, "send-as-is")) {
         return DECLINED;
+    }
 
     r->allowed |= (AP_METHOD_BIT << M_GET);
-    if (r->method_number != M_GET)
+    if (r->method_number != M_GET) {
         return DECLINED;
+    }
+
     if (r->finfo.filetype == APR_NOFILE) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                     "File does not exist: %s", r->filename);
@@ -76,6 +78,7 @@ static int asis_handler(request_rec *r)
     }
 
     if (!r->header_only) {
+        conn_rec *c = r->connection;
         apr_bucket_brigade *bb;
         apr_bucket *b;
         apr_off_t pos = 0;