diff src/core/ngx_output_chain.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents 4b2dafa26fe2
children 74b1868dd3cd
line wrap: on
line diff
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -162,7 +162,11 @@ ngx_int_t ngx_output_chain(ngx_output_ch
                 ctx->in = ctx->in->next;
             }
 
-            ngx_alloc_link_and_set_buf(cl, ctx->buf, ctx->pool, NGX_ERROR);
+            if (!(cl = ngx_alloc_chain_link(ctx->pool))) {
+                return NGX_ERROR;
+            }
+            cl->buf = ctx->buf;
+            cl->next = NULL;
             *last_out = cl;
             last_out = &cl->next;
             ctx->buf = NULL;
@@ -266,7 +270,7 @@ static ngx_int_t ngx_output_chain_copy_b
 
         if ((size_t) n != size) {
             ngx_log_error(NGX_LOG_ALERT, src->file->log, 0,
-                          ngx_read_file_n " reads only %d of %d from file",
+                          ngx_read_file_n " reads only %z of %uz from file",
                           n, size);
             if (n == 0) {
                 return NGX_ERROR;
@@ -306,20 +310,24 @@ ngx_int_t ngx_chain_writer(void *data, n
     for (/* void */; in; in = in->next) {
 
         ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->connection->log, 0,
-                       "WRITER buf: %d", ngx_buf_size(in->buf));
+                       "chain writer buf size: %uz", ngx_buf_size(in->buf));
 
-        ngx_alloc_link_and_set_buf(cl, in->buf, ctx->pool, NGX_ERROR);
+        if (!(cl = ngx_alloc_chain_link(ctx->pool))) {
+            return NGX_ERROR;
+        }
+        cl->buf = in->buf;
+        cl->next = NULL;
         *ctx->last = cl;
         ctx->last = &cl->next;
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->connection->log, 0,
-                   "WRITER0: %X", ctx->out);
+                   "chain writer in: %p", ctx->out);
 
     ctx->out = ngx_send_chain(ctx->connection, ctx->out, ctx->limit);
 
     ngx_log_debug1(NGX_LOG_DEBUG_CORE, ctx->connection->log, 0,
-                   "WRITER1: %X", ctx->out);
+                   "chain writer out: %p", ctx->out);
 
     if (ctx->out == NGX_CHAIN_ERROR) {
         return NGX_ERROR;