diff src/core/ngx_conf_file.c @ 178:87699398f955 NGINX_0_3_36

nginx 0.3.36 *) Feature: the ngx_http_addition_filter_module. *) Feature: the "proxy_pass" and "fastcgi_pass" directives may be used inside the "if" block. *) Feature: the "proxy_ignore_client_abort" and "fastcgi_ignore_client_abort" directives. *) Feature: the "$request_completion" variable. *) Feature: the ngx_http_perl_module supports the $r->request_method and $r->remote_addr. *) Feature: the ngx_http_ssi_module supports the "elif" command. *) Bugfix: the "\/" string in the expression of the "if" command of the ngx_http_ssi_module was treated incorrectly. *) Bugfix: in the regular expressions in the "if" command of the ngx_http_ssi_module. *) Bugfix: if the relative path was specified in the "client_body_temp_path", "proxy_temp_path", "fastcgi_temp_path", and "perl_modules" directives, then the directory was used relatively to a current path but not to a server prefix.
author Igor Sysoev <http://sysoev.ru>
date Wed, 05 Apr 2006 00:00:00 +0400
parents bb61aa162c6b
children 003bd800ec2a
line wrap: on
line diff
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -63,6 +63,7 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t
     char             *rv;
     ngx_fd_t          fd;
     ngx_int_t         rc;
+    ngx_buf_t        *b;
     ngx_uint_t        block;
     ngx_conf_file_t  *prev;
 
@@ -95,11 +96,23 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t
                           ngx_fd_info_n " \"%s\" failed", filename->data);
         }
 
-        cf->conf_file->buffer = ngx_create_temp_buf(cf->pool, ngx_pagesize);
-        if (cf->conf_file->buffer == NULL) {
+        b = ngx_calloc_buf(cf->pool);
+        if (b == NULL) {
             return NGX_CONF_ERROR;
         }
 
+        cf->conf_file->buffer = b;
+
+        b->start = ngx_alloc(ngx_pagesize, cf->log);
+        if (b->start == NULL) {
+            return NGX_CONF_ERROR;
+        }
+
+        b->pos = b->start;
+        b->last = b->start;
+        b->end = b->last + ngx_pagesize;
+        b->temporary = 1;
+
         cf->conf_file->file.fd = fd;
         cf->conf_file->file.name.len = filename->len;
         cf->conf_file->file.name.data = filename->data;
@@ -183,7 +196,7 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t
 
 
     if (filename) {
-        ngx_pfree(cf->pool, cf->conf_file->buffer->start);
+        ngx_free(cf->conf_file->buffer->start);
 
         cf->conf_file = prev;