# HG changeset patch # User Maxim Dounin # Date 1315487527 -14400 # Node ID c53e018dbcf5ab07e9880710582f303f52836f18 # Parent 17b2dbbbce98c5df36ed3318d7756bf3a6a6211b Keepalive: do not reject connections with ready flag set. Instead, call read event handler explicitly to test if there are actually any unexpected data. This fixes unbuffered proxy connections not being cached with epoll and rtsig event methods. diff --git a/ngx_http_upstream_keepalive_module.c b/ngx_http_upstream_keepalive_module.c --- a/ngx_http_upstream_keepalive_module.c +++ b/ngx_http_upstream_keepalive_module.c @@ -338,7 +338,6 @@ ngx_http_upstream_free_keepalive_peer(ng if (kp->failed || c == NULL || c->read->eof - || c->read->ready || c->read->error || c->read->timedout || c->write->error @@ -428,6 +427,10 @@ ngx_http_upstream_free_keepalive_peer(ng item->socklen = pc->socklen; ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen); + if (c->read->ready) { + ngx_http_upstream_keepalive_close_handler(c->read); + } + invalid: kp->original_free_peer(pc, kp->data, state);