]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: remove now unused channel pool
authorWilly Tarreau <w@1wt.eu>
Thu, 27 Nov 2014 21:10:04 +0000 (22:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Mar 2015 19:41:46 +0000 (20:41 +0100)
The channels are now part of the struct session. Their pool is
not needed anymore.

include/proto/channel.h
include/types/channel.h
src/channel.c
src/haproxy.c
src/hlua.c
src/session.c

index f6b046991df7f1455392e52330694087f64c5b35..79e5b784e1cc88950687fb6d22082fe0cc5f64dd 100644 (file)
@@ -2,7 +2,7 @@
  * include/proto/channel.h
  * Channel management definitions, macros and inline functions.
  *
- * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 
 #include <common/config.h>
 #include <common/chunk.h>
-#include <common/memory.h>
 #include <common/ticks.h>
 #include <common/time.h>
 
 #include <types/channel.h>
 #include <types/global.h>
 
-extern struct pool_head *pool2_channel;
-
 /* perform minimal intializations, report 0 in case of error, 1 if OK. */
 int init_channel();
 
index 7640caed3d9f2d5d8e93cc9c433cb40393604e06..7b4afc83c9ee3ea29f38d06d50c8770206208bde 100644 (file)
@@ -2,7 +2,7 @@
  * include/types/channel.h
  * Channel management definitions, macros and inline functions.
  *
- * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
+ * Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,7 +23,6 @@
 #define _TYPES_CHANNEL_H
 
 #include <common/config.h>
-#include <common/chunk.h>
 #include <common/buffer.h>
 #include <types/stream_interface.h>
 
 /* Magic value to forward infinite size (TCP, ...), used with ->to_forward */
 #define CHN_INFINITE_FORWARD    MAX_RANGE(unsigned int)
 
-/* needed for a declaration below */
-struct session;
 
 struct channel {
        unsigned int flags;             /* CF_* */
index 4e0a2ac6c222b1198ef5aa776e9a29d66bc37aac..231d99f352e2ae4497708d70ccf96d9b9e8e5c84 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Channel management functions.
  *
- * Copyright 2000-2012 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2014 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 #include <string.h>
 
 #include <common/config.h>
-#include <common/memory.h>
 #include <common/buffer.h>
 
 #include <proto/channel.h>
 
-struct pool_head *pool2_channel;
-
-
-/* perform minimal intializations, report 0 in case of error, 1 if OK. */
-int init_channel()
-{
-       pool2_channel = create_pool("channel", sizeof(struct channel), MEM_F_SHARED);
-       return pool2_channel != NULL;
-}
 
 /* Schedule up to <bytes> more bytes to be forwarded via the channel without
  * notifying the owner task. Any data pending in the buffer are scheduled to be
index 872aab827b20d8b73a8809d9e10ec65f7376b40f..2a79b0f83524631792ba2839b7020aa896465919 100644 (file)
@@ -777,7 +777,6 @@ void init(int argc, char **argv)
        global_listener_queue_task->expire = TICK_ETERNITY;
 
        /* now we know the buffer size, we can initialize the channels and buffers */
-       init_channel();
        init_buffer();
 
        if (have_appsession)
@@ -1434,7 +1433,6 @@ void deinit(void)
        pool_destroy2(pool2_session);
        pool_destroy2(pool2_connection);
        pool_destroy2(pool2_buffer);
-       pool_destroy2(pool2_channel);
        pool_destroy2(pool2_requri);
        pool_destroy2(pool2_task);
        pool_destroy2(pool2_capture);
index 0fe625a25e9885c51532e1bb82d7f541f8290b9f..b188b0e813ec323c8aec8ef62113c3bc8829a0dd 100644 (file)
@@ -1820,7 +1820,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
        memset(socket, 0, sizeof(*socket));
 
        /* Check if the various memory pools are intialized. */
-       if (!pool2_session || !pool2_channel || !pool2_buffer) {
+       if (!pool2_session || !pool2_buffer) {
                hlua_pusherror(L, "socket: uninitialized pools.");
                goto out_fail_conf;
        }
index 4e09c3468fb01c5cefe2c85440b032f00dbfe813..2dc6765de314cbe75977bba3bc89aca0ecf7e751 100644 (file)
@@ -661,7 +661,6 @@ static void session_free(struct session *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_channel);
                pool_flush2(pool2_hdr_idx);
                pool_flush2(pool2_requri);
                pool_flush2(pool2_capture);