]> git.kaiwu.me - nginx.git/commitdiff
*) back out r2040
authorIgor Sysoev <igor@sysoev.ru>
Tue, 17 Jun 2008 15:00:30 +0000 (15:00 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 17 Jun 2008 15:00:30 +0000 (15:00 +0000)
*) refactor ngx_palloc()
*) introduce ngx_pnalloc()
*) additional pool blocks have smaller header

54 files changed:
src/core/nginx.c
src/core/ngx_array.c
src/core/ngx_conf_file.c
src/core/ngx_connection.c
src/core/ngx_cycle.c
src/core/ngx_file.c
src/core/ngx_hash.c
src/core/ngx_inet.c
src/core/ngx_palloc.c
src/core/ngx_palloc.h
src/core/ngx_regex.c
src/core/ngx_string.c
src/event/ngx_event_accept.c
src/event/ngx_event_acceptex.c
src/event/ngx_event_openssl.c
src/http/modules/ngx_http_auth_basic_module.c
src/http/modules/ngx_http_autoindex_module.c
src/http/modules/ngx_http_dav_module.c
src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_gzip_filter_module.c
src/http/modules/ngx_http_headers_filter_module.c
src/http/modules/ngx_http_index_module.c
src/http/modules/ngx_http_log_module.c
src/http/modules/ngx_http_map_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_range_filter_module.c
src/http/modules/ngx_http_realip_module.c
src/http/modules/ngx_http_ssi_filter_module.c
src/http/modules/ngx_http_static_module.c
src/http/modules/ngx_http_sub_filter_module.c
src/http/modules/ngx_http_userid_filter_module.c
src/http/modules/perl/nginx.xs
src/http/modules/perl/ngx_http_perl_module.c
src/http/ngx_http.c
src/http/ngx_http_core_module.c
src/http/ngx_http_request.c
src/http/ngx_http_script.c
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream_round_robin.c
src/http/ngx_http_variables.c
src/mail/ngx_mail.c
src/mail/ngx_mail_auth_http_module.c
src/mail/ngx_mail_handler.c
src/mail/ngx_mail_imap_handler.c
src/mail/ngx_mail_imap_module.c
src/mail/ngx_mail_pop3_handler.c
src/mail/ngx_mail_pop3_module.c
src/mail/ngx_mail_proxy_module.c
src/mail/ngx_mail_smtp_handler.c
src/mail/ngx_mail_smtp_module.c
src/mysql/ngx_http_mysql_test.c
src/mysql/ngx_mysql.c
src/os/unix/ngx_process_cycle.c
src/os/unix/ngx_user.c

index 48e085ba36e4d3e38808834174e5594e5c67ec62..450edf374d6188c35b73d56d64540b68214998cb 100644 (file)
@@ -826,7 +826,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
 
     ccf->oldpid.len = ccf->pid.len + sizeof(NGX_OLDPID_EXT);
 
