comparison src/event/modules/ngx_kqueue_module.c @ 116:e38f51cd0905 NGINX_0_3_5

nginx 0.3.5 *) Bugfix: the segmentation fault may occurred if the IMAP/POP3 login was changed by authorization server; bug appeared in 0.2.2. *) Bugfix: the accept mutex did not work and all connections were handled by one process; bug appeared in 0.3.3. *) Bugfix: the timeout did not work if the "rtsig" method and the "timer_resolution" directive were used.
author Igor Sysoev <http://sysoev.ru>
date Fri, 21 Oct 2005 00:00:00 +0400
parents ebca9c35e3a6
children 91372f004adf
comparison
equal deleted inserted replaced
115:45a230988aa5 116:e38f51cd0905
471 { 471 {
472 int events, n; 472 int events, n;
473 ngx_int_t i, instance; 473 ngx_int_t i, instance;
474 ngx_uint_t level; 474 ngx_uint_t level;
475 ngx_err_t err; 475 ngx_err_t err;
476 ngx_msec_t delta;
477 ngx_event_t *ev, **queue; 476 ngx_event_t *ev, **queue;
478 struct timespec ts, *tp; 477 struct timespec ts, *tp;
479 478
480 if (ngx_threaded) { 479 if (ngx_threaded) {
481 if (ngx_kqueue_process_changes(cycle, 0) == NGX_ERROR) { 480 if (ngx_kqueue_process_changes(cycle, 0) == NGX_ERROR) {
507 err = ngx_errno; 506 err = ngx_errno;
508 } else { 507 } else {
509 err = 0; 508 err = 0;
510 } 509 }
511 510
512 delta = ngx_current_msec;
513
514 if (flags & NGX_UPDATE_TIME) { 511 if (flags & NGX_UPDATE_TIME) {
515 ngx_time_update(0, 0); 512 ngx_time_update(0, 0);
516 } 513 }
517 514
518 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 515 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
534 531
535 ngx_log_error(level, cycle->log, err, "kevent() failed"); 532 ngx_log_error(level, cycle->log, err, "kevent() failed");
536 return NGX_ERROR; 533 return NGX_ERROR;
537 } 534 }
538 535
539 if (timer != NGX_TIMER_INFINITE) {
540 delta = ngx_current_msec - delta;
541
542 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
543 "kevent timer: %M, delta: %M", timer, delta);
544
545 } else {
546 if (events == 0) {
547 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
548 "kevent() returned no events without timeout");
549 return NGX_ERROR;
550 }
551 }
552
553 if (events == 0) { 536 if (events == 0) {
554 return NGX_OK; 537 if (timer != NGX_TIMER_INFINITE) {
538 return NGX_OK;
539 }
540
541 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
542 "kevent() returned no events without timeout");
543 return NGX_ERROR;
555 } 544 }
556 545
557 ngx_mutex_lock(ngx_posted_events_mutex); 546 ngx_mutex_lock(ngx_posted_events_mutex);
558 547
559 for (i = 0; i < events; i++) { 548 for (i = 0; i < events; i++) {