diff src/http/modules/ngx_http_autoindex_module.c @ 501:d4ea69372b94 release-0.1.25

nginx-0.1.25-RELEASE import *) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
author Igor Sysoev <igor@sysoev.ru>
date Sat, 19 Mar 2005 12:38:37 +0000
parents src/http/modules/ngx_http_autoindex_handler.c@64d9afb209da
children b1648294f693
line wrap: on
line diff
copy from src/http/modules/ngx_http_autoindex_handler.c
copy to src/http/modules/ngx_http_autoindex_module.c
--- a/src/http/modules/ngx_http_autoindex_handler.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -218,10 +218,7 @@ ngx_http_autoindex_handler(ngx_http_requ
         if (ngx_read_dir(&dir) == NGX_ERROR) {
             err = ngx_errno;
 
-            if (err == NGX_ENOMOREFILES) {
-                rc = NGX_OK;
-
-            } else {
+            if (err != NGX_ENOMOREFILES) {
                 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
                               ngx_read_dir_n " \"%s\" failed", dname.data);
                 return ngx_http_autoindex_error(r, &dir, dname.data);
@@ -251,7 +248,8 @@ ngx_http_autoindex_handler(ngx_http_requ
             if (dname.len + 1 + len > fname.len) {
                 fname.len = dname.len + 1 + len + 32;
 
-                if (!(fname.data = ngx_palloc(pool, fname.len))) {
+                fname.data = ngx_palloc(pool, fname.len);
+                if (fname.data == NULL) {
                     return ngx_http_autoindex_error(r, &dir, dname.data);
                 }
 
@@ -280,7 +278,8 @@ ngx_http_autoindex_handler(ngx_http_requ
             }
         }
 
-        if (!(entry = ngx_array_push(&entries))) {
+        entry = ngx_array_push(&entries);
+        if (entry == NULL) {
             return ngx_http_autoindex_error(r, &dir, dname.data);
         }
 
@@ -288,7 +287,8 @@ ngx_http_autoindex_handler(ngx_http_requ
         entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len,
                                            NGX_ESCAPE_HTML);
 
-        if (!(entry->name.data = ngx_palloc(pool, len + entry->escape + 1))) {
+        entry->name.data = ngx_palloc(pool, len + entry->escape + 1);
+        if (entry->name.data == NULL) {
             return ngx_http_autoindex_error(r, &dir, dname.data);
         }
 
@@ -326,7 +326,8 @@ ngx_http_autoindex_handler(ngx_http_requ
                + 2;
     }
 
-    if (!(b = ngx_create_temp_buf(r->pool, len))) {
+    b = ngx_create_temp_buf(r->pool, len);
+    if (b == NULL) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
     }
 
@@ -481,11 +482,13 @@ ngx_http_autoindex_alloc(ngx_http_autoin
         ctx->size += ctx->buf->last - ctx->buf->pos;
     }
 
-    if (!(ctx->buf = ngx_create_temp_buf(ctx->pool, ctx->alloc_size))) {
+    ctx->buf = ngx_create_temp_buf(ctx->pool, ctx->alloc_size);
+    if (ctx->buf == NULL) {
         return NULL;
     }
 
-    if (!(cl = ngx_alloc_chain_link(ctx->pool))) {
+    cl = ngx_alloc_chain_link(ctx->pool);
+    if (cl == NULL) {
         return NULL;
     }