Mercurial > hg > nginx
comparison src/event/modules/ngx_select_module.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 | 4d9ea73a627a |
comparison
equal
deleted
inserted
replaced
566:4fc7c33856a4 | 567:1af2fcb3be8a |
---|---|
248 ngx_uint_t flags) | 248 ngx_uint_t flags) |
249 { | 249 { |
250 int ready, nready; | 250 int ready, nready; |
251 ngx_uint_t i, found; | 251 ngx_uint_t i, found; |
252 ngx_err_t err; | 252 ngx_err_t err; |
253 ngx_msec_t delta; | |
254 ngx_event_t *ev, **queue; | 253 ngx_event_t *ev, **queue; |
255 ngx_connection_t *c; | 254 ngx_connection_t *c; |
256 struct timeval tv, *tp; | 255 struct timeval tv, *tp; |
257 #if !(NGX_WIN32) | 256 #if !(NGX_WIN32) |
258 ngx_uint_t level; | 257 ngx_uint_t level; |
329 err = ngx_socket_errno; | 328 err = ngx_socket_errno; |
330 } else { | 329 } else { |
331 err = 0; | 330 err = 0; |
332 } | 331 } |
333 | 332 |
334 delta = ngx_current_msec; | |
335 | |
336 if (flags & NGX_UPDATE_TIME) { | 333 if (flags & NGX_UPDATE_TIME) { |
337 ngx_time_update(0, 0); | 334 ngx_time_update(0, 0); |
338 } | |
339 | |
340 if (timer != NGX_TIMER_INFINITE) { | |
341 delta = ngx_current_msec - delta; | |
342 | |
343 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
344 "select timer: %M, delta: %M", timer, delta); | |
345 | |
346 } else { | |
347 if (ready == 0) { | |
348 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
349 "select() returned no events without timeout"); | |
350 return NGX_ERROR; | |
351 } | |
352 } | 335 } |
353 | 336 |
354 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 337 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
355 "select ready %d", ready); | 338 "select ready %d", ready); |
356 | 339 |
381 return NGX_ERROR; | 364 return NGX_ERROR; |
382 } | 365 } |
383 | 366 |
384 #endif | 367 #endif |
385 | 368 |
386 if (nevents == 0) { | 369 if (ready == 0) { |
387 return NGX_OK; | 370 if (timer != NGX_TIMER_INFINITE) { |
371 return NGX_OK; | |
372 } | |
373 | |
374 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | |
375 "select() returned no events without timeout"); | |
376 return NGX_ERROR; | |
388 } | 377 } |
389 | 378 |
390 ngx_mutex_lock(ngx_posted_events_mutex); | 379 ngx_mutex_lock(ngx_posted_events_mutex); |
391 | 380 |
392 nready = 0; | 381 nready = 0; |