]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: create a dedicated pool for http_txn
authorWilly Tarreau <w@1wt.eu>
Fri, 3 Apr 2015 20:55:33 +0000 (22:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:35:52 +0000 (11:35 +0200)
This one will not necessarily be allocated for each stream, and we want
to use the fact that it equals null to know it's not present so that we
can always deduce its presence from the stream pointer.

This commit only creates the new pool.

src/haproxy.c
src/proto_http.c
src/stream.c

index 4510375d361ff50a7ef4f5e49dcef93f88bb59f0..b2f3e367aa9fd8cbcee0a22037f4c741199ef08a 100644 (file)
@@ -1443,6 +1443,7 @@ void deinit(void)
        pool_destroy2(pool2_pendconn);
        pool_destroy2(pool2_sig_handlers);
        pool_destroy2(pool2_hdr_idx);
+       pool_destroy2(pool2_http_txn);
     
        if (have_appsession) {
                pool_destroy2(apools.serverid);
index fac05b77d120d2fbdaabb3ca4815bc0288522c3f..8bd6b5ef544c1411255b5df879cd1a7bc5e979fe 100644 (file)
@@ -326,6 +326,7 @@ void init_proto_http()
        FD_SET(0x7f, http_encode_map);
 
        /* memory allocations */
+       pool2_http_txn = create_pool("http_txn", sizeof(struct http_txn), MEM_F_SHARED);
        pool2_requri = create_pool("requri", REQURI_LEN, MEM_F_SHARED);
        pool2_uniqueid = create_pool("uniqueid", UNIQUEID_LEN, MEM_F_SHARED);
 }
@@ -1087,6 +1088,7 @@ void http_return_srv_error(struct stream *s, struct stream_interface *si)
 extern const char sess_term_cond[8];
 extern const char sess_fin_state[8];
 extern const char *monthname[12];
+struct pool_head *pool2_http_txn;
 struct pool_head *pool2_requri;
 struct pool_head *pool2_capture = NULL;
 struct pool_head *pool2_uniqueid;
index d28684ead0a2d4ed7dbaec78f026c5dcf72e2191..cd0f8bd9e7b324daa9b4c57b2cda2d8ff65ab1fc 100644 (file)
@@ -680,6 +680,7 @@ static void stream_free(struct stream *s)
        /* We may want to free the maximum amount of pools if the proxy is stopping */
        if (fe && unlikely(fe->state == PR_STSTOPPED)) {
                pool_flush2(pool2_buffer);
+               pool_flush2(pool2_http_txn);
                pool_flush2(pool2_hdr_idx);
                pool_flush2(pool2_requri);
                pool_flush2(pool2_capture);