From: Willy Tarreau Date: Thu, 20 May 2010 14:17:07 +0000 (+0200) Subject: [BUG] http: the transaction must be initialized even in TCP mode X-Git-Tag: v1.5-dev8~615 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3445fce16ccfb7edf89c0d1ce5f0c146a034b77;p=thirdparty%2Fhaproxy.git [BUG] http: the transaction must be initialized even in TCP mode When running in pure TCP mode with a traffic inspection rule to detect HTTP protocol, we have to initialize the HTTP transaction too. The effect of not doing this was that some incoming connections could have been matched as carrying HTTP protocol eventhough this was not the case. --- diff --git a/src/client.c b/src/client.c index 2955de07f8..444d47fb56 100644 --- a/src/client.c +++ b/src/client.c @@ -301,10 +301,10 @@ int event_accept(int fd) { if ((txn->hdr_idx.v = pool_alloc2(p->hdr_idx_pool)) == NULL) goto out_fail_idx; /* no memory */ - } - if (p->mode == PR_MODE_HTTP) + /* and now initialize the HTTP transaction state */ http_init_txn(s); + } if ((p->mode == PR_MODE_TCP || p->mode == PR_MODE_HTTP) && (p->logfac1 >= 0 || p->logfac2 >= 0)) {