From: Graham Leggett Date: Tue, 19 Oct 2010 23:17:09 +0000 (+0000) Subject: Avoid unnecessariy initialisation before we test mod_asis's handler name. X-Git-Tag: 2.3.9~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69d19f670f42025da7628ddab89aa61f22f1709f;p=apache Avoid unnecessariy initialisation before we test mod_asis's handler name. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024463 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index c67650393f..0809a8446b 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -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;