From ed08d6a9be46b019a20464b1942b16f82524274f Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Thu, 24 Sep 2015 08:40:18 +0200 Subject: [PATCH] MEDIUM: proto_http: smp_prefetch_http initialize txn When we call the function smp_prefetch_http(), if the txn is not initialized, it doesn't work. This patch fix this. Now, smp_prefecth_http() permits to use http with any proxy mode. --- src/proto_http.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/proto_http.c b/src/proto_http.c index 9acf0a2eb..44a5d4b66 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -10031,10 +10031,12 @@ int smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt, if (!s) return 0; + if (!s->txn) { + if (unlikely(!http_alloc_txn(s))) + return 0; /* not enough memory */ + http_init_txn(s); + } txn = s->txn; - - if (!txn) - return 0; msg = &txn->req; /* Check for a dependency on a request */