-    ccf->oldpid.data = ngx_palloc(cycle->pool, ccf->oldpid.len);
+    ccf->oldpid.data = ngx_pnalloc(cycle->pool, ccf->oldpid.len);
     if (ccf->oldpid.data == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -870,7 +870,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
 
     } else {
         cycle->lock_file.len = ccf->lock_file.len + 1;
-        cycle->lock_file.data = ngx_palloc(cycle->pool,
+        cycle->lock_file.data = ngx_pnalloc(cycle->pool,
                                       ccf->lock_file.len + sizeof(".accept"));
         if (cycle->lock_file.data == NULL) {
             return NGX_CONF_ERROR;
index 1b9f7cb7867fc2fa284ff6f34470281bfdf9b77d..a536d87b5614780d6cedd329dd266c925fc1d531 100644 (file)
@@ -39,12 +39,12 @@ ngx_array_destroy(ngx_array_t *a)
 
     p = a->pool;
 
-    if ((u_char *) a->elts + a->size * a->nalloc == p->last) {
-        p->last -= a->size * a->nalloc;
+    if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) {
+        p->d.last -= a->size * a->nalloc;
     }
 
-    if ((u_char *) a + sizeof(ngx_array_t) == p->last) {
-        p->last = (u_char *) a;
+    if ((u_char *) a + sizeof(ngx_array_t) == p->d.last) {
+        p->d.last = (u_char *) a;
     }
 }
 
@@ -64,14 +64,15 @@ ngx_array_push(ngx_array_t *a)
 
         p = a->pool;
 
-        if ((u_char *) a->elts + size == p->last && p->last + a->size <= p->end)
+        if ((u_char *) a->elts + size == p->d.last
+            && p->d.last + a->size <= p->d.end)
         {
             /*
              * the array allocation is the last in the pool
              * and there is space for new allocation
              */
 
-            p->last += a->size;
+            p->d.last += a->size;
             a->nalloc++;
 
         } else {
@@ -111,15 +112,15 @@ ngx_array_push_n(ngx_array_t *a, ngx_uint_t n)
 
         p = a->pool;
 
-        if ((u_char *) a->elts + a->size * a->nalloc == p->last
-            && p->last + size <= p->end)
+        if ((u_char *) a->elts + a->size * a->nalloc == p->d.last
+            && p->d.last + size <= p->d.end)
         {
             /*
              * the array allocation is the last in the pool
              * and there is space for new allocation
              */
 
-            p->last += size;
+            p->d.last += size;
             a->nalloc += n;
 
         } else {
index 6efcd8b7d3392acb45eab0a17464022558e79b86..b32f0f03cd662fa3ce3058339e0e56d7b64f239d 100644 (file)
@@ -574,7 +574,7 @@ ngx_conf_read_token(ngx_conf_t *cf)
                     return NGX_ERROR;
                 }
 
-                word->data = ngx_palloc(cf->pool, b->pos - start + 1);
+                word->data = ngx_pnalloc(cf->pool, b->pos - start + 1);
                 if (word->data == NULL) {
                     return NGX_ERROR;
                 }
@@ -726,7 +726,7 @@ ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix)
     }
 
     name->len = len + old.len;
-    name->data = ngx_palloc(cycle->pool, name->len + 1);
+    name->data = ngx_pnalloc(cycle->pool, name->len + 1);
     if (name->data == NULL) {
         return  NGX_ERROR;
     }
index b49a696f2f800d2ca872bd4746e9a3f9cd457264..03662b398a2c5fc13988f534c60477f3cd426a39 100644 (file)
@@ -36,7 +36,7 @@ ngx_listening_inet_stream_socket(ngx_conf_t *cf, in_addr_t addr, in_port_t port)
     sin->sin_port = htons(port);
 
 
-    ls->addr_text.data = ngx_palloc(cf->pool,
+    ls->addr_text.data = ngx_pnalloc(cf->pool,
                                     INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
     if (ls->addr_text.data == NULL) {
         return NULL;
@@ -106,8 +106,8 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
 
         ls[i].addr_text_max_len = INET_ADDRSTRLEN;
 
-        ls[i].addr_text.data = ngx_palloc(cycle->pool, INET_ADDRSTRLEN - 1
-                                                       + sizeof(":65535") - 1);
+        ls[i].addr_text.data = ngx_pnalloc(cycle->pool,
+                                   INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
         if (ls[i].addr_text.data == NULL) {
             return NGX_ERROR;
         }
index 9cdbb2d95b45b2166e432021282ed549e25d112c..a82e8506b4f3cd353ad4bb233d93740745ddad75 100644 (file)
@@ -81,7 +81,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
 
 
     cycle->conf_file.len = old_cycle->conf_file.len;
-    cycle->conf_file.data = ngx_palloc(pool, old_cycle->conf_file.len + 1);
+    cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1);
     if (cycle->conf_file.data == NULL) {
         ngx_destroy_pool(pool);
         return NULL;
@@ -182,7 +182,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
     hostname[NGX_MAXHOSTNAMELEN - 1] = '\0';
     cycle->hostname.len = ngx_strlen(hostname);
 
-    cycle->hostname.data = ngx_palloc(pool, cycle->hostname.len);
+    cycle->hostname.data = ngx_pnalloc(pool, cycle->hostname.len);
     if (cycle->hostname.data == NULL) {
         ngx_destroy_pool(pool);
         return NULL;
@@ -460,8 +460,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
 
 #else
 
-        lock_file = ngx_palloc(cycle->pool,
-                               cycle->lock_file.len + shm_zone[i].name.len);
+        lock_file = ngx_pnalloc(cycle->pool,
+                                cycle->lock_file.len + shm_zone[i].name.len);
 
         if (lock_file == NULL) {
             goto failed;
index b98108abecf10e8d0ac10cb2828bb94253044ca7..28980df853b8d2ddfd129c7164992b0d57bc1743 100644 (file)
@@ -46,7 +46,7 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
 
     file->name.len = path->name.len + 1 + path->len + 10;
 
-    file->name.data = ngx_palloc(pool, file->name.len + 1);
+    file->name.data = ngx_pnalloc(pool, file->name.len + 1);
     if (file->name.data == NULL) {
         return NGX_ERROR;
     }
index 7213f9fdc33ec0530a72cfc7163c38b66ace7727..abd2cf173ddb2c82f8101bb597f97fa493860d4c 100644 (file)
@@ -839,7 +839,7 @@ wildcard:
         }
 
         name->len = last - 1;
-        name->data = ngx_palloc(ha->temp_pool, name->len);
+        name->data = ngx_pnalloc(ha->temp_pool, name->len);
         if (name->data == NULL) {
             return NGX_ERROR;
         }
@@ -855,7 +855,7 @@ wildcard:
          *      and ".example.com" to "com.example\0"
          */
 
-        p = ngx_palloc(ha->temp_pool, last);
+        p = ngx_pnalloc(ha->temp_pool, last);
         if (p == NULL) {
             return NGX_ERROR;
         }
@@ -891,7 +891,7 @@ wildcard:
 
         last++;
 
-        p = ngx_palloc(ha->temp_pool, last);
+        p = ngx_pnalloc(ha->temp_pool, last);
         if (p == NULL) {
             return NGX_ERROR;
         }
@@ -944,7 +944,7 @@ wildcard:
     }
 
     name->len = last - skip;
-    name->data = ngx_palloc(ha->temp_pool, name->len);
+    name->data = ngx_pnalloc(ha->temp_pool, name->len);
     if (name->data == NULL) {
         return NGX_ERROR;
     }
index f54a05721263098b4351a91f737aa6e0a60b0d44..aefdfcdad963e1ea0311ac212de43323fbd4e8cf 100644 (file)
@@ -578,7 +578,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)
 
             len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1;
 
-            p = ngx_palloc(pool, len);
+            p = ngx_pnalloc(pool, len);
             if (p == NULL) {
                 return NGX_ERROR;
             }
@@ -614,7 +614,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)
         u->addrs[0].sockaddr = (struct sockaddr *) sin;
         u->addrs[0].socklen = sizeof(struct sockaddr_in);
 
-        p = ngx_palloc(pool, u->host.len + sizeof(":65536") - 1);
+        p = ngx_pnalloc(pool, u->host.len + sizeof(":65536") - 1);
         if (p == NULL) {
             return NGX_ERROR;
         }
index 130c67056aeaf6302f5b26dfde2bc84f67c10be7..64f958e5af8e55e7077629b3ce4ef3d9f80b68db 100644 (file)
@@ -8,6 +8,10 @@
 #include <ngx_core.h>
 
 
+static void *ngx_palloc_block(ngx_pool_t *pool, size_t size);
+static void *ngx_palloc_large(ngx_pool_t *pool, size_t size);
+
+
 ngx_pool_t *
 ngx_create_pool(size_t size, ngx_log_t *log)
 {
@@ -18,11 +22,14 @@ ngx_create_pool(size_t size, ngx_log_t *log)
         return NULL;
     }
 
-    p->last = (u_char *) p + sizeof(ngx_pool_t);
-    p->end = (u_char *) p + size;
+    p->d.last = (u_char *) p + sizeof(ngx_pool_t);
+    p->d.end = (u_char *) p + size;
+    p->d.next = NULL;
+
+    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size - sizeof(ngx_pool_t):
+                                                NGX_MAX_ALLOC_FROM_POOL;
     p->current = p;
     p->chain = NULL;
-    p->next = NULL;
     p->large = NULL;
     p->cleanup = NULL;
     p->log = log;
@@ -62,9 +69,9 @@ ngx_destroy_pool(ngx_pool_t *pool)
      * so we can not use this log while the free()ing the pool
      */
 
-    for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
+    for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
         ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, pool->log, 0,
-                       "free: %p, unused: %uz", p, p->end - p->last);
+                       "free: %p, unused: %uz", p, p->d.end - p->d.last);
 
         if (n == NULL) {
             break;
@@ -73,7 +80,7 @@ ngx_destroy_pool(ngx_pool_t *pool)
 
 #endif
 
-    for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
+    for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
         ngx_free(p);
 
         if (n == NULL) {
@@ -86,66 +93,99 @@ ngx_destroy_pool(ngx_pool_t *pool)
 void *
 ngx_palloc(ngx_pool_t *pool, size_t size)
 {
-    u_char            *m;
-    ngx_pool_t        *p, *n, *current;
-    ngx_pool_large_t  *large;
+    u_char      *m;
+    ngx_pool_t  *p;
 
-    if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL
-        && size <= (size_t) (pool->end - (u_char *) pool)
-                   - (size_t) ngx_align_ptr(sizeof(ngx_pool_t), NGX_ALIGNMENT))
-    {
-        p = pool->current;
-        current = p;
+    if (size <= pool->max) {
 
-        for ( ;; ) {
+        p = pool->current;
 
-            /*
-             * allow non-aligned memory blocks for small allocations (1, 2,
-             * or 3 bytes) and for odd length strings (struct's have aligned
-             * size)
-             */
+        do {
+            m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT);
 
-            if (size < sizeof(int) || (size & 1)) {
-                m = p->last;
+            if ((size_t) (p->d.end - m) >= size) {
+                p->d.last = m + size;
 
-            } else {
-                m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
+                return m;
             }
 
-            if ((size_t) (p->end - m) >= size) {
-                p->last = m + size;
+            p = p->d.next;
+
+        } while (p);
+
+        return ngx_palloc_block(pool, size);
+    }
+
+    return ngx_palloc_large(pool, size);
+}
+
+
+void *
+ngx_pnalloc(ngx_pool_t *pool, size_t size)
+{
+    u_char      *m;
+    ngx_pool_t  *p;
+
+    if (size <= pool->max) {
+
+        p = pool->current;
+
+        do {
+            m = p->d.last;
+
+            if ((size_t) (p->d.end - m) >= size) {
+                p->d.last = m + size;
 
                 return m;
             }
 
-            if ((size_t) (p->end - m) < NGX_ALIGNMENT) {
-                current = p->next;
-            }
+            p = p->d.next;
 
-            if (p->next == NULL) {
-                break;
-            }
+        } while (p);
 
-            p = p->next;
-            pool->current = current;
-        }
+        return ngx_palloc_block(pool, size);
+    }
 
-        /* allocate a new pool block */
+    return ngx_palloc_large(pool, size);
+}
 
-        n = ngx_create_pool((size_t) (p->end - (u_char *) p), p->log);
-        if (n == NULL) {
-            return NULL;
-        }
 
-        pool->current = current ? current : n;
+static void *
+ngx_palloc_block(ngx_pool_t *pool, size_t size)
+{
+    u_char      *m;
+    ngx_pool_t  *p, *new, *current;
+
+    new = ngx_create_pool((size_t) (pool->d.end - (u_char *) pool), pool->log);
+    if (new == NULL) {
+        return NULL;
+    }
 
-        p->next = n;
-        m = ngx_align_ptr(n->last, NGX_ALIGNMENT);
-        n->last = m + size;
+    current = pool->current;
 
-        return m;
+    for (p = current; p->d.next; p = p->d.next) {
+        if ((size_t) (p->d.end - p->d.last) < NGX_ALIGNMENT) {
+            current = p->d.next;
+        }
     }
 
+    p->d.next = new;
+
+    pool->current = current ? current : new;
+
+    m = (u_char *) new + sizeof(ngx_pool_data_t);
+    new->d.last = m + size;
+
+    return m;
+}
+
+
+static void *
+ngx_palloc_large(ngx_pool_t *pool, size_t size)
+{
+    void              *p;
+    ngx_pool_large_t  *large;
+
 #if 0
     p = ngx_memalign(ngx_pagesize, size, pool->log);
     if (p == NULL) {
@@ -172,17 +212,6 @@ ngx_palloc(ngx_pool_t *pool, size_t size)
 }
 
 
-void *
-ngx_palloc_aligned(ngx_pool_t *pool, size_t size)
-{
-    if (size & 1) {
-        size++;
-    }
-
-    return ngx_palloc(pool, size);
-}
-
-
 ngx_int_t
 ngx_pfree(ngx_pool_t *pool, void *p)
 {
index 11e2b41da1013e2b7ebd07137f2ce5c828855f9d..34878f5f27bab63b830ac9b4f4f61a1961bdee53 100644 (file)
@@ -43,12 +43,18 @@ struct ngx_pool_large_s {
 };
 
 
-struct ngx_pool_s {
+typedef struct {
     u_char               *last;
     u_char               *end;
+    ngx_pool_t           *next;
+} ngx_pool_data_t;
+
+
+struct ngx_pool_s {
+    ngx_pool_data_t       d;
+    size_t                max;
     ngx_pool_t           *current;
     ngx_chain_t          *chain;
-    ngx_pool_t           *next;
     ngx_pool_large_t     *large;
     ngx_pool_cleanup_t   *cleanup;
     ngx_log_t            *log;
@@ -69,7 +75,7 @@ ngx_pool_t *ngx_create_pool(size_t size, ngx_log_t *log);
 void ngx_destroy_pool(ngx_pool_t *pool);
 
 void *ngx_palloc(ngx_pool_t *pool, size_t size);
-void *ngx_palloc_aligned(ngx_pool_t *pool, size_t size);
+void *ngx_pnalloc(ngx_pool_t *pool, size_t size);
 void *ngx_pcalloc(ngx_pool_t *pool, size_t size);
 ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p);
 
index fb12ab16be24f3e812f79da821854574771c2a72..be2dae79bf167cf2752df801825f1c4f3f456af0 100644 (file)
@@ -165,7 +165,7 @@ ngx_regex_malloc(size_t size)
 #endif
 
     if (pool) {
-        return ngx_palloc_aligned(pool, size);
+        return ngx_palloc(pool, size);
     }
 
     return NULL;
index 01d792f36f29f0cc567518c44080bccac0937d82..c9193152c236772a015da92ba7c689b04bbfa923 100644 (file)
@@ -34,7 +34,7 @@ ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src)
 {
     u_char  *dst;
 
-    dst = ngx_palloc(pool, src->len);
+    dst = ngx_pnalloc(pool, src->len);
     if (dst == NULL) {
         return NULL;
     }
index 127a4f2cccdf531eb42e1089a05d8df0e172828f..e48da2a84ad8c623576707744b7180729ae4d9f6 100644 (file)
@@ -201,7 +201,7 @@ ngx_event_accept(ngx_event_t *ev)
 #endif
 
         if (ls->addr_ntop) {
-            c->addr_text.data = ngx_palloc(c->pool, ls->addr_text_max_len);
+            c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len);
             if (c->addr_text.data == NULL) {
                 ngx_close_accepted_connection(c);
                 return;
index 2644544547c3df3f46bd4d87ff5dafb25a22d6ff..d2752aa8b9c9d058ca8cf2bf2922289f127fb8d9 100644 (file)
@@ -58,8 +58,8 @@ ngx_event_acceptex(ngx_event_t *rev)
     }
 
     if (c->listening->addr_ntop) {
-        c->addr_text.data = ngx_palloc(c->pool,
-                                       c->listening->addr_text_max_len);
+        c->addr_text.data = ngx_pnalloc(c->pool,
+                                        c->listening->addr_text_max_len);
         if (c->addr_text.data == NULL) {
             /* TODO: close socket */
             return;
index b4cabadd9252b93fcdab686d6ee1de7968bcca1f..c7a2e94072fa00c8f5e42cff1464daf63a44e0d5 100644 (file)
@@ -1907,7 +1907,7 @@ ngx_ssl_get_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
     len = BIO_pending(bio);
     s->len = len;
 
-    s->data = ngx_palloc(pool, len);
+    s->data = ngx_pnalloc(pool, len);
     if (s->data == NULL) {
         goto failed;
     }
@@ -1954,7 +1954,7 @@ ngx_ssl_get_subject_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
     for (len = 0; p[len]; len++) { /* void */ }
 
     s->len = len;
-    s->data = ngx_palloc(pool, len);
+    s->data = ngx_pnalloc(pool, len);
     if (s->data == NULL) {
         OPENSSL_free(p);
         X509_free(cert);
@@ -1996,7 +1996,7 @@ ngx_ssl_get_issuer_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
     for (len = 0; p[len]; len++) { /* void */ }
 
     s->len = len;
-    s->data = ngx_palloc(pool, len);
+    s->data = ngx_pnalloc(pool, len);
     if (s->data == NULL) {
         OPENSSL_free(p);
         X509_free(cert);
@@ -2036,7 +2036,7 @@ ngx_ssl_get_serial_number(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
     len = BIO_pending(bio);
 
     s->len = len;
-    s->data = ngx_palloc(pool, len);
+    s->data = ngx_pnalloc(pool, len);
     if (s->data == NULL) {
         BIO_free(bio);
         X509_free(cert);
index 41e53cd948c405df835d584bc6caa301346fd9ab..b09359d2a6b4a5499373f70518f0f7be52ce11eb 100644 (file)
@@ -232,7 +232,7 @@ ngx_http_auth_basic_handler(ngx_http_request_t *r)
 
     if (state == sw_passwd) {
         pwd.len = i - passwd;
-        pwd.data = ngx_palloc(r->pool, pwd.len + 1);
+        pwd.data = ngx_pnalloc(r->pool, pwd.len + 1);
         if (pwd.data == NULL) {
             return NGX_HTTP_INTERNAL_SERVER_ERROR;
         }
@@ -400,7 +400,7 @@ ngx_http_auth_basic(ngx_conf_t *cf, void *post, void *data)
 
     len = sizeof("Basic realm=\"") - 1 + realm->len + 1;
 
-    basic = ngx_palloc(cf->pool, len);
+    basic = ngx_pnalloc(cf->pool, len);
     if (basic == NULL) {
         return NGX_CONF_ERROR;
     }
index f57fbc87d91f7886ed2fbb48d2a3d1e154ca85e3..b5b6ef7f3e82c5f3e24cf6fa20f98d2b22f5c8be 100644 (file)
@@ -282,7 +282,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
                 allocated = path.len + 1 + len + 1
                                      + NGX_HTTP_AUTOINDEX_PREALLOCATE;
 
-                filename = ngx_palloc(pool, allocated);
+                filename = ngx_pnalloc(pool, allocated);
                 if (filename == NULL) {
                     return ngx_http_autoindex_error(r, &dir, &path);
                 }
@@ -318,7 +318,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
 
         entry->name.len = len;
 
-        entry->name.data = ngx_palloc(pool, len + 1);
+        entry->name.data = ngx_pnalloc(pool, len + 1);
         if (entry->name.data == NULL) {
             return ngx_http_autoindex_error(r, &dir, &path);
         }
index 3d54525e863639510f3b8d9634cfd996f0b79c45..33bb2e9c1003ffe9a414c18b1dcd840ffde34f54 100644 (file)
@@ -1102,7 +1102,7 @@ ngx_http_dav_location(ngx_http_request_t *r, u_char *path)
         location = path + clcf->root.len;
 
     } else {
-        location = ngx_palloc(r->pool, r->uri.len);
+        location = ngx_pnalloc(r->pool, r->uri.len);
         if (location == NULL) {
             return NGX_ERROR;
         }
index 5569745d6c89d1326b62d821cdee4757e6477069..b975c0675b1409c3d746d516a224588e040ba6f9 100644 (file)
@@ -1059,7 +1059,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
                         size += part[i].end - part[i].start;
                     }
 
-                    p = ngx_palloc(r->pool, size);
+                    p = ngx_pnalloc(r->pool, size);
                     if (p == NULL) {
                         return NGX_ERROR;
                     }
@@ -1087,7 +1087,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
                     h->value.data = r->header_start;
                     h->value.data[h->value.len] = '\0';
 
-                    h->lowcase_key = ngx_palloc(r->pool, h->key.len);
+                    h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
                     if (h->lowcase_key == NULL) {
                         return NGX_ERROR;
                     }
@@ -1097,9 +1097,9 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
                     h->key.len = r->header_name_end - r->header_name_start;
                     h->value.len = r->header_end - r->header_start;
 
-                    h->key.data = ngx_palloc(r->pool,
-                                             h->key.len + 1 + h->value.len + 1
-                                             + h->key.len);
+                    h->key.data = ngx_pnalloc(r->pool,
+                                              h->key.len + 1 + h->value.len + 1
+                                              + h->key.len);
                     if (h->key.data == NULL) {
                         return NGX_ERROR;
                     }
@@ -2015,7 +2015,7 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
 
         v->len = r->uri.len + flcf->index.len;
 
-        v->data = ngx_palloc(r->pool, v->len);
+        v->data = ngx_pnalloc(r->pool, v->len);
         if (v->data == NULL) {
             return NGX_ERROR;
         }
index 1587c009d1a9a7c05f50383d5db5751af45cfcfe..3677318980da42ebf915bc291db9998e8b0a0a96 100644 (file)
@@ -802,7 +802,7 @@ ngx_http_gzip_ratio_variable(ngx_http_request_t *r,
         return NGX_OK;
     }
 
-    v->data = ngx_palloc(r->pool, NGX_INT32_LEN + 3);
+    v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3);
     if (v->data == NULL) {
         return NGX_ERROR;
     }
@@ -951,7 +951,7 @@ ngx_http_gzip_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
         type->len = value[i].len;
 
-        type->data = ngx_palloc(cf->pool, type->len + 1);
+        type->data = ngx_pnalloc(cf->pool, type->len + 1);
         if (type->data == NULL) {
             return NGX_CONF_ERROR;
         }
index ad9467ba975169645c6e03ba9f296352fed07081..95d846ffbda10ca7bc09689d0a78186dad9f820d 100644 (file)
@@ -264,7 +264,7 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
         return NGX_OK;
     }
 
-    expires->value.data = ngx_palloc(r->pool, len);
+    expires->value.data = ngx_pnalloc(r->pool, len);
     if (expires->value.data == NULL) {
         return NGX_ERROR;
     }
@@ -297,8 +297,8 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
         return NGX_OK;
     }
 
-    cc->value.data = ngx_palloc(r->pool,
-                                sizeof("max-age=") + NGX_TIME_T_LEN + 1);
+    cc->value.data = ngx_pnalloc(r->pool,
+                                 sizeof("max-age=") + NGX_TIME_T_LEN + 1);
     if (cc->value.data == NULL) {
         return NGX_ERROR;
     }
index 6bfb045650e837d10385361a365a7a7c9affdb66..bd9c18c9d9bc36659bc5db2b1389f3423d41a008 100644 (file)
@@ -254,7 +254,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
             uri.data = path.data + root;
 
         } else {
-            uri.data = ngx_palloc(r->pool, uri.len);
+            uri.data = ngx_pnalloc(r->pool, uri.len);
             if (uri.data == NULL) {
                 return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
index 3d8730a1ad3b00913b76675f0d63bf8befa470a8..47358ed54d76cbfc50f869d95b703d966e7af454 100644 (file)
@@ -261,7 +261,7 @@ ngx_http_log_handler(ngx_http_request_t *r)
             }
         }
 
-        line = ngx_palloc(r->pool, len);
+        line = ngx_pnalloc(r->pool, len);
         if (line == NULL) {
             return NGX_ERROR;
         }
@@ -970,7 +970,7 @@ ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *ops,
                 } else {
                     op->run = ngx_http_log_copy_long;
 
-                    p = ngx_palloc(cf->pool, len);
+                    p = ngx_pnalloc(cf->pool, len);
                     if (p == NULL) {
                         return NGX_CONF_ERROR;
                     }
index c1d87c1a122b3bf756342de258fecc2fa5f8a90a..cedc50879cc3d8ee028c8c9549f8bfb7fdaf61e4 100644 (file)
@@ -130,7 +130,7 @@ ngx_http_map_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
         return NGX_OK;
     }
 
-    name = ngx_palloc(r->pool, len);
+    name = ngx_pnalloc(r->pool, len);
     if (name == NULL) {
         return NGX_ERROR;
     }
index 619390b96b400ba2ab1e3cadf86b336bad98c149..278edb69ffadc4222df9c853033700cbaa734098 100644 (file)
@@ -964,8 +964,8 @@ ngx_http_proxy_process_status_line(ngx_http_request_t *r)
     u->state->status = ctx->status;
 
     u->headers_in.status_line.len = ctx->status_end - ctx->status_start;
-    u->headers_in.status_line.data = ngx_palloc(r->pool,
-                                                u->headers_in.status_line.len);
+    u->headers_in.status_line.data = ngx_pnalloc(r->pool,
+                                                 u->headers_in.status_line.len);
     if (u->headers_in.status_line.data == NULL) {
         return NGX_ERROR;
     }
@@ -1220,7 +1220,7 @@ ngx_http_proxy_process_header(ngx_http_request_t *r)
             h->key.len = r->header_name_end - r->header_name_start;
             h->value.len = r->header_end - r->header_start;
 
-            h->key.data = ngx_palloc(r->pool,
+            h->key.data = ngx_pnalloc(r->pool,
                                h->key.len + 1 + h->value.len + 1 + h->key.len);
             if (h->key.data == NULL) {
                 return NGX_ERROR;
@@ -1400,7 +1400,7 @@ ngx_http_proxy_add_x_forwarded_for_variable(ngx_http_request_t *r,
     v->len = r->headers_in.x_forwarded_for->value.len
              + sizeof(", ") - 1 + r->connection->addr_text.len;
 
-    p = ngx_palloc(r->pool, v->len);
+    p = ngx_pnalloc(r->pool, v->len);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -1435,7 +1435,7 @@ ngx_http_proxy_internal_body_length_variable(ngx_http_request_t *r,
     v->no_cacheable = 0;
     v->not_found = 0;
 
-    v->data = ngx_palloc(r->connection->pool, NGX_SIZE_T_LEN);
+    v->data = ngx_pnalloc(r->connection->pool, NGX_SIZE_T_LEN);
 
     if (v->data == NULL) {
         return NGX_ERROR;
@@ -1492,7 +1492,7 @@ ngx_http_proxy_rewrite_redirect_text(ngx_http_request_t *r, ngx_table_elt_t *h,
 
     len = prefix + pr->replacement.text.len + h->value.len - pr->redirect.len;
 
-    data = ngx_palloc(r->pool, len);
+    data = ngx_pnalloc(r->pool, len);
     if (data == NULL) {
         return NGX_ERROR;
     }
@@ -1544,7 +1544,7 @@ ngx_http_proxy_rewrite_redirect_vars(ngx_http_request_t *r, ngx_table_elt_t *h,
         len += lcode(&e);
     }
 
-    data = ngx_palloc(r->pool, len);
+    data = ngx_pnalloc(r->pool, len);
     if (data == NULL) {
         return NGX_ERROR;
     }
index cf42daf6f48e5bb380dd83ae727679340224594f..e2137f299f4bea32345fc43f60c933e12c23b121 100644 (file)
@@ -307,7 +307,7 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
         content_range->key.len = sizeof("Content-Range") - 1;
         content_range->key.data = (u_char *) "Content-Range";
 
-        content_range->value.data = ngx_palloc(r->pool,
+        content_range->value.data = ngx_pnalloc(r->pool,
                                        sizeof("bytes */") - 1 + NGX_OFF_T_LEN);
         if (content_range->value.data == NULL) {
             return NGX_ERROR;
@@ -341,7 +341,7 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
         content_range->key.data = (u_char *) "Content-Range";
 
         content_range->value.data =
-               ngx_palloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN);
+              ngx_pnalloc(r->pool, sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN);
         if (content_range->value.data == NULL) {
             return NGX_ERROR;
         }
@@ -376,7 +376,7 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
         len += sizeof("; charset=") - 1 + r->headers_out.charset.len;
     }
 
-    ctx->boundary_header.data = ngx_palloc(r->pool, len);
+    ctx->boundary_header.data = ngx_pnalloc(r->pool, len);
     if (ctx->boundary_header.data == NULL) {
         return NGX_ERROR;
     }
@@ -414,9 +414,9 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
     }
 
     r->headers_out.content_type.data =
-        ngx_palloc(r->pool,
-                   sizeof("Content-Type: multipart/byteranges; boundary=") - 1
-                   + NGX_ATOMIC_T_LEN);
+        ngx_pnalloc(r->pool,
+                    sizeof("Content-Type: multipart/byteranges; boundary=") - 1
+                    + NGX_ATOMIC_T_LEN);
 
     if (r->headers_out.content_type.data == NULL) {
         return NGX_ERROR;
@@ -441,7 +441,7 @@ ngx_http_range_header_filter(ngx_http_request_t *r)
         /* the size of the range: "SSSS-EEEE/TTTT" CRLF CRLF */
 
         range[i].content_range.data =
-                                ngx_palloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4);
+                               ngx_pnalloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4);
 
         if (range[i].content_range.data == NULL) {
             return NGX_ERROR;
@@ -649,8 +649,8 @@ ngx_http_range_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
     b->temporary = 1;
     b->last_buf = 1;
 
-    b->pos = ngx_palloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
-                                 + sizeof("--" CRLF) - 1);
+    b->pos = ngx_pnalloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
+                                  + sizeof("--" CRLF) - 1);
     if (b->pos == NULL) {
         return NGX_ERROR;
     }
index 4de4c1317626abd989791a20dc0c34a78d8c7da8..bff83c2274a953c27c97ed9c7f5ad814d0d44f7c 100644 (file)
@@ -163,7 +163,7 @@ ngx_http_realip_handler(ngx_http_request_t *r)
                 return NGX_DECLINED;
             }
 
-            p = ngx_palloc(r->connection->pool, len);
+            p = ngx_pnalloc(r->connection->pool, len);
             if (p == NULL) {
                 return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
index e182619c908026aaf5d3d45408d2f933828d74b0..a855868c4169ba62d97fc84cd67a5d3ed9e08166 100644 (file)
@@ -1151,8 +1151,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
 
             default:
                 ctx->command.len = 1;
-                ctx->command.data = ngx_palloc(r->pool,
-                                               NGX_HTTP_SSI_COMMAND_LEN);
+                ctx->command.data = ngx_pnalloc(r->pool,
+                                                NGX_HTTP_SSI_COMMAND_LEN);
                 if (ctx->command.data == NULL) {
                     return NGX_ERROR;
                 }
@@ -1218,8 +1218,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
                 }
 
                 ctx->param->key.len = 1;
-                ctx->param->key.data = ngx_palloc(r->pool,
-                                                  NGX_HTTP_SSI_PARAM_LEN);
+                ctx->param->key.data = ngx_pnalloc(r->pool,
+                                                   NGX_HTTP_SSI_PARAM_LEN);
                 if (ctx->param->key.data == NULL) {
                     return NGX_ERROR;
                 }
@@ -1229,8 +1229,8 @@ ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
                 ctx->param->value.len = 0;
 
                 if (ctx->value_buf == NULL) {
-                    ctx->param->value.data = ngx_palloc(r->pool,
-                                                        ctx->value_len);
+                    ctx->param->value.data = ngx_pnalloc(r->pool,
+                                                         ctx->value_len);
                     if (ctx->param->value.data == NULL) {
                         return NGX_ERROR;
                     }
@@ -1408,7 +1408,7 @@ ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
         case ssi_postparam_state:
 
             if (ctx->param->value.len + 1 < ctx->value_len / 2) {
-                value = ngx_palloc(r->pool, ctx->param->value.len + 1);
+                value = ngx_pnalloc(r->pool, ctx->param->value.len + 1);
                 if (value == NULL) {
                     return NGX_ERROR;
                 }
@@ -1626,7 +1626,7 @@ ngx_http_ssi_evaluate_string(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
             if (prefix) {
                 len = prefix + text->len;
 
-                data = ngx_palloc(r->pool, len);
+                data = ngx_pnalloc(r->pool, len);
                 if (data == NULL) {
                     return NGX_ERROR;
                 }
@@ -1829,7 +1829,7 @@ ngx_http_ssi_evaluate_string(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
         }
     }
 
-    p = ngx_palloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0));
+    p = ngx_pnalloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0));
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -2222,7 +2222,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
                                  NGX_ESCAPE_HTML);
 
         if (len) {
-            p = ngx_palloc(r->pool, value->len + len);
+            p = ngx_pnalloc(r->pool, value->len + len);
             if (p == NULL) {
                 return NGX_HTTP_SSI_ERROR;
             }
@@ -2239,7 +2239,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
         len = ngx_escape_html(NULL, value->data, value->len);
 
         if (len) {
-            p = ngx_palloc(r->pool, value->len + len);
+            p = ngx_pnalloc(r->pool, value->len + len);
             if (p == NULL) {
                 return NGX_HTTP_SSI_ERROR;
             }
@@ -2286,7 +2286,7 @@ ngx_http_ssi_config(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
 
     if (value) {
         ctx->timefmt.len = value->len;
-        ctx->timefmt.data = ngx_palloc(r->pool, value->len + 1);
+        ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
         if (ctx->timefmt.data == NULL) {
             return NGX_HTTP_SSI_ERROR;
         }
@@ -2666,7 +2666,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
         || (ctx->timefmt.len == sizeof("%s") - 1
             && ctx->timefmt.data[0] == '%' && ctx->timefmt.data[1] == 's'))
     {
-        v->data = ngx_palloc(r->pool, NGX_TIME_T_LEN);
+        v->data = ngx_pnalloc(r->pool, NGX_TIME_T_LEN);
         if (v->data == NULL) {
             return NGX_ERROR;
         }
@@ -2689,7 +2689,7 @@ ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
         return NGX_ERROR;
     }
 
-    v->data = ngx_palloc(r->pool, v->len);
+    v->data = ngx_pnalloc(r->pool, v->len);
     if (v->data == NULL) {
         return NGX_ERROR;
     }
@@ -2738,7 +2738,7 @@ ngx_http_ssi_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
         type->len = value[i].len;
 
-        type->data = ngx_palloc(cf->pool, type->len + 1);
+        type->data = ngx_pnalloc(cf->pool, type->len + 1);
         if (type->data == NULL) {
             return NGX_CONF_ERROR;
         }
index 03d75cd8044921f991265895e8f349622e06a902..fc84268dca1edecb24e0aea0f9f739054858fc8f 100644 (file)
@@ -162,7 +162,7 @@ ngx_http_static_handler(ngx_http_request_t *r)
                 len += r->args.len + 1;
             }
 
-            location = ngx_palloc(r->pool, len);
+            location = ngx_pnalloc(r->pool, len);
             if (location == NULL) {
                 return NGX_HTTP_INTERNAL_SERVER_ERROR;
             }
index 663a9f5b73a8f386132b377356ec41cdd573fef6..6a9bb1c59f101de1fd1880680c24924fbe51a24b 100644 (file)
@@ -710,7 +710,7 @@ ngx_http_sub_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
         type->len = value[i].len;
 
-        type->data = ngx_palloc(cf->pool, type->len + 1);
+        type->data = ngx_pnalloc(cf->pool, type->len + 1);
         if (type->data == NULL) {
             return NGX_CONF_ERROR;
         }
index dee71ff8843b814fb4cb2887a70fa6b6afa9929d..5082c740fb830770e7cc20d7c44afc6b5d54bf4d 100644 (file)
@@ -420,7 +420,7 @@ ngx_http_userid_set_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx,
         len += conf->domain.len;
     }
 
-    cookie = ngx_palloc(r->pool, len);
+    cookie = ngx_pnalloc(r->pool, len);
     if (cookie == NULL) {
         return NGX_ERROR;
     }
@@ -496,7 +496,7 @@ ngx_http_userid_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
     ngx_str_t *name, uint32_t *uid)
 {
     v->len = name->len + sizeof("=00001111222233334444555566667777") - 1;
-    v->data = ngx_palloc(r->pool, v->len);
+    v->data = ngx_pnalloc(r->pool, v->len);
     if (v->data == NULL) {
         return NGX_ERROR;
     }
@@ -620,7 +620,7 @@ ngx_http_userid_domain(ngx_conf_t *cf, void *post, void *data)
         return NGX_CONF_OK;
     }
 
-    new = ngx_palloc(cf->pool, sizeof("; domain=") - 1 + domain->len);
+    new = ngx_pnalloc(cf->pool, sizeof("; domain=") - 1 + domain->len);
     if (new == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -642,7 +642,7 @@ ngx_http_userid_path(ngx_conf_t *cf, void *post, void *data)
 
     u_char  *p, *new;
 
-    new = ngx_palloc(cf->pool, sizeof("; path=") - 1 + path->len);
+    new = ngx_pnalloc(cf->pool, sizeof("; path=") - 1 + path->len);
     if (new == NULL) {
         return NGX_CONF_ERROR;
     }
index 4524a8c40cb350f17581881f233807b3c25339be..94d6a2fddb1afec1ca8b5c1164698de25b2388a8 100644 (file)
@@ -48,7 +48,7 @@ ngx_http_perl_sv2str(pTHX_ ngx_http_request_t *r, ngx_str_t *s, SV *sv)
         return NGX_OK;
     }
 
-    s->data = ngx_palloc(r->pool, len);
+    s->data = ngx_pnalloc(r->pool, len);
     if (s->data == NULL) {
         return NGX_ERROR;
     }
@@ -242,7 +242,7 @@ header_in(r, key)
 
     /* look up hashed headers */
 
-    lowcase_key = ngx_palloc(r->pool, len);
+    lowcase_key = ngx_pnalloc(r->pool, len);
     if (lowcase_key == NULL) {
         XSRETURN_UNDEF;
     }
@@ -293,7 +293,7 @@ header_in(r, key)
             size += ph[i]->value.len + sizeof("; ") - 1;
         }
 
-        cookie = ngx_palloc(r->pool, size);
+        cookie = ngx_pnalloc(r->pool, size);
         if (cookie == NULL) {
             XSRETURN_UNDEF;
         }
@@ -769,7 +769,7 @@ unescape(r, text, type = 0)
 
     src = (u_char *) SvPV(text, len);
 
-    p = ngx_palloc(r->pool, len + 1);
+    p = ngx_pnalloc(r->pool, len + 1);
     if (p == NULL) {
         XSRETURN_UNDEF;
     }
@@ -826,7 +826,7 @@ variable(r, name, value = NULL)
 
     p = (u_char *) SvPV(name, len);
 
-    lowcase = ngx_palloc(r->pool, len);
+    lowcase = ngx_pnalloc(r->pool, len);
     if (lowcase == NULL) {
         XSRETURN_UNDEF;
     }
index ab89cadcf6444bb6dce548c5ee6f3ed3cd91e098..2627942566726df5f8b267d793a29e892468548a 100644 (file)
@@ -703,7 +703,7 @@ ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, HV *nginx, SV *sub,
             line = SvPVx(POPs, n_a);
             rv->len = n_a;
 
-            rv->data = ngx_palloc(r->pool, n_a);
+            rv->data = ngx_pnalloc(r->pool, n_a);
             if (rv->data == NULL) {
                 return NGX_ERROR;
             }
index 91bc3e64fc68dd251a28b85f9bad9e90a2f7d6a6..ed4dacdbed9ae2fa783c25995bde7a9850965faf 100644 (file)
@@ -1024,8 +1024,8 @@ ngx_http_create_locations_tree(ngx_conf_t *cf, ngx_queue_t *locations,
     lq = (ngx_http_location_queue_t *) q;
     len = lq->name->len - prefix;
 
-    node = ngx_palloc_aligned(cf->pool,
-                          offsetof(ngx_http_location_tree_node_t, name) + len);
+    node = ngx_palloc(cf->pool,
+                      offsetof(ngx_http_location_tree_node_t, name) + len);
     if (node == NULL) {
         return NULL;
     }
@@ -1615,7 +1615,7 @@ ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_in_port_t *in_port)
 
         hip->port = in_port->port;
 
-        hip->port_text.data = ngx_palloc(cf->pool, 7);
+        hip->port_text.data = ngx_pnalloc(cf->pool, 7);
         if (hip->port_text.data == NULL) {
             return NGX_ERROR;
         }
index c359363994e2ae0b116bd6a7152b34464a389716..aa557c45065aaea700f824a74ed39c061ef76aaa 100644 (file)
@@ -832,7 +832,7 @@ ngx_http_core_find_config_phase(ngx_http_request_t *r,
 
         } else {
             len = clcf->name.len + 1 + r->args.len;
-            p = ngx_palloc(r->pool, len);
+            p = ngx_pnalloc(r->pool, len);
 
             if (p == NULL) {
                 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
@@ -1267,7 +1267,7 @@ ngx_http_set_content_type(ngx_http_request_t *r)
 
             if (c >= 'A' && c <= 'Z') {
 
-                p = ngx_palloc(r->pool, r->exten.len);
+                p = ngx_pnalloc(r->pool, r->exten.len);
                 if (p == NULL) {
                     return NGX_HTTP_INTERNAL_SERVER_ERROR;
                 }
@@ -1390,7 +1390,7 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
 
         path->len = clcf->root.len + reserved;
 
-        path->data = ngx_palloc(r->pool, path->len);
+        path->data = ngx_pnalloc(r->pool, path->len);
         if (path->data == NULL) {
             return NULL;
         }
@@ -1460,7 +1460,7 @@ ngx_http_auth_basic_user(ngx_http_request_t *r)
     }
 
     auth.len = ngx_base64_decoded_length(encoded.len);
-    auth.data = ngx_palloc(r->pool, auth.len + 1);
+    auth.data = ngx_pnalloc(r->pool, auth.len + 1);
     if (auth.data == NULL) {
         return NGX_ERROR;
     }
index 9ea987fb8c2baad0cb67f6dff0fe95ab519969d3..a42d1e23bf9ea2c2bea79a622462a6fe466a9c9a 100644 (file)
@@ -654,7 +654,7 @@ ngx_http_process_request_line(ngx_event_t *rev)
 
             if (r->complex_uri || r->quoted_uri) {
 
-                r->uri.data = ngx_palloc(r->pool, r->uri.len + 1);
+                r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1);
                 if (r->uri.data == NULL) {
                     ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
                     return;
@@ -914,7 +914,7 @@ ngx_http_process_request_headers(ngx_event_t *rev)
             h->value.data = r->header_start;
             h->value.data[h->value.len] = '\0';
 
-            h->lowcase_key = ngx_palloc(r->pool, h->key.len);
+            h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
             if (h->lowcase_key == NULL) {
                 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
                 return;
@@ -1562,7 +1562,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
         server = buf;
 
     } else {
-        server = ngx_palloc(r->pool, len);
+        server = ngx_pnalloc(r->pool, len);
         if (server == NULL) {
             return NGX_ERROR;
         }
index acd867fdbee56e54fb10fe1dfb8ab7db0ffdbd7b..0bdb944a98c2498d1f12f6da02ed68645f369246 100644 (file)
@@ -341,7 +341,7 @@ ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
 
 
     value->len = len;
-    value->data = ngx_palloc(r->pool, len);
+    value->data = ngx_pnalloc(r->pool, len);
     if (value->data == NULL) {
         return NULL;
     }
@@ -733,7 +733,7 @@ ngx_http_script_regex_start_code(ngx_http_script_engine_t *e)
         e->buf.len += r->args.len + 1;
     }
 
-    e->buf.data = ngx_palloc(r->pool, e->buf.len);
+    e->buf.data = ngx_pnalloc(r->pool, e->buf.len);
     if (e->buf.data == NULL) {
         e->ip = ngx_http_script_exit;
         e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -1120,7 +1120,7 @@ ngx_http_script_complex_value_code(ngx_http_script_engine_t *e)
     }
 
     e->buf.len = len;
-    e->buf.data = ngx_palloc(e->request->pool, len);
+    e->buf.data = ngx_pnalloc(e->request->pool, len);
     if (e->buf.data == NULL) {
         e->ip = ngx_http_script_exit;
         e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
index 9ec861cfa232f8415203c9be148feff37b77642e..27f27ae7ef34aba2e519b39777901f99f92cc437 100644 (file)
@@ -2817,7 +2817,7 @@ ngx_http_upstream_addr_variable(ngx_http_request_t *r,
         }
     }
 
-    p = ngx_palloc(r->pool, len);
+    p = ngx_pnalloc(r->pool, len);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -2878,7 +2878,7 @@ ngx_http_upstream_status_variable(ngx_http_request_t *r,
 
     len = r->upstream_states->nelts * (3 + 2);
 
-    p = ngx_palloc(r->pool, len);
+    p = ngx_pnalloc(r->pool, len);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -2944,7 +2944,7 @@ ngx_http_upstream_response_time_variable(ngx_http_request_t *r,
 
     len = r->upstream_states->nelts * (NGX_TIME_T_LEN + 4 + 2);
 
-    p = ngx_palloc(r->pool, len);
+    p = ngx_pnalloc(r->pool, len);
     if (p == NULL) {
         return NGX_ERROR;
     }
index 0621371580bee966a2f3db61b3509b69440bb8e5..e36e68529fd7021fc827efb1130d03a6da56b8c2 100644 (file)
@@ -283,7 +283,7 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
 
         len = INET_ADDRSTRLEN - 1 + 1 + sizeof(":65536") - 1;
 
-        p = ngx_palloc(r->pool, len);
+        p = ngx_pnalloc(r->pool, len);
         if (p == NULL) {
             return NGX_ERROR;
         }
index 16f09230531ba427958edc344c4c2754c71c63fb..e014170a07533fb0c0714abdb5b506fad0ccff97 100644 (file)
@@ -272,7 +272,7 @@ ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
     }
 
     v->name.len = name->len;
-    v->name.data = ngx_palloc(cf->pool, name->len);
+    v->name.data = ngx_pnalloc(cf->pool, name->len);
     if (v->name.data == NULL) {
         return NULL;
     }
@@ -339,7 +339,7 @@ ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)
     }
 
     v->name.len = name->len;
-    v->name.data = ngx_palloc(cf->pool, name->len);
+    v->name.data = ngx_pnalloc(cf->pool, name->len);
     if (v->name.data == NULL) {
         return NGX_ERROR;
     }
@@ -615,7 +615,7 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
         len += h[i]->value.len + sizeof("; ") - 1;
     }
 
-    p = ngx_palloc(r->pool, len);
+    p = ngx_pnalloc(r->pool, len);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -782,7 +782,7 @@ ngx_http_variable_remote_port(ngx_http_request_t *r,
     v->no_cacheable = 0;
     v->not_found = 0;
 
-    v->data = ngx_palloc(r->pool, sizeof("65535") - 1);
+    v->data = ngx_pnalloc(r->pool, sizeof("65535") - 1);
     if (v->data == NULL) {
         return NGX_ERROR;
     }
@@ -809,7 +809,7 @@ ngx_http_variable_server_addr(ngx_http_request_t *r,
 {
     ngx_str_t  s;
 
-    s.data = ngx_palloc(r->pool, INET_ADDRSTRLEN);
+    s.data = ngx_pnalloc(r->pool, INET_ADDRSTRLEN);
     if (s.data == NULL) {
         return NGX_ERROR;
     }
@@ -1032,7 +1032,7 @@ ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
         sent = 0;
     }
 
-    p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
+    p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -1083,7 +1083,7 @@ ngx_http_variable_sent_content_length(ngx_http_request_t *r,
     }
 
     if (r->headers_out.content_length_n >= 0) {
-        p = ngx_palloc(r->pool, NGX_OFF_T_LEN);
+        p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
         if (p == NULL) {
             return NGX_ERROR;
         }
@@ -1120,7 +1120,7 @@ ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
     }
 
     if (r->headers_out.last_modified_time >= 0) {
-        p = ngx_palloc(r->pool,
+        p = ngx_pnalloc(r->pool,
                    sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT") - 1);
         if (p == NULL) {
             return NGX_ERROR;
@@ -1179,7 +1179,7 @@ ngx_http_variable_sent_keep_alive(ngx_http_request_t *r,
 
         if (clcf->keepalive_header) {
 
-            p = ngx_palloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN);
+            p = ngx_pnalloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN);
             if (p == NULL) {
                 return NGX_ERROR;
             }
index 00c2550404ff1b4f21d511f1e15460c4970829ac..edfa245ee42fe3ebdbc9c52ff9380eb00f2b8d2c 100644 (file)
@@ -357,8 +357,8 @@ ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
                 imip->addrs[i].addr = in_addr[i].addr;
                 imip->addrs[i].ctx = in_addr[i].ctx;
 
-                text = ngx_palloc(cf->pool,
-                                  INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
+                text = ngx_pnalloc(cf->pool,
+                                   INET_ADDRSTRLEN - 1 + sizeof(":65535") - 1);
                 if (text == NULL) {
                     return NGX_CONF_ERROR;
                 }
index 17e7861c06ba29a5c736db8ccb68a54fe1539f5e..876ac404eb71065921a4cba6c6850ac85cdec33e 100644 (file)
@@ -593,7 +593,7 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
             {
                 s->login.len = ctx->header_end - ctx->header_start;
 
-                s->login.data = ngx_palloc(s->connection->pool, s->login.len);
+                s->login.data = ngx_pnalloc(s->connection->pool, s->login.len);
                 if (s->login.data == NULL) {
                     ngx_close_connection(ctx->peer.connection);
                     ngx_destroy_pool(ctx->pool);
@@ -614,7 +614,8 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
             {
                 s->passwd.len = ctx->header_end - ctx->header_start;
 
-                s->passwd.data = ngx_palloc(s->connection->pool, s->passwd.len);
+                s->passwd.data = ngx_pnalloc(s->connection->pool,
+                                             s->passwd.len);
                 if (s->passwd.data == NULL) {
                     ngx_close_connection(ctx->peer.connection);
                     ngx_destroy_pool(ctx->pool);
@@ -651,8 +652,8 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
             {
                 ctx->errcode.len = ctx->header_end - ctx->header_start;
 
-                ctx->errcode.data = ngx_palloc(s->connection->pool,
-                                               ctx->errcode.len);
+                ctx->errcode.data = ngx_pnalloc(s->connection->pool,
+                                                ctx->errcode.len);
                 if (ctx->errcode.data == NULL) {
                     ngx_close_connection(ctx->peer.connection);
                     ngx_destroy_pool(ctx->pool);
@@ -691,7 +692,7 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
                     ctx->err.len = ctx->errcode.len + ctx->errmsg.len
                                    + sizeof(" " CRLF) - 1;
 
-                    p = ngx_palloc(s->connection->pool, ctx->err.len);
+                    p = ngx_pnalloc(s->connection->pool, ctx->err.len);
                     if (p == NULL) {
                         ngx_close_connection(ctx->peer.connection);
                         ngx_destroy_pool(ctx->pool);
@@ -810,7 +811,7 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
 
             peer->name.len = len;
 
-            peer->name.data = ngx_palloc(s->connection->pool, len);
+            peer->name.data = ngx_pnalloc(s->connection->pool, len);
             if (peer->name.data == NULL) {
                 ngx_destroy_pool(ctx->pool);
                 ngx_mail_session_internal_server_error(s);
@@ -1255,7 +1256,7 @@ ngx_mail_auth_http_escape(ngx_pool_t *pool, ngx_str_t *text, ngx_str_t *escaped)
 
     escaped->len = text->len + n * 2;
 
-    p = ngx_palloc(pool, escaped->len);
+    p = ngx_pnalloc(pool, escaped->len);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -1326,7 +1327,7 @@ ngx_mail_auth_http_merge_conf(ngx_conf_t *cf, void *parent, void *child)
             len += header[i].key.len + 2 + header[i].value.len + 2;
         }
 
-        p = ngx_palloc(cf->pool, len);
+        p = ngx_pnalloc(cf->pool, len);
         if (p == NULL) {
             return NGX_CONF_ERROR;
         }
index 0cb67a237c8ac0a1746a22055fe1bfc60623384b..2dc5d7a311dea32531447ffb98ac56060cd060e9 100644 (file)
@@ -236,10 +236,10 @@ ngx_int_t
 ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
     ngx_mail_core_srv_conf_t *cscf)
 {
-    s->salt.data = ngx_palloc(c->pool,
-                              sizeof(" <18446744073709551616.@>" CRLF) - 1
-                              + NGX_TIME_T_LEN
-                              + cscf->server_name.len);
+    s->salt.data = ngx_pnalloc(c->pool,
+                               sizeof(" <18446744073709551616.@>" CRLF) - 1
+                               + NGX_TIME_T_LEN
+                               + cscf->server_name.len);
     if (s->salt.data == NULL) {
         return NGX_ERROR;
     }
@@ -288,7 +288,7 @@ ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, ngx_uint_t n)
                    "mail auth plain: \"%V\"", &arg[n]);
 #endif
 
-    plain.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[n].len));
+    plain.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len));
     if (plain.data == NULL){
         return NGX_ERROR;
     }
@@ -344,7 +344,7 @@ ngx_mail_auth_login_username(ngx_mail_session_t *s, ngx_connection_t *c)
     ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
                    "mail auth login username: \"%V\"", &arg[0]);
 
-    s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+    s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len));
     if (s->login.data == NULL){
         return NGX_ERROR;
     }
@@ -374,7 +374,8 @@ ngx_mail_auth_login_password(ngx_mail_session_t *s, ngx_connection_t *c)
                    "mail auth login password: \"%V\"", &arg[0]);
 #endif
 
-    s->passwd.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+    s->passwd.data = ngx_pnalloc(c->pool,
+                                 ngx_base64_decoded_length(arg[0].len));
     if (s->passwd.data == NULL){
         return NGX_ERROR;
     }
@@ -402,7 +403,7 @@ ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, ngx_connection_t *c,
     ngx_str_t    salt;
     ngx_uint_t   n;
 
-    p = ngx_palloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2);
+    p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2);
     if (p == NULL) {
         return NGX_ERROR;
     }
@@ -434,7 +435,7 @@ ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c)
     ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
                    "mail auth cram-md5: \"%V\"", &arg[0]);
 
-    s->login.data = ngx_palloc(c->pool, ngx_base64_decoded_length(arg[0].len));
+    s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len));
     if (s->login.data == NULL){
         return NGX_ERROR;
     }
index 62ba17da846535a2e1d20b17dd3f7b0a937e0d1e..f8ca4f689e03c41d9bbd36bc0977b62bf5a23a45 100644 (file)
@@ -259,7 +259,7 @@ ngx_mail_imap_auth_state(ngx_event_t *rev)
 
         if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) {
             s->tagged_line.len = s->tag.len + s->text.len + s->out.len;
-            s->tagged_line.data = ngx_palloc(c->pool, s->tagged_line.len);
+            s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len);
             if (s->tagged_line.data == NULL) {
                 ngx_mail_close_connection(c);
                 return;
@@ -317,7 +317,7 @@ ngx_mail_imap_login(ngx_mail_session_t *s, ngx_connection_t *c)
     }
 
     s->login.len = arg[0].len;
-    s->login.data = ngx_palloc(c->pool, s->login.len);
+    s->login.data = ngx_pnalloc(c->pool, s->login.len);
     if (s->login.data == NULL) {
         return NGX_ERROR;
     }
@@ -325,7 +325,7 @@ ngx_mail_imap_login(ngx_mail_session_t *s, ngx_connection_t *c)
     ngx_memcpy(s->login.data, arg[0].data, s->login.len);
 
     s->passwd.len = arg[1].len;
-    s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+    s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
     if (s->passwd.data == NULL) {
         return NGX_ERROR;
     }
index 3889c9248d8ff187c81a535f0f8bdf95a9bc4e13..2d72397eba6cfccb21cf6d85e856dc0e7926e3fa 100644 (file)
@@ -183,7 +183,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         }
     }
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -216,7 +216,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     size += sizeof(" STARTTLS") - 1;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -233,7 +233,7 @@ ngx_mail_imap_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     size = (auth - conf->capability.data) + sizeof(CRLF) - 1
             + sizeof(" STARTTLS LOGINDISABLED") - 1;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
index c486fbebd5556ca1a16b867e8c9487a4da838930..51763613d2e7df5de4e9fc196e00407aeec2232e 100644 (file)
@@ -46,7 +46,7 @@ ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c)
             return;
         }
 
-        s->out.data = ngx_palloc(c->pool, sizeof(pop3_greeting) + s->salt.len);
+        s->out.data = ngx_pnalloc(c->pool, sizeof(pop3_greeting) + s->salt.len);
         if (s->out.data == NULL) {
             ngx_mail_session_internal_server_error(s);
             return;
@@ -297,7 +297,7 @@ ngx_mail_pop3_user(ngx_mail_session_t *s, ngx_connection_t *c)
 
     arg = s->args.elts;
     s->login.len = arg[0].len;
-    s->login.data = ngx_palloc(c->pool, s->login.len);
+    s->login.data = ngx_pnalloc(c->pool, s->login.len);
     if (s->login.data == NULL) {
         return NGX_ERROR;
     }
@@ -324,7 +324,7 @@ ngx_mail_pop3_pass(ngx_mail_session_t *s, ngx_connection_t *c)
 
     arg = s->args.elts;
     s->passwd.len = arg[0].len;
-    s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+    s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
     if (s->passwd.data == NULL) {
         return NGX_ERROR;
     }
@@ -417,7 +417,7 @@ ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c)
     arg = s->args.elts;
 
     s->login.len = arg[0].len;
-    s->login.data = ngx_palloc(c->pool, s->login.len);
+    s->login.data = ngx_pnalloc(c->pool, s->login.len);
     if (s->login.data == NULL) {
         return NGX_ERROR;
     }
@@ -425,7 +425,7 @@ ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c)
     ngx_memcpy(s->login.data, arg[0].data, s->login.len);
 
     s->passwd.len = arg[1].len;
-    s->passwd.data = ngx_palloc(c->pool, s->passwd.len);
+    s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
     if (s->passwd.data == NULL) {
         return NGX_ERROR;
     }
index 6f726554a43297af2d8947cc0d585437700dc96f..648c57ce81a75dc9fcb869c1f5f5b5a322f6a4a9 100644 (file)
@@ -183,7 +183,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         size += sizeof("SASL LOGIN PLAIN" CRLF) - 1;
     }
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -213,7 +213,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     size += sizeof("STLS" CRLF) - 1;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -236,7 +236,7 @@ ngx_mail_pop3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     }
 
 
-    p = ngx_palloc(cf->pool, stls_only_size);
+    p = ngx_pnalloc(cf->pool, stls_only_size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
index 3cac329b72c1d55f0f58685a6c3feac25720b75d..f8757beb770a38510547a33fa2781b89b87b10cb 100644 (file)
@@ -253,7 +253,7 @@ ngx_mail_proxy_pop3_handler(ngx_event_t *rev)
         s->connection->log->action = "sending user name to upstream";
 
         line.len = sizeof("USER ")  - 1 + s->login.len + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -272,7 +272,7 @@ ngx_mail_proxy_pop3_handler(ngx_event_t *rev)
         s->connection->log->action = "sending password to upstream";
 
         line.len = sizeof("PASS ")  - 1 + s->passwd.len + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -369,7 +369,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t *rev)
 
         line.len = s->tag.len + sizeof("LOGIN ") - 1
                    + 1 + NGX_SIZE_T_LEN + 1 + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -388,7 +388,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t *rev)
         s->connection->log->action = "sending user name to upstream";
 
         line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -408,7 +408,7 @@ ngx_mail_proxy_imap_handler(ngx_event_t *rev)
         s->connection->log->action = "sending password to upstream";
 
         line.len = s->passwd.len + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -505,7 +505,7 @@ ngx_mail_proxy_smtp_handler(ngx_event_t *rev)
         cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
 
         line.len = sizeof("HELO ")  - 1 + cscf->server_name.len + 2;
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
@@ -535,7 +535,7 @@ ngx_mail_proxy_smtp_handler(ngx_event_t *rev)
                    + s->esmtp + s->smtp_helo.len
                    + s->connection->addr_text.len + s->login.len + s->host.len;
 
