diff src/os/unix/ngx_writev_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 6f8b0dc0f8dd
line wrap: on
line diff
--- a/src/os/unix/ngx_writev_chain.c
+++ b/src/os/unix/ngx_writev_chain.c
@@ -9,14 +9,14 @@
 #include <ngx_event.h>
 
 
-#define NGX_IOVS  8
+#define NGX_IOVS  16
 
 
 ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
 {
     u_char        *prev;
-    ssize_t        n, size;
-    off_t          send, sprev, sent;
+    ssize_t        n, size, sent;
+    off_t          send, sprev;
     ngx_uint_t     eintr, complete;
     ngx_err_t      err;
     ngx_array_t    vec;
@@ -66,6 +66,12 @@ ngx_chain_t *ngx_writev_chain(ngx_connec
                 continue;
             }
 
+#if 1
+            if (!ngx_buf_in_memory(cl->buf)) {
+                ngx_debug_point();
+            }
+#endif
+
             size = cl->buf->last - cl->buf->pos;
 
             if (send + size > limit) {
@@ -110,8 +116,7 @@ ngx_chain_t *ngx_writev_chain(ngx_connec
 
         sent = n > 0 ? n : 0;
 
-        ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
-                       "writev: " OFF_T_FMT, sent);
+        ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
 
         if (send - sprev == sent) {
             complete = 1;
@@ -119,7 +124,8 @@ ngx_chain_t *ngx_writev_chain(ngx_connec
 
         c->sent += sent;
 
-        for (cl = in; cl && sent > 0; cl = cl->next) {
+        for (cl = in; cl; cl = cl->next) {
+
             if (ngx_buf_special(cl->buf)) {
                 continue;
             }