Mercurial > hg > nginx
comparison src/http/ngx_http_event.c @ 9:6f58641241bb
nginx-0.0.1-2002-09-07-14:14:25 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 07 Sep 2002 10:14:25 +0000 |
parents | 708f8bb772ec |
children | 4f3879d9b6f6 |
comparison
equal
deleted
inserted
replaced
8:708f8bb772ec | 9:6f58641241bb |
---|---|
359 } | 359 } |
360 | 360 |
361 static int ngx_http_handler(ngx_http_request_t *r) | 361 static int ngx_http_handler(ngx_http_request_t *r) |
362 { | 362 { |
363 int rc; | 363 int rc; |
364 ngx_msec_t timeout; | |
364 | 365 |
365 ngx_del_timer(r->connection->read); | 366 ngx_del_timer(r->connection->read); |
366 r->header_timeout = 1; | 367 r->header_timeout = 1; |
367 | 368 |
368 r->process_header = 0; | 369 r->process_header = 0; |
391 #endif | 392 #endif |
392 /* log http request */ | 393 /* log http request */ |
393 return ngx_http_close_request(r); | 394 return ngx_http_close_request(r); |
394 } | 395 } |
395 | 396 |
396 ngx_add_timer(r->connection->write, 5000); | 397 if (r->connection->sent > 0) { |
398 ngx_log_debug(r->connection->log, "sent: " QD_FMT _ | |
399 r->connection->sent); | |
400 timeout = (ngx_msec_t) (r->connection->sent * 10); | |
401 ngx_log_debug(r->connection->log, "timeout: %d" _ timeout); | |
402 ngx_add_timer(r->connection->write, timeout); | |
403 | |
404 } else { | |
405 ngx_add_timer(r->connection->write, 10000); | |
406 } | |
397 | 407 |
398 r->connection->write->event_handler = ngx_http_writer; | 408 r->connection->write->event_handler = ngx_http_writer; |
399 return rc; | 409 return rc; |
400 } | 410 } |
401 | 411 |
486 ngx_http_request_t *r; | 496 ngx_http_request_t *r; |
487 | 497 |
488 c = (ngx_connection_t *) ev->data; | 498 c = (ngx_connection_t *) ev->data; |
489 r = (ngx_http_request_t *) c->data; | 499 r = (ngx_http_request_t *) c->data; |
490 | 500 |
501 c->sent = 0; | |
502 | |
491 rc = ngx_http_output_filter(r, NULL); | 503 rc = ngx_http_output_filter(r, NULL); |
492 | 504 |
493 ngx_log_debug(ev->log, "output_filter: %d" _ rc); | 505 ngx_log_debug(ev->log, "output_filter: %d" _ rc); |
494 | 506 |
495 if (rc == NGX_AGAIN) { | 507 if (rc == NGX_AGAIN) { |