MINOR: http-ana: Simplify creation/destruction of HTTP transactions
Now allocation and initialization of HTTP transactions are performed in a
unique function. Historically, there were two functions because the same TXN
was reset for K/A connections in the legacy HTTP mode. Now, in HTX, K/A
connections are handled at the mux level. A new stream, and thus a new TXN,
is created for each request. In addition, the function responsible to end
the TXN is now also reponsible to release it.
So, now, http_create_txn() and http_destroy_txn() must be used to create and
destroy an HTTP transaction.
diff --git a/src/proxy.c b/src/proxy.c
index d044150..cd7ba51 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -2145,13 +2145,8 @@
/* If the target backend requires HTTP processing, we have to allocate
* the HTTP transaction if we did not have one.
*/
- if (unlikely(!s->txn && be->http_needed)) {
- if (unlikely(!http_alloc_txn(s)))
- return 0; /* not enough memory */
-
- /* and now initialize the HTTP transaction state */
- http_init_txn(s);
- }
+ if (unlikely(!s->txn && be->http_needed && !http_create_txn(s)))
+ return 0;
if (s->txn) {
/* If we chain a TCP frontend to an HTX backend, we must upgrade