From: Willy Tarreau Date: Sun, 24 Jan 2010 12:10:43 +0000 (+0100) Subject: [MINOR] http: logs must report persistent connections to down servers X-Git-Tag: v1.3.23~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=857d0c3d0ce6837571b26998572d94b72c9d8ebf;p=thirdparty%2Fhaproxy.git [MINOR] http: logs must report persistent connections to down servers When using "option persist" or "force-persist", we want to know from the logs if the cookie referenced a valid server or a down server. Till here the flag reported a valid server even if the server was down, which is misleading. Now we correctly report that the requested server was down. We can typically see "--DI" when using "option persist" with redispatch, ad "SCDN" when using force-persist on a down server. (cherry picked from commit 2a6d88dafe5e5628abb962caf395143d0c0b6024) --- diff --git a/src/proto_http.c b/src/proto_http.c index bae0412384..fd6fd3f6d4 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3454,7 +3454,7 @@ void manage_client_side_appsession(struct session *t, const char *buf) { (t->flags & SN_FORCE_PRST)) { /* we found the server and it's usable */ txn->flags &= ~TX_CK_MASK; - txn->flags |= TX_CK_VALID; + txn->flags |= (srv->state & SRV_RUNNING) ? TX_CK_VALID : TX_CK_DOWN; t->flags |= SN_DIRECT | SN_ASSIGNED; t->srv = srv; break; @@ -3652,7 +3652,7 @@ void manage_client_side_cookies(struct session *t, struct buffer *req) (t->flags & SN_FORCE_PRST)) { /* we found the server and it's usable */ txn->flags &= ~TX_CK_MASK; - txn->flags |= TX_CK_VALID; + txn->flags |= (srv->state & SRV_RUNNING) ? TX_CK_VALID : TX_CK_DOWN; t->flags |= SN_DIRECT | SN_ASSIGNED; t->srv = srv; break;