Mercurial > hg > nginx
comparison src/http/ngx_http_event.c @ 77:57c2e18d3572
nginx-0.0.1-2003-04-17-21:59:35 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 17 Apr 2003 17:59:35 +0000 |
parents | 66de3f065886 |
children | fccdb921e8b8 |
comparison
equal
deleted
inserted
replaced
76:6127d7075471 | 77:57c2e18d3572 |
---|---|
181 | 181 |
182 | 182 |
183 static int ngx_http_process_request(ngx_event_t *rev) | 183 static int ngx_http_process_request(ngx_event_t *rev) |
184 { | 184 { |
185 int n, rc; | 185 int n, rc; |
186 ngx_event_t *wev; | |
186 ngx_connection_t *c; | 187 ngx_connection_t *c; |
187 ngx_http_request_t *r; | 188 ngx_http_request_t *r; |
188 ngx_http_log_ctx_t *lcx; | 189 ngx_http_log_ctx_t *lcx; |
189 | 190 |
190 c = (ngx_connection_t *) rev->data; | 191 c = (ngx_connection_t *) rev->data; |
258 | 259 |
259 if (rc != NGX_OK) { | 260 if (rc != NGX_OK) { |
260 return ngx_http_finalize_request(r, rc); | 261 return ngx_http_finalize_request(r, rc); |
261 } | 262 } |
262 | 263 |
263 lcx = r->connection->log->data; | 264 lcx = c->log->data; |
264 lcx->action = "processing client request"; | 265 lcx->action = "processing client request"; |
266 | |
267 #if 0 | |
268 wev = c->write; | |
269 ngx_add_timer(wev, 5000); | |
270 wev->delayed = 1; | |
271 wev->timer_set = 1; | |
272 #endif | |
265 | 273 |
266 rc = ngx_http_handler(r); | 274 rc = ngx_http_handler(r); |
267 | 275 |
268 /* a handler does its own processing */ | 276 /* a handler does its own processing */ |
269 if (rc == NGX_DONE) { | 277 if (rc == NGX_DONE) { |
655 } | 663 } |
656 | 664 |
657 /* NGX_AGAIN: a handler has done its work | 665 /* NGX_AGAIN: a handler has done its work |
658 but the transfer is still not completed */ | 666 but the transfer is still not completed */ |
659 | 667 |
668 wev = r->connection->write; | |
669 wev->event_handler = ngx_http_writer; | |
670 | |
671 if (wev->delayed && wev->ready) { | |
672 return NGX_AGAIN; | |
673 } | |
674 | |
660 lcf = (ngx_http_core_loc_conf_t *) | 675 lcf = (ngx_http_core_loc_conf_t *) |
661 ngx_http_get_module_loc_conf(r->main ? r->main : r, | 676 ngx_http_get_module_loc_conf(r->main ? r->main : r, |
662 ngx_http_core_module_ctx); | 677 ngx_http_core_module_ctx); |
663 wev = r->connection->write; | 678 ngx_add_timer(wev, lcf->send_timeout); |
664 wev->event_handler = ngx_http_writer; | |
665 wev->timer_set = 1; | 679 wev->timer_set = 1; |
666 ngx_add_timer(wev, lcf->send_timeout); | |
667 | 680 |
668 #if (USE_KQUEUE) | 681 #if (USE_KQUEUE) |
669 | 682 |
670 #if (HAVE_LOWAT_EVENT) /* kqueue's NOTE_LOWAT */ | 683 #if (HAVE_LOWAT_EVENT) /* kqueue's NOTE_LOWAT */ |
671 wev->lowat = lcf->send_lowat; | 684 wev->lowat = lcf->send_lowat; |