-        line.data = ngx_palloc(c->pool, line.len);
+        line.data = ngx_pnalloc(c->pool, line.len);
         if (line.data == NULL) {
             ngx_mail_proxy_internal_server_error(s);
             return;
index 6e944738f97b8f09c6cf6d84b8b476ed3d66b47f..722354aa92ce546a9b55f26547caa3c75d7b63a1 100644 (file)
@@ -506,7 +506,7 @@ ngx_mail_smtp_helo(ngx_mail_session_t *s, ngx_connection_t *c)
 
     s->smtp_helo.len = arg[0].len;
 
-    s->smtp_helo.data = ngx_palloc(c->pool, arg[0].len);
+    s->smtp_helo.data = ngx_pnalloc(c->pool, arg[0].len);
     if (s->smtp_helo.data == NULL) {
         return NGX_ERROR;
     }
index 5f5ac0567ef28d4004fb1d20ae99353d484af4e8..92e9b06de183d6da697536b75baed873e2403a60 100644 (file)
@@ -160,7 +160,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     size = sizeof("220  ESMTP ready" CRLF) - 1 + cscf->server_name.len;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -175,7 +175,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     size = sizeof("250 " CRLF) - 1 + cscf->server_name.len;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -209,7 +209,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         }
     }
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -247,7 +247,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
 
     size += sizeof("250 STARTTLS" CRLF) - 1;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
