comparison src/http/ngx_http_write_filter.c @ 32:da8c190bdaba NGINX_0_1_16

nginx 0.1.16 *) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; bug appeared in 0.1.14.
author Igor Sysoev <http://sysoev.ru>
date Tue, 25 Jan 2005 00:00:00 +0300
parents 7ca9bdc82b3f
children 2879cd3a40cb
comparison
equal deleted inserted replaced
31:1b17dd824438 32:da8c190bdaba
79 cl->buf->file_last - cl->buf->file_pos); 79 cl->buf->file_last - cl->buf->file_pos);
80 80
81 #if 1 81 #if 1
82 if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) { 82 if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
83 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, 83 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
84 "zero size buf in writer"); 84 "zero size buf in writer "
85 "t:%d r:%d f:%d %p %p-%p %p %O-%O",
86 cl->buf->temporary,
87 cl->buf->recycled,
88 cl->buf->in_file,
89 cl->buf->start,
90 cl->buf->pos,
91 cl->buf->last,
92 cl->buf->file,
93 cl->buf->file_pos,
94 cl->buf->file_last);
95
85 ngx_debug_point(); 96 ngx_debug_point();
86 } 97 }
87 #endif 98 #endif
88 99
89 size += ngx_buf_size(cl->buf); 100 size += ngx_buf_size(cl->buf);
118 cl->buf->file_last - cl->buf->file_pos); 129 cl->buf->file_last - cl->buf->file_pos);
119 130
120 #if 1 131 #if 1
121 if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) { 132 if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
122 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, 133 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
123 "zero size buf in writer"); 134 "zero size buf in writer "
135 "t:%d r:%d f:%d %p %p-%p %p %O-%O",
136 cl->buf->temporary,
137 cl->buf->recycled,
138 cl->buf->in_file,
139 cl->buf->start,
140 cl->buf->pos,
141 cl->buf->last,
142 cl->buf->file,
143 cl->buf->file_pos,
144 cl->buf->file_last);
145
124 ngx_debug_point(); 146 ngx_debug_point();
125 } 147 }
126 #endif 148 #endif
127 149
128 size += ngx_buf_size(cl->buf); 150 size += ngx_buf_size(cl->buf);
159 if (c->write->delayed) { 181 if (c->write->delayed) {
160 return NGX_AGAIN; 182 return NGX_AGAIN;
161 } 183 }
162 184
163 if (size == 0 && !c->buffered) { 185 if (size == 0 && !c->buffered) {
164 if (!last) { 186 if (last) {
165 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, 187 return NGX_OK;
166 "the http output chain is empty"); 188 }
167 189
168 ngx_debug_point(); 190 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
169 191 "the http output chain is empty");
170 return NGX_ERROR; 192
171 } 193 ngx_debug_point();
172 return NGX_OK; 194
195 return NGX_ERROR;
173 } 196 }
174 197
175 sent = c->sent; 198 sent = c->sent;
176 199
177 chain = c->send_chain(c, ctx->out, clcf->limit_rate); 200 chain = c->send_chain(c, ctx->out, clcf->limit_rate);
190 return NGX_ERROR; 213 return NGX_ERROR;
191 } 214 }
192 215
193 ctx->out = chain; 216 ctx->out = chain;
194 217
195 if (chain || c->buffered) { 218 if (chain || (last && c->buffered)) {
196 return NGX_AGAIN; 219 return NGX_AGAIN;
197 } 220 }
198 221
199 return NGX_OK; 222 return NGX_OK;
200 } 223 }