diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2003-04-17 17:59:35 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2003-04-17 17:59:35 +0000 |
| commit | 6a7fd11170b5e8f62f67c739da6d83470f5407fd (patch) | |
| tree | b6180f27545dff757fa3506b29ba029bbb00eb80 /src/http/ngx_http_event.c | |
| parent | 153d743b071263686878c7a72b313a060cd2b9d8 (diff) | |
| download | nginx-6a7fd11170b5e8f62f67c739da6d83470f5407fd.tar.gz nginx-6a7fd11170b5e8f62f67c739da6d83470f5407fd.tar.bz2 | |
nginx-0.0.1-2003-04-17-21:59:35 import
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_event.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/http/ngx_http_event.c b/src/http/ngx_http_event.c index d16460c4d..fcd90f669 100644 --- a/src/http/ngx_http_event.c +++ b/src/http/ngx_http_event.c @@ -183,6 +183,7 @@ static int ngx_http_init_request(ngx_event_t *rev) static int ngx_http_process_request(ngx_event_t *rev) { int n, rc; + ngx_event_t *wev; ngx_connection_t *c; ngx_http_request_t *r; ngx_http_log_ctx_t *lcx; @@ -260,9 +261,16 @@ static int ngx_http_process_request(ngx_event_t *rev) return ngx_http_finalize_request(r, rc); } - lcx = r->connection->log->data; + lcx = c->log->data; lcx->action = "processing client request"; +#if 0 + wev = c->write; + ngx_add_timer(wev, 5000); + wev->delayed = 1; + wev->timer_set = 1; +#endif + rc = ngx_http_handler(r); /* a handler does its own processing */ @@ -657,13 +665,18 @@ int ngx_http_finalize_request(ngx_http_request_t *r, int error) /* NGX_AGAIN: a handler has done its work but the transfer is still not completed */ + wev = r->connection->write; + wev->event_handler = ngx_http_writer; + + if (wev->delayed && wev->ready) { + return NGX_AGAIN; + } + lcf = (ngx_http_core_loc_conf_t *) ngx_http_get_module_loc_conf(r->main ? r->main : r, ngx_http_core_module_ctx); - wev = r->connection->write; - wev->event_handler = ngx_http_writer; - wev->timer_set = 1; ngx_add_timer(wev, lcf->send_timeout); + wev->timer_set = 1; #if (USE_KQUEUE) |
