mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 02:42:48 +08:00
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.
This commit is contained in:
parent
b6b31c91be
commit
055951dc96
@ -1,23 +1,44 @@
|
|||||||
|
|
||||||
types {
|
types {
|
||||||
text/html html htm shtml;
|
|
||||||
text/xml xml rss;
|
|
||||||
text/css css;
|
text/css css;
|
||||||
|
text/html html htm shtml;
|
||||||
text/plain txt;
|
text/plain txt;
|
||||||
|
text/xml xml rss;
|
||||||
text/x-component htc;
|
text/x-component htc;
|
||||||
|
text/mathml mml;
|
||||||
|
|
||||||
image/gif gif;
|
image/gif gif;
|
||||||
image/png png;
|
|
||||||
image/jpeg jpeg jpg;
|
image/jpeg jpeg jpg;
|
||||||
|
image/png png;
|
||||||
image/x-icon ico;
|
image/x-icon ico;
|
||||||
image/x-jng jng;
|
image/x-jng jng;
|
||||||
|
|
||||||
|
application/java-archive jar war ear;
|
||||||
|
application/mac-binhex40 hqx;
|
||||||
application/pdf pdf;
|
application/pdf pdf;
|
||||||
application/x-shockwave-flash swf;
|
application/x-cocoa cco;
|
||||||
application/x-javascript js;
|
application/x-javascript js;
|
||||||
|
application/x-java-archive-diff jardiff;
|
||||||
|
application/x-java-jnlp-file jnlp;
|
||||||
|
application/x-makeself run;
|
||||||
|
application/x-perl pl pm;
|
||||||
|
application/x-pilot prc pdb;
|
||||||
application/x-rar-compressed rar;
|
application/x-rar-compressed rar;
|
||||||
application/x-xpinstall xpi;
|
application/x-redhat-package-manager rpm;
|
||||||
|
application/x-sea sea;
|
||||||
|
application/x-shockwave-flash swf;
|
||||||
|
application/x-stuffit sit;
|
||||||
|
application/x-tcl tcl tk;
|
||||||
application/x-x509-ca-cert der pem crt;
|
application/x-x509-ca-cert der pem crt;
|
||||||
|
application/x-xpinstall xpi;
|
||||||
|
application/zip zip;
|
||||||
|
|
||||||
|
application/octet-stream deb;
|
||||||
|
application/octet-stream bin exe dll;
|
||||||
|
application/octet-stream dmg;
|
||||||
|
application/octet-stream eot;
|
||||||
|
application/octet-stream iso img;
|
||||||
|
application/octet-stream msi msp msm;
|
||||||
|
|
||||||
audio/mpeg mp3;
|
audio/mpeg mp3;
|
||||||
audio/x-realaudio ra;
|
audio/x-realaudio ra;
|
||||||
|
@ -9,7 +9,47 @@
|
|||||||
<title lang="en">nginx changelog</title>
|
<title lang="en">nginx changelog</title>
|
||||||
|
|
||||||
|
|
||||||
<changes ver="0.3.4" date="19.09.2005">
|
<changes ver="0.3.5" date="21.10.2005">
|
||||||
|
|
||||||
|
<change type="bugfix">
|
||||||
|
<para lang="ru">
|
||||||
|
ÅÓÌÉ ÌÏÇÉÎ IMAP/POP3 ÍÅÎÑÌÓÑ ÓÅÒ×ÅÒÏÍ Á×ÔÏÒÉÚÁÃÉÉ, ÔÏ ÍÏÇ ÐÒÏÉÚÏÊÔÉ
|
||||||
|
segmentation fault;
|
||||||
|
ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.2.2.
|
||||||
|
</para>
|
||||||
|
<para lang="en">
|
||||||
|
the segmentation fault may occurred if the IMAP/POP3 login was changed
|
||||||
|
by authorization server;
|
||||||
|
bug appeared in 0.2.2.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
|
<change type="bugfix">
|
||||||
|
<para lang="ru">
|
||||||
|
accept mutex ÎÅ ÒÁÂÏÔÁÌ, ×ÓÅ ÓÏÅÄÉÎÅÎÉÑ ÏÂÒÁÂÁÔÙ×ÁÌÉÓØ ÏÄÎÉÍ ÒÁÂÏÞÉÍ ÐÒÏÃÅÓÓÏÍ;
|
||||||
|
ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.3.3.
|
||||||
|
</para>
|
||||||
|
<para lang="en">
|
||||||
|
the accept mutex did not work and all connections were handled by one process;
|
||||||
|
bug appeared in 0.3.3.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
|
<change type="bugfix">
|
||||||
|
<para lang="ru">
|
||||||
|
ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÍÅÔÏÄÁ rtsig É ÄÉÒÅËÔÉ×Ù timer_resolution
|
||||||
|
ÎÅ ÒÁÂÏÔÁÌÉ ÔÁÊÍÁÕÔÙ.
|
||||||
|
</para>
|
||||||
|
<para lang="en">
|
||||||
|
the timeout did not work if the "rtsig" method and the "timer_resolution"
|
||||||
|
directive were used.
|
||||||
|
</para>
|
||||||
|
</change>
|
||||||
|
|
||||||
|
</changes>
|
||||||
|
|
||||||
|
|
||||||
|
<changes ver="0.3.4" date="19.10.2005">
|
||||||
|
|
||||||
<change type="bugfix">
|
<change type="bugfix">
|
||||||
<para lang="ru">
|
<para lang="ru">
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#define _NGINX_H_INCLUDED_
|
#define _NGINX_H_INCLUDED_
|
||||||
|
|
||||||
|
|
||||||
#define NGINX_VER "nginx/0.3.4"
|
#define NGINX_VER "nginx/0.3.5"
|
||||||
|
|
||||||
#define NGINX_VAR "NGINX"
|
#define NGINX_VAR "NGINX"
|
||||||
#define NGX_OLDPID_EXT ".oldbin"
|
#define NGX_OLDPID_EXT ".oldbin"
|
||||||
|
@ -332,7 +332,6 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_int_t i;
|
ngx_int_t i;
|
||||||
ngx_uint_t level;
|
ngx_uint_t level;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_event_t *rev, *wev, **queue;
|
ngx_event_t *rev, *wev, **queue;
|
||||||
ngx_connection_t *c;
|
ngx_connection_t *c;
|
||||||
struct dvpoll dvp;
|
struct dvpoll dvp;
|
||||||
@ -349,6 +348,8 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
"write(/dev/poll) failed");
|
"write(/dev/poll) failed");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nchanges = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
dvp.dp_fds = event_list;
|
dvp.dp_fds = event_list;
|
||||||
@ -362,10 +363,6 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nchanges = 0;
|
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
ngx_time_update(0, 0);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
@ -388,22 +385,15 @@ ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
|
||||||
delta = ngx_current_msec - delta;
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"devpoll timer: %M, delta: %M", timer, delta);
|
|
||||||
} else {
|
|
||||||
if (events == 0) {
|
if (events == 0) {
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
"ioctl(DP_POLL) returned no events without timeout");
|
"ioctl(DP_POLL) returned no events without timeout");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (events == 0) {
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_mutex_lock(ngx_posted_events_mutex);
|
ngx_mutex_lock(ngx_posted_events_mutex);
|
||||||
|
|
||||||
|
@ -391,7 +391,6 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
ngx_uint_t level;
|
ngx_uint_t level;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_log_t *log;
|
ngx_log_t *log;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_event_t *rev, *wev, **queue;
|
ngx_event_t *rev, *wev, **queue;
|
||||||
ngx_connection_t *c;
|
ngx_connection_t *c;
|
||||||
|
|
||||||
@ -408,25 +407,10 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
ngx_time_update(0, 0);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
|
||||||
delta = ngx_current_msec - delta;
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"epoll timer: %M, delta: %M", timer, delta);
|
|
||||||
} else {
|
|
||||||
if (events == 0) {
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
|
||||||
"epoll_wait() returned no events without timeout");
|
|
||||||
return NGX_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err == NGX_EINTR) {
|
if (err == NGX_EINTR) {
|
||||||
|
|
||||||
@ -446,9 +430,15 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (events == 0) {
|
if (events == 0) {
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
|
"epoll_wait() returned no events without timeout");
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_mutex_lock(ngx_posted_events_mutex);
|
ngx_mutex_lock(ngx_posted_events_mutex);
|
||||||
|
|
||||||
log = cycle->log;
|
log = cycle->log;
|
||||||
|
@ -473,7 +473,6 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
ngx_int_t i, instance;
|
ngx_int_t i, instance;
|
||||||
ngx_uint_t level;
|
ngx_uint_t level;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_event_t *ev, **queue;
|
ngx_event_t *ev, **queue;
|
||||||
struct timespec ts, *tp;
|
struct timespec ts, *tp;
|
||||||
|
|
||||||
@ -509,8 +508,6 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
ngx_time_update(0, 0);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
@ -536,23 +533,15 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
|
||||||
delta = ngx_current_msec - delta;
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"kevent timer: %M, delta: %M", timer, delta);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (events == 0) {
|
if (events == 0) {
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
"kevent() returned no events without timeout");
|
"kevent() returned no events without timeout");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (events == 0) {
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_mutex_lock(ngx_posted_events_mutex);
|
ngx_mutex_lock(ngx_posted_events_mutex);
|
||||||
|
|
||||||
|
@ -241,7 +241,6 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_int_t i, nready;
|
ngx_int_t i, nready;
|
||||||
ngx_uint_t found, level;
|
ngx_uint_t found, level;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_event_t *ev, **queue;
|
ngx_event_t *ev, **queue;
|
||||||
ngx_connection_t *c;
|
ngx_connection_t *c;
|
||||||
|
|
||||||
@ -267,8 +266,6 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
ngx_time_update(0, 0);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
@ -294,22 +291,15 @@ ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
|
||||||
delta = ngx_current_msec - delta;
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"poll timer: %M, delta: %M", timer, delta);
|
|
||||||
} else {
|
|
||||||
if (ready == 0) {
|
if (ready == 0) {
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
"poll() returned no events without timeout");
|
"poll() returned no events without timeout");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ready == 0) {
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_mutex_lock(ngx_posted_events_mutex);
|
ngx_mutex_lock(ngx_posted_events_mutex);
|
||||||
|
|
||||||
|
@ -286,7 +286,6 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
{
|
{
|
||||||
int signo;
|
int signo;
|
||||||
ngx_int_t instance;
|
ngx_int_t instance;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
siginfo_t si;
|
siginfo_t si;
|
||||||
ngx_event_t *rev, *wev;
|
ngx_event_t *rev, *wev;
|
||||||
@ -317,41 +316,34 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err,
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err,
|
||||||
"rtsig signo:%d", signo);
|
"rtsig signo:%d", signo);
|
||||||
|
|
||||||
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
|
ngx_time_update(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (err == NGX_EAGAIN) {
|
if (err == NGX_EAGAIN) {
|
||||||
|
|
||||||
if (timer == NGX_TIMER_INFINITE) {
|
/* timeout */
|
||||||
|
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
|
return NGX_AGAIN;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
|
||||||
"sigtimedwait() returned EAGAIN without timeout");
|
"sigtimedwait() returned EAGAIN without timeout");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
err = 0;
|
|
||||||
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"rtsig signo:%d fd:%d band:%04Xd",
|
|
||||||
signo, si.si_fd, si.si_band);
|
|
||||||
}
|
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
|
||||||
ngx_time_update(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
|
ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
|
||||||
cycle->log, err, "sigtimedwait() failed");
|
cycle->log, err, "sigtimedwait() failed");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
delta = ngx_current_msec - delta;
|
"rtsig signo:%d fd:%d band:%04Xd",
|
||||||
|
signo, si.si_fd, si.si_band);
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
"rtsig timer: %M, delta: %M", timer, delta);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module);
|
rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module);
|
||||||
@ -400,8 +392,12 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
wev->handler(wev);
|
wev->handler(wev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NGX_OK;
|
||||||
|
|
||||||
} else if (signo == SIGALRM) {
|
} else if (signo == SIGALRM) {
|
||||||
|
|
||||||
|
ngx_time_update(0, 0);
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
|
||||||
} else if (signo == SIGIO) {
|
} else if (signo == SIGIO) {
|
||||||
@ -431,18 +427,12 @@ ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
|||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
|
||||||
} else if (signo != -1) {
|
}
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
"sigtimedwait() returned unexpected signal: %d", signo);
|
"sigtimedwait() returned unexpected signal: %d", signo);
|
||||||
|
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
if (signo != -1) {
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NGX_AGAIN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -250,7 +250,6 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
int ready, nready;
|
int ready, nready;
|
||||||
ngx_uint_t i, found;
|
ngx_uint_t i, found;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
ngx_msec_t delta;
|
|
||||||
ngx_event_t *ev, **queue;
|
ngx_event_t *ev, **queue;
|
||||||
ngx_connection_t *c;
|
ngx_connection_t *c;
|
||||||
struct timeval tv, *tp;
|
struct timeval tv, *tp;
|
||||||
@ -331,26 +330,10 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = ngx_current_msec;
|
|
||||||
|
|
||||||
if (flags & NGX_UPDATE_TIME) {
|
if (flags & NGX_UPDATE_TIME) {
|
||||||
ngx_time_update(0, 0);
|
ngx_time_update(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != NGX_TIMER_INFINITE) {
|
|
||||||
delta = ngx_current_msec - delta;
|
|
||||||
|
|
||||||
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
|
||||||
"select timer: %M, delta: %M", timer, delta);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (ready == 0) {
|
|
||||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
|
||||||
"select() returned no events without timeout");
|
|
||||||
return NGX_ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
"select ready %d", ready);
|
"select ready %d", ready);
|
||||||
|
|
||||||
@ -383,10 +366,16 @@ ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (nevents == 0) {
|
if (ready == 0) {
|
||||||
|
if (timer != NGX_TIMER_INFINITE) {
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
|
||||||
|
"select() returned no events without timeout");
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_mutex_lock(ngx_posted_events_mutex);
|
ngx_mutex_lock(ngx_posted_events_mutex);
|
||||||
|
|
||||||
nready = 0;
|
nready = 0;
|
||||||
|
@ -199,7 +199,7 @@ void
|
|||||||
ngx_process_events_and_timers(ngx_cycle_t *cycle)
|
ngx_process_events_and_timers(ngx_cycle_t *cycle)
|
||||||
{
|
{
|
||||||
ngx_uint_t flags;
|
ngx_uint_t flags;
|
||||||
ngx_msec_t timer;
|
ngx_msec_t timer, delta;
|
||||||
|
|
||||||
if (ngx_timer_resolution) {
|
if (ngx_timer_resolution) {
|
||||||
timer = NGX_TIMER_INFINITE;
|
timer = NGX_TIMER_INFINITE;
|
||||||
@ -240,16 +240,25 @@ ngx_process_events_and_timers(ngx_cycle_t *cycle)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delta = ngx_current_msec;
|
||||||
|
|
||||||
(void) ngx_process_events(cycle, timer, flags);
|
(void) ngx_process_events(cycle, timer, flags);
|
||||||
|
|
||||||
|
delta = ngx_current_msec - delta;
|
||||||
|
|
||||||
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
|
"timer delta: %M", delta);
|
||||||
|
|
||||||
|
if (delta) {
|
||||||
ngx_event_expire_timers();
|
ngx_event_expire_timers();
|
||||||
|
}
|
||||||
|
|
||||||
if (ngx_posted_accept_events) {
|
if (ngx_posted_accept_events) {
|
||||||
ngx_event_process_posted(cycle, &ngx_posted_accept_events);
|
ngx_event_process_posted(cycle, &ngx_posted_accept_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_accept_mutex_held) {
|
if (ngx_accept_mutex_held) {
|
||||||
ngx_accept_mutex = 0;
|
*ngx_accept_mutex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
||||||
|
@ -159,23 +159,18 @@ ngx_http_init_connection(ngx_connection_t *c)
|
|||||||
|
|
||||||
/* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
|
/* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
|
||||||
|
|
||||||
|
#if (NGX_STAT_STUB)
|
||||||
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rev->ready) {
|
if (rev->ready) {
|
||||||
/* the deferred accept(), rtsig, aio, iocp */
|
/* the deferred accept(), rtsig, aio, iocp */
|
||||||
|
|
||||||
if (ngx_accept_mutex) {
|
if (ngx_accept_mutex) {
|
||||||
|
|
||||||
ngx_post_event(rev, &ngx_posted_events);
|
ngx_post_event(rev, &ngx_posted_events);
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_http_init_request(rev);
|
ngx_http_init_request(rev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -183,14 +178,12 @@ ngx_http_init_connection(ngx_connection_t *c)
|
|||||||
ngx_add_timer(rev, c->listening->post_accept_timeout);
|
ngx_add_timer(rev, c->listening->post_accept_timeout);
|
||||||
|
|
||||||
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {
|
||||||
|
#if (NGX_STAT_STUB)
|
||||||
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
||||||
|
#endif
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -213,35 +206,24 @@ void ngx_http_init_request(ngx_event_t *rev)
|
|||||||
ngx_http_ssl_srv_conf_t *sscf;
|
ngx_http_ssl_srv_conf_t *sscf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (NGX_STAT_STUB)
|
||||||
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
||||||
|
#endif
|
||||||
|
|
||||||
c = rev->data;
|
c = rev->data;
|
||||||
|
|
||||||
if (rev->timedout) {
|
if (rev->timedout) {
|
||||||
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hc = c->data;
|
hc = c->data;
|
||||||
|
|
||||||
if (hc) {
|
if (hc == NULL) {
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} else {
|
|
||||||
hc = ngx_pcalloc(c->pool, sizeof(ngx_http_connection_t));
|
hc = ngx_pcalloc(c->pool, sizeof(ngx_http_connection_t));
|
||||||
if (hc == NULL) {
|
if (hc == NULL) {
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -261,11 +243,6 @@ void ngx_http_init_request(ngx_event_t *rev)
|
|||||||
} else {
|
} else {
|
||||||
r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t));
|
r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t));
|
||||||
if (r == NULL) {
|
if (r == NULL) {
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -273,10 +250,6 @@ void ngx_http_init_request(ngx_event_t *rev)
|
|||||||
hc->request = r;
|
hc->request = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
c->data = r;
|
c->data = r;
|
||||||
r->http_connection = hc;
|
r->http_connection = hc;
|
||||||
|
|
||||||
@ -1652,8 +1625,15 @@ ngx_http_writer(ngx_http_request_t *r)
|
|||||||
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
|
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
|
||||||
"client timed out");
|
"client timed out");
|
||||||
c->timedout = 1;
|
c->timedout = 1;
|
||||||
ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
|
|
||||||
|
#if 0
|
||||||
|
ngx_http_close_request(r->main, NGX_HTTP_REQUEST_TIME_OUT);
|
||||||
ngx_http_close_connection(c);
|
ngx_http_close_connection(c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
c->closed = 1;
|
||||||
|
ngx_http_finalize_request(r, 0);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1665,7 +1645,7 @@ ngx_http_writer(ngx_http_request_t *r)
|
|||||||
ngx_add_timer(wev, clcf->send_timeout);
|
ngx_add_timer(wev, clcf->send_timeout);
|
||||||
|
|
||||||
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
||||||
ngx_http_close_request(r, 0);
|
ngx_http_close_request(r->main, 0);
|
||||||
ngx_http_close_connection(r->connection);
|
ngx_http_close_connection(r->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1680,7 +1660,7 @@ ngx_http_writer(ngx_http_request_t *r)
|
|||||||
clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
|
clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
|
||||||
|
|
||||||
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
||||||
ngx_http_close_request(r, 0);
|
ngx_http_close_request(r->main, 0);
|
||||||
ngx_http_close_connection(r->connection);
|
ngx_http_close_connection(r->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1711,7 +1691,7 @@ ngx_http_writer(ngx_http_request_t *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
|
||||||
ngx_http_close_request(r, 0);
|
ngx_http_close_request(r->main, 0);
|
||||||
ngx_http_close_connection(r->connection);
|
ngx_http_close_connection(r->connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1988,8 +1968,13 @@ ngx_http_set_keepalive(ngx_http_request_t *r)
|
|||||||
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "pipelined request");
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "pipelined request");
|
||||||
|
|
||||||
|
#if (NGX_STAT_STUB)
|
||||||
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
hc->pipeline = 1;
|
hc->pipeline = 1;
|
||||||
c->log->action = "reading client pipelined request line";
|
c->log->action = "reading client pipelined request line";
|
||||||
|
|
||||||
ngx_http_init_request(rev);
|
ngx_http_init_request(rev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2206,6 +2191,10 @@ ngx_http_keepalive_handler(ngx_event_t *rev)
|
|||||||
|
|
||||||
b->last += n;
|
b->last += n;
|
||||||
|
|
||||||
|
#if (NGX_STAT_STUB)
|
||||||
|
ngx_atomic_fetch_add(ngx_stat_reading, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
c->log->handler = ngx_http_log_error;
|
c->log->handler = ngx_http_log_error;
|
||||||
c->log->action = "reading client request line";
|
c->log->action = "reading client request line";
|
||||||
|
|
||||||
@ -2388,6 +2377,7 @@ ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (NGX_STAT_STUB)
|
#if (NGX_STAT_STUB)
|
||||||
|
|
||||||
if (r->stat_reading) {
|
if (r->stat_reading) {
|
||||||
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
ngx_atomic_fetch_add(ngx_stat_reading, -1);
|
||||||
}
|
}
|
||||||
@ -2395,6 +2385,7 @@ ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
|
|||||||
if (r->stat_writing) {
|
if (r->stat_writing) {
|
||||||
ngx_atomic_fetch_add(ngx_stat_writing, -1);
|
ngx_atomic_fetch_add(ngx_stat_writing, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (error && r->headers_out.status == 0) {
|
if (error && r->headers_out.status == 0) {
|
||||||
|
@ -44,6 +44,7 @@ struct ngx_imap_auth_http_ctx_s {
|
|||||||
ngx_str_t addr;
|
ngx_str_t addr;
|
||||||
ngx_str_t port;
|
ngx_str_t port;
|
||||||
ngx_str_t err;
|
ngx_str_t err;
|
||||||
|
ngx_str_t errmsg;
|
||||||
|
|
||||||
time_t sleep;
|
time_t sleep;
|
||||||
|
|
||||||
@ -459,6 +460,9 @@ ngx_imap_auth_http_process_headers(ngx_imap_session_t *s,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx->errmsg.len = len;
|
||||||
|
ctx->errmsg.data = ctx->header_start;
|
||||||
|
|
||||||
if (s->protocol == NGX_IMAP_POP3_PROTOCOL) {
|
if (s->protocol == NGX_IMAP_POP3_PROTOCOL) {
|
||||||
size = sizeof("-ERR") - 1 + len + sizeof(CRLF) - 1;
|
size = sizeof("-ERR") - 1 + len + sizeof(CRLF) - 1;
|
||||||
|
|
||||||
@ -486,6 +490,7 @@ ngx_imap_auth_http_process_headers(ngx_imap_session_t *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
|
|
||||||
p = ngx_cpymem(p, ctx->header_start, len);
|
p = ngx_cpymem(p, ctx->header_start, len);
|
||||||
*p++ = CR; *p++ = LF;
|
*p++ = CR; *p++ = LF;
|
||||||
|
|
||||||
@ -519,7 +524,16 @@ ngx_imap_auth_http_process_headers(ngx_imap_session_t *s,
|
|||||||
sizeof("Auth-User") - 1) == 0)
|
sizeof("Auth-User") - 1) == 0)
|
||||||
{
|
{
|
||||||
s->login.len = ctx->header_end - ctx->header_start;
|
s->login.len = ctx->header_end - ctx->header_start;
|
||||||
s->login.data = ctx->header_start;
|
|
||||||
|
s->login.data = ngx_palloc(s->connection->pool, s->login.len);
|
||||||
|
if (s->login.data == NULL) {
|
||||||
|
ngx_close_connection(ctx->peer.connection);
|
||||||
|
ngx_destroy_pool(ctx->pool);
|
||||||
|
ngx_imap_session_internal_server_error(s);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngx_memcpy(s->login.data, ctx->header_start, s->login.len);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -550,14 +564,14 @@ ngx_imap_auth_http_process_headers(ngx_imap_session_t *s,
|
|||||||
ngx_close_connection(ctx->peer.connection);
|
ngx_close_connection(ctx->peer.connection);
|
||||||
|
|
||||||
if (ctx->err.len) {
|
if (ctx->err.len) {
|
||||||
|
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
|
||||||
|
"client login failed: \"%V\"", &ctx->errmsg);
|
||||||
|
|
||||||
s->out = ctx->err;
|
s->out = ctx->err;
|
||||||
timer = ctx->sleep;
|
timer = ctx->sleep;
|
||||||
|
|
||||||
ngx_destroy_pool(ctx->pool);
|
ngx_destroy_pool(ctx->pool);
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
|
|
||||||
"client login failed");
|
|
||||||
|
|
||||||
if (timer == 0) {
|
if (timer == 0) {
|
||||||
s->quit = 1;
|
s->quit = 1;
|
||||||
ngx_imap_send(s->connection->write);
|
ngx_imap_send(s->connection->write);
|
||||||
|
Loading…
Reference in New Issue
Block a user