You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2010/10/20 01:17:10 UTC

svn commit: r1024463 - /httpd/httpd/trunk/modules/generators/mod_asis.c

Author: minfrin
Date: Tue Oct 19 23:17:09 2010
New Revision: 1024463

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

Modified:
    httpd/httpd/trunk/modules/generators/mod_asis.c

Modified: httpd/httpd/trunk/modules/generators/mod_asis.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_asis.c?rev=1024463&r1=1024462&r2=1024463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_asis.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_asis.c Tue Oct 19 23:17:09 2010
@@ -30,17 +30,19 @@
 
 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;