Mercurial > hg > ngx_http_upstream_keepalive
comparison ngx_http_upstream_keepalive_module.c @ 42:c53e018dbcf5
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 08 Sep 2011 17:12:07 +0400 |
parents | 17b2dbbbce98 |
children | 489c5d4318ff |
comparison
equal
deleted
inserted
replaced
41:17b2dbbbce98 | 42:c53e018dbcf5 |
---|---|
336 c = pc->connection; | 336 c = pc->connection; |
337 | 337 |
338 if (kp->failed | 338 if (kp->failed |
339 || c == NULL | 339 || c == NULL |
340 || c->read->eof | 340 || c->read->eof |
341 || c->read->ready | |
342 || c->read->error | 341 || c->read->error |
343 || c->read->timedout | 342 || c->read->timedout |
344 || c->write->error | 343 || c->write->error |
345 || c->write->timedout) | 344 || c->write->timedout) |
346 { | 345 { |
426 #endif | 425 #endif |
427 | 426 |
428 item->socklen = pc->socklen; | 427 item->socklen = pc->socklen; |
429 ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen); | 428 ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen); |
430 | 429 |
430 if (c->read->ready) { | |
431 ngx_http_upstream_keepalive_close_handler(c->read); | |
432 } | |
433 | |
431 invalid: | 434 invalid: |
432 | 435 |
433 kp->original_free_peer(pc, kp->data, state); | 436 kp->original_free_peer(pc, kp->data, state); |
434 } | 437 } |
435 | 438 |