From 39e4f621867c0efdd4a943c797e9e037d48b81c0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 31 May 2010 17:01:36 +0200 Subject: [PATCH] [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. --- src/proxy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/proxy.c b/src/proxy.c index 57506d9da..1ee4d6d05 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); }