comparison src/http/ngx_http_write_filter_module.c @ 1197:493a227edfd5

sendfile_max_chunk
author Igor Sysoev <igor@sysoev.ru>
date Mon, 07 May 2007 06:33:39 +0000
parents 8ea6caa62c89
children e67ef50c3176 0bd321c8ce67
comparison
equal deleted inserted replaced
1196:67077918b965 1197:493a227edfd5
220 c->buffered |= NGX_HTTP_WRITE_BUFFERED; 220 c->buffered |= NGX_HTTP_WRITE_BUFFERED;
221 221
222 return NGX_AGAIN; 222 return NGX_AGAIN;
223 } 223 }
224 224
225 } else if (clcf->sendfile_max_chunk) {
226 limit = clcf->sendfile_max_chunk;
227
225 } else { 228 } else {
226 limit = 0; 229 limit = 0;
227 } 230 }
228 231
229 sent = c->sent; 232 sent = c->sent;
239 if (chain == NGX_CHAIN_ERROR) { 242 if (chain == NGX_CHAIN_ERROR) {
240 c->error = 1; 243 c->error = 1;
241 return NGX_ERROR; 244 return NGX_ERROR;
242 } 245 }
243 246
244 if (limit) { 247 if (r->limit_rate) {
245 sent = c->sent - sent; 248 sent = c->sent - sent;
246 c->write->delayed = 1; 249 c->write->delayed = 1;
247 ngx_add_timer(c->write, (ngx_msec_t) (sent * 1000 / r->limit_rate + 1)); 250 ngx_add_timer(c->write, (ngx_msec_t) (sent * 1000 / r->limit_rate + 1));
251
252 } else if (c->write->ready && clcf->sendfile_max_chunk) {
253 c->write->delayed = 1;
254 ngx_add_timer(c->write, 1);
248 } 255 }
249 256
250 for (cl = r->out; cl && cl != chain; /* void */) { 257 for (cl = r->out; cl && cl != chain; /* void */) {
251 ln = cl; 258 ln = cl;
252 cl = cl->next; 259 cl = cl->next;