From: Willy Tarreau Date: Mon, 31 May 2010 15:01:36 +0000 (+0200) Subject: [BUG] http: the transaction must be initialized even in TCP mode (part 2) X-Git-Tag: v1.5-dev8~611 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39e4f621867c0efdd4a943c797e9e037d48b81c0;p=thirdparty%2Fhaproxy.git [BUG] http: the transaction must be initialized even in TCP mode (part 2) Commit 4605e3b641cebbdbb2ee5726e5bbc3c03a2d7b5e was not enough, because connections passing from a TCP frontend to an HTTP backend without any ACL and via a "default_backend" statement were still working on non-initialized data. An initialization was missing in the session_set_backend() function, next to the initialization of hdr_idx. --- diff --git a/src/proxy.c b/src/proxy.c index 57506d9da5..1ee4d6d057 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -736,6 +737,10 @@ int session_set_backend(struct session *s, struct proxy *be) if (unlikely(!s->txn.hdr_idx.v && (be->acl_requires & ACL_USE_L7_ANY))) { if ((s->txn.hdr_idx.v = pool_alloc2(s->fe->hdr_idx_pool)) == NULL) return 0; /* not enough memory */ + + /* and now initialize the HTTP transaction state */ + http_init_txn(s); + s->txn.hdr_idx.size = MAX_HTTP_HDR; hdr_idx_init(&s->txn.hdr_idx); }