@@ -268,7 +268,7 @@ ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     size = (auth - conf->capability.data)
             + sizeof("250 STARTTLS" CRLF) - 1;
 
-    p = ngx_palloc(cf->pool, size);
+    p = ngx_pnalloc(cf->pool, size);
     if (p == NULL) {
         return NGX_CONF_ERROR;
     }
index 789274337761f210468f8dcbcaa9394326f180f1..6b9d7b019f0e61db615d353d9a84612f186bd31c 100644 (file)
@@ -129,7 +129,7 @@ ngx_http_mysql_auth(ngx_mysql_t *m)
 
     m->query.len = NGX_MYSQL_CMDPKT_LEN + ngx_mysql_command_query.len;
 
-    m->query.data = ngx_palloc(r->pool, m->query.len);
+    m->query.data = ngx_pnalloc(r->pool, m->query.len);
     if (m->query.data == NULL) {
         ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
         return;
index fd98f2b308a98ac85732fad260569f81e5deb280..eedf6773b6c0e22c296567aad985164af903753a 100644 (file)
@@ -215,7 +215,7 @@ ngx_mysql_read_server_greeting(ngx_event_t *rev)
         len += 20;
     }
 
-    auth = ngx_palloc(m->pool, len);
+    auth = ngx_pnalloc(m->pool, len);
     if (auth == NULL) {
         ngx_mysql_close(m, NGX_ERROR);
         return;
index bacba594512efc8827f091079dd747d32d561881..54ca4ffa39f833b24760ac8bf01b1dc96c2f5656 100644 (file)
@@ -108,7 +108,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
         size += ngx_strlen(ngx_argv[i]) + 1;
     }
 
-    title = ngx_palloc(cycle->pool, size);
+    title = ngx_pnalloc(cycle->pool, size);
 
     p = ngx_cpymem(title, master_process, sizeof(master_process) - 1);
     for (i = 0; i < ngx_argc; i++) {
index b40a2b7211195aad9329bc022cb407124ac39e3c..4bad1c3070e517fadb53007be7f90acb576fba4f 100644 (file)
@@ -43,7 +43,7 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
     if (err == 0) {
         len = ngx_strlen(value);
 
-        *encrypted = ngx_palloc(pool, len);
+        *encrypted = ngx_pnalloc(pool, len);
         if (*encrypted) {
             ngx_memcpy(*encrypted, value, len + 1);
             return NGX_OK;
@@ -81,7 +81,7 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
     if (value) {
         len = ngx_strlen(value);
 
-        *encrypted = ngx_palloc(pool, len);
+        *encrypted = ngx_pnalloc(pool, len);
         if (*encrypted) {
             ngx_memcpy(*encrypted, value, len + 1);
         }