From b56f319f65edcbd4f3ebe7e37f49bdfe746170f8 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 5 May 2007 08:40:29 +0200 Subject: [BUG] fix early server close after client close Problem reported by Andy Smith. If a client sends TCP data and quickly closes the connection before the server connection is established, AND the whole buffer can be sent at once when the connection establishes, then the server side believes that it can simply abort the connection without checking that some work was performed. Fix: ensure that we had RES_SILENT before closing. --- haproxy.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/haproxy.c b/haproxy.c index 8e57700..357a37a 100644 --- a/haproxy.c +++ b/haproxy.c @@ -5589,7 +5589,7 @@ int process_srv(struct session *t) { else if (s == SV_STCONN) { /* connection in progress */ if (c == CL_STCLOSE || c == CL_STSHUTW || (c == CL_STSHUTR && - (t->req->l == 0 || t->proxy->options & PR_O_ABRT_CLOSE))) { /* give up */ + ((t->req->l == 0 && t->res_sw == RES_SILENT) || t->proxy->options & PR_O_ABRT_CLOSE))) { /* give up */ tv_eternity(&t->cnexpire); fd_delete(t->srv_fd); if (t->srv) -- 1.5.2.5