comparison src/event/ngx_event.c @ 567:1af2fcb3be8a release-0.3.5

nginx-0.3.5-RELEASE import *) Bugfix: the segmentation fault may occurred if the IMAP/POP3 login was changed by authorization server; the bug had appeared in 0.2.2. *) Bugfix: the accept mutex did not work and all connections were handled by one process; the bug had 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 <igor@sysoev.ru>
date Fri, 21 Oct 2005 19:12:18 +0000
parents 9c2f3ed7a247
children 58475592100c
comparison
equal deleted inserted replaced
566:4fc7c33856a4 567:1af2fcb3be8a
197 197
198 void 198 void
199 ngx_process_events_and_timers(ngx_cycle_t *cycle) 199 ngx_process_events_and_timers(ngx_cycle_t *cycle)
200 { 200 {
201 ngx_uint_t flags; 201 ngx_uint_t flags;
202 ngx_msec_t timer; 202 ngx_msec_t timer, delta;
203 203
204 if (ngx_timer_resolution) { 204 if (ngx_timer_resolution) {
205 timer = NGX_TIMER_INFINITE; 205 timer = NGX_TIMER_INFINITE;
206 flags = 0; 206 flags = 0;
207 207
238 } 238 }
239 } 239 }
240 } 240 }
241 } 241 }
242 242
243 delta = ngx_current_msec;
244
243 (void) ngx_process_events(cycle, timer, flags); 245 (void) ngx_process_events(cycle, timer, flags);
244 246
245 ngx_event_expire_timers(); 247 delta = ngx_current_msec - delta;
248
249 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
250 "timer delta: %M", delta);
251
252 if (delta) {
253 ngx_event_expire_timers();
254 }
246 255
247 if (ngx_posted_accept_events) { 256 if (ngx_posted_accept_events) {
248 ngx_event_process_posted(cycle, &ngx_posted_accept_events); 257 ngx_event_process_posted(cycle, &ngx_posted_accept_events);
249 } 258 }
250 259
251 if (ngx_accept_mutex_held) { 260 if (ngx_accept_mutex_held) {
252 ngx_accept_mutex = 0; 261 *ngx_accept_mutex = 0;
253 } 262 }
254 263
255 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 264 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
256 "posted events %p", ngx_posted_events); 265 "posted events %p", ngx_posted_events);
257 266