nginx-0.0.1-2004-01-05-23:55:48 import
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 6d11f4b..a8dfe0e 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -82,6 +82,7 @@
rev = c->read;
rev->event_handler = ngx_http_init_request;
+ rev->log_error = NGX_ERROR_INFO;
if (rev->ready) {
/* deferred accept, aio, iocp, epoll */
@@ -896,6 +897,17 @@
ngx_del_timer(r->connection->write);
}
+ if (r->connection->read->kq_eof) {
+#if (NGX_KQUEUE)
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log,
+ r->connection->read->kq_errno,
+ "kevent reported about closed connection by client");
+#endif
+ ngx_http_close_request(r, 0);
+ ngx_http_close_connection(r->connection);
+ return;
+ }
+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
if (r->keepalive != 0 && clcf->keepalive_timeout > 0) {
@@ -1203,7 +1215,7 @@
ctx->action = "keepalive";
- if (c->tcp_nopush) {
+ if (c->tcp_nopush == 1) {
if (ngx_tcp_push(c->fd) == NGX_ERROR) {
ngx_log_error(NGX_LOG_CRIT, c->log, ngx_socket_errno,
ngx_tcp_push_n " failed");
@@ -1239,10 +1251,10 @@
* so we ignore ECONNRESET here.
*/
- rev->ignore_econnreset = 1;
+ rev->log_error = NGX_ERROR_IGNORE_ECONNRESET;
ngx_set_socket_errno(0);
n = ngx_recv(c, c->buffer->last, c->buffer->end - c->buffer->last);
- rev->ignore_econnreset = 0;
+ rev->log_error = NGX_ERROR_INFO;
if (n == NGX_AGAIN) {
return;
@@ -1506,11 +1518,11 @@
ngx_del_conn(c);
} else {
- if (c->read->active) {
+ if (c->read->active || c->read->disabled) {
ngx_del_event(c->read, NGX_READ_EVENT, NGX_CLOSE_EVENT);
}
- if (c->write->active) {
+ if (c->write->active || c->write->disabled) {
ngx_del_event(c->write, NGX_WRITE_EVENT, NGX_CLOSE_EVENT);
}
}