nginx-0.3.13-RELEASE import
*) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS.
*) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and
/dev/poll methods.
*) Bugfix: in SSI handling.
*) Bugfix: now Solaris sendfilev() is not used to transfer the client
request body to FastCGI-server via the unix domain socket.
*) Bugfix: the "auth_basic" directive did not disable the
authorization; the bug had appeared in 0.3.11.
diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c
index 839afb5..88b5b3f 100644
--- a/src/event/modules/ngx_kqueue_module.c
+++ b/src/event/modules/ngx_kqueue_module.c
@@ -276,8 +276,10 @@
ngx_kqueue_add_event(ngx_event_t *ev, int event, u_int flags)
{
ngx_int_t rc;
+#if 0
ngx_event_t *e;
ngx_connection_t *c;
+#endif
ev->active = 1;
ev->disabled = 0;
@@ -285,12 +287,11 @@
ngx_mutex_lock(list_mutex);
-#if 1
+#if 0
- if (nchanges > 0
- && ev->index < (u_int) nchanges
+ if (ev->index < (u_int) nchanges
&& ((uintptr_t) change_list[ev->index].udata & (uintptr_t) ~1)
- == (uintptr_t) ev)
+ == (uintptr_t) ev)
{
if (change_list[ev->index].flags == EV_DISABLE) {
@@ -346,12 +347,9 @@
ngx_mutex_lock(list_mutex);
-#if 1
-
- if (nchanges > 0
- && ev->index < (u_int) nchanges
+ if (ev->index < (u_int) nchanges
&& ((uintptr_t) change_list[ev->index].udata & (uintptr_t) ~1)
- == (uintptr_t) ev)
+ == (uintptr_t) ev)
{
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"kevent deleted: %d: ft:%d",
@@ -359,7 +357,9 @@
/* if the event is still not passed to a kernel we will not pass it */
- if (ev->index < (u_int) --nchanges) {
+ nchanges--;
+
+ if (ev->index < (u_int) nchanges) {
e = (ngx_event_t *)
((uintptr_t) change_list[nchanges].udata & (uintptr_t) ~1);
change_list[ev->index] = change_list[nchanges];
@@ -371,8 +371,6 @@
return NGX_OK;
}
-#endif
-
/*
* when the file descriptor is closed the kqueue automatically deletes
* its filters so we do not need to delete explicity the event
@@ -551,7 +549,9 @@
if (event_list[i].flags & EV_ERROR) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, event_list[i].data,
- "kevent() error on %d", event_list[i].ident);
+ "kevent() error on %d filter:%d flags:%04Xd",
+ event_list[i].ident, event_list[i].filter,
+ event_list[i].flags);
continue;
}
diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c
index 34ee252..e4ca238 100644
--- a/src/event/ngx_event_connect.c
+++ b/src/event/ngx_event_connect.c
@@ -181,6 +181,11 @@
if (peer->sockaddr->sa_family != AF_INET) {
c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
c->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;
+
+#if (NGX_SOLARIS)
+ /* Solaris's sendfilev() supports AF_NCA, AF_INET, and AF_INET6 */
+ c->sendfile = 0;
+#endif
}
rev = c->read;
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 7efb713..441472e 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -301,12 +301,12 @@
*d = '\0';
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"SSL: %s, cipher: \"%s\"",
SSL_get_version(c->ssl->connection), &buf[1]);
if (SSL_session_reused(c->ssl->connection)) {
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
"SSL reused session");
}
@@ -630,7 +630,7 @@
for ( ;; ) {
while (in && buf->last < buf->end) {
- if (in->buf->last_buf) {
+ if (in->buf->last_buf || in->buf->flush) {
flush = 1;
}
@@ -645,11 +645,6 @@
size = buf->end - buf->last;
}
- /*
- * TODO: the taking in->buf->flush into account can be
- * implemented using the limit on the higher level
- */
-
if (send + size > limit) {
size = (ssize_t) (limit - send);
flush = 1;
@@ -943,7 +938,7 @@
}
-void
+void ngx_cdecl
ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, char *fmt, ...)
{
u_long n;
@@ -958,7 +953,13 @@
p = ngx_cpystrn(p, (u_char *) " (SSL:", last - p);
- while (p < last && (n = ERR_get_error())) {
+ while (p < last) {
+
+ n = ERR_get_error();
+
+ if (n == 0) {
+ break;
+ }
*p++ = ' ';
diff --git a/src/event/ngx_event_openssl.h b/src/event/ngx_event_openssl.h
index 63cb333..66edc52 100644
--- a/src/event/ngx_event_openssl.h
+++ b/src/event/ngx_event_openssl.h
@@ -79,7 +79,7 @@
ngx_chain_t *ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in,
off_t limit);
ngx_int_t ngx_ssl_shutdown(ngx_connection_t *c);
-void ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
+void ngx_cdecl ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
char *fmt, ...);
void ngx_ssl_cleanup_ctx(void *data);
diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c
index 779ec18..0c499a8 100644
--- a/src/event/ngx_event_pipe.c
+++ b/src/event/ngx_event_pipe.c
@@ -407,12 +407,15 @@
static ngx_int_t
ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
{
- size_t bsize;
- ngx_uint_t flush;
- ngx_chain_t *out, **ll, *cl;
+ size_t bsize;
+ ngx_uint_t flush;
+ ngx_chain_t *out, **ll, *cl;
+ ngx_connection_t *downstream;
+
+ downstream = p->downstream;
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write downstream: %d", p->downstream->write->ready);
+ "pipe write downstream: %d", downstream->write->ready);
for ( ;; ) {
if (p->downstream_error) {
@@ -452,6 +455,11 @@
}
if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) {
+
+ if (downstream->destroyed) {
+ return NGX_ABORT;
+ }
+
p->downstream_error = 1;
return ngx_event_pipe_drain_chains(p);
}
@@ -468,9 +476,9 @@
break;
}
- if (p->downstream->data != p->output_ctx
- || !p->downstream->write->ready
- || p->downstream->write->delayed)
+ if (downstream->data != p->output_ctx
+ || !downstream->write->ready
+ || downstream->write->delayed)
{
break;
}