diff src/core/ngx_buf.c @ 56:3050baa54a26 NGINX_0_1_28

nginx 0.1.28 *) Bugfix: nginx hogs CPU while proxying the huge files. *) Bugfix: nginx could not be built by gcc 4.0 on Linux.
author Igor Sysoev <http://sysoev.ru>
date Fri, 08 Apr 2005 00:00:00 +0400
parents 72eb30262aac
children b55cbf18157e
line wrap: on
line diff
--- a/src/core/ngx_buf.c
+++ b/src/core/ngx_buf.c
@@ -44,6 +44,27 @@ ngx_create_temp_buf(ngx_pool_t *pool, si
 
 
 ngx_chain_t *
+ngx_alloc_chain_link(ngx_pool_t *pool)
+{
+    ngx_chain_t  *cl;
+
+    cl = pool->chain;
+
+    if (cl) {
+        pool->chain = cl->next;
+        return cl;
+    }
+
+    cl = ngx_palloc(pool, sizeof(ngx_chain_t));
+    if (cl == NULL) {
+        return NULL;
+    }
+
+    return cl;
+}
+
+
+ngx_chain_t *
 ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs)
 {
     u_char       *p;