comparison src/event/modules/ngx_devpoll_module.c @ 32:da8c190bdaba NGINX_0_1_16

nginx 0.1.16 *) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; bug appeared in 0.1.14.
author Igor Sysoev <http://sysoev.ru>
date Tue, 25 Jan 2005 00:00:00 +0300
parents 8b6db3bda591
children a39d1b793287
comparison
equal deleted inserted replaced
31:1b17dd824438 32:da8c190bdaba
308 } 308 }
309 309
310 310
311 int ngx_devpoll_process_events(ngx_cycle_t *cycle) 311 int ngx_devpoll_process_events(ngx_cycle_t *cycle)
312 { 312 {
313 int events; 313 int events, revents;
314 ngx_int_t i; 314 ngx_int_t i;
315 ngx_uint_t j, lock, accept_lock, expire; 315 ngx_uint_t j, lock, accept_lock, expire;
316 size_t n; 316 size_t n;
317 ngx_msec_t timer; 317 ngx_msec_t timer;
318 ngx_err_t err; 318 ngx_err_t err;
461 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "unknown cycle"); 461 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "unknown cycle");
462 exit(1); 462 exit(1);
463 } 463 }
464 #endif 464 #endif
465 465
466 revents = event_list[i].revents;
467
466 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 468 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
467 "devpoll: fd:%d, ev:%04Xd, rev:%04Xd", 469 "devpoll: fd:%d, ev:%04Xd, rev:%04Xd",
468 event_list[i].fd, 470 event_list[i].fd, event_list[i].events, revents);
469 event_list[i].events, event_list[i].revents); 471
470 472 if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
471 if (event_list[i].revents & (POLLERR|POLLHUP|POLLNVAL)) {
472 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, 473 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
473 "ioctl(DP_POLL) error fd:%d ev:%04Xd rev:%04Xd", 474 "ioctl(DP_POLL) error fd:%d ev:%04Xd rev:%04Xd",
474 event_list[i].fd, 475 event_list[i].fd, event_list[i].events, revents);
475 event_list[i].events, event_list[i].revents); 476 }
476 } 477
477 478 if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
478 if (event_list[i].revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL))
479 {
480 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, 479 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
481 "strange ioctl(DP_POLL) events " 480 "strange ioctl(DP_POLL) events "
482 "fd:%d ev:%04Xd rev:%04Xd", 481 "fd:%d ev:%04Xd rev:%04Xd",
483 event_list[i].fd, 482 event_list[i].fd, event_list[i].events, revents);
484 event_list[i].events, event_list[i].revents); 483 }
484
485 if ((revents & (POLLERR|POLLHUP|POLLNVAL))
486 && (revents & (POLLIN|POLLOUT)) == 0)
487 {
488 /*
489 * if the error events were returned without POLLIN or POLLOUT,
490 * then add these flags to handle the events at least in one
491 * active handler
492 */
493
494 revents |= POLLIN|POLLOUT;
485 } 495 }
486 496
487 wev = c->write; 497 wev = c->write;
488 498
489 if ((event_list[i].events & (POLLOUT|POLLERR|POLLHUP)) && wev->active) { 499 if ((revents & POLLOUT) && wev->active) {
490 wev->ready = 1; 500 wev->ready = 1;
491 501
492 if (!ngx_threaded && !ngx_accept_mutex_held) { 502 if (!ngx_threaded && !ngx_accept_mutex_held) {
493 wev->event_handler(wev); 503 wev->event_handler(wev);
494 504
503 * if the accept event is the last one. 513 * if the accept event is the last one.
504 */ 514 */
505 515
506 rev = c->read; 516 rev = c->read;
507 517
508 if ((event_list[i].events & (POLLIN|POLLERR|POLLHUP)) && rev->active) { 518 if ((revents & POLLIN) && rev->active) {
509 rev->ready = 1; 519 rev->ready = 1;
510 520
511 if (!ngx_threaded && !ngx_accept_mutex_held) { 521 if (!ngx_threaded && !ngx_accept_mutex_held) {
512 rev->event_handler(rev); 522 rev->event_handler(rev);
513 523