nginx-0.0.1-2002-09-07-14:14:25 import
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c
index 7783462..ec3b209 100644
--- a/src/http/ngx_http_event.c
+++ b/src/http/ngx_http_event.c
@@ -361,6 +361,7 @@
static int ngx_http_handler(ngx_http_request_t *r)
{
int rc;
+ ngx_msec_t timeout;
ngx_del_timer(r->connection->read);
r->header_timeout = 1;
@@ -393,7 +394,16 @@
return ngx_http_close_request(r);
}
- ngx_add_timer(r->connection->write, 5000);
+ if (r->connection->sent > 0) {
+ ngx_log_debug(r->connection->log, "sent: " QD_FMT _
+ r->connection->sent);
+ timeout = (ngx_msec_t) (r->connection->sent * 10);
+ ngx_log_debug(r->connection->log, "timeout: %d" _ timeout);
+ ngx_add_timer(r->connection->write, timeout);
+
+ } else {
+ ngx_add_timer(r->connection->write, 10000);
+ }
r->connection->write->event_handler = ngx_http_writer;
return rc;
@@ -488,6 +498,8 @@
c = (ngx_connection_t *) ev->data;
r = (ngx_http_request_t *) c->data;
+ c->sent = 0;
+
rc = ngx_http_output_filter(r, NULL);
ngx_log_debug(ev->log, "output_filter: %d" _ rc);