]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MAJOR] ported requri to use mempools v2
authorWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 19:36:56 +0000 (21:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 19:36:56 +0000 (21:36 +0200)
include/common/memory.h
include/proto/log.h
include/types/log.h
src/haproxy.c
src/proto_http.c
src/session.c

index 0f142f028445e39a792e24b08b903b4cf0ba3cc1..c50ab9a8376914e7a31609ebe661272e6baf20ef 100644 (file)
@@ -27,7 +27,6 @@
 #include <common/config.h>
 #include <common/mini-clist.h>
 
-#define sizeof_requri   REQURI_LEN
 #define sizeof_capture  CAPTURE_LEN
 /*
  * Returns a pointer to an area of <__len> bytes taken from the pool <pool> or
index 4ed56ddf3df8b5f97bce76ea2ef4561312aa075d..1a02ec12205469f9f236a5c16c41d48148108e19 100644 (file)
 #include <syslog.h>
 
 #include <common/config.h>
+#include <common/memory.h>
 #include <types/log.h>
 #include <types/proxy.h>
 #include <types/session.h>
 
+extern struct pool_head *pool2_requri;
+
 /*
  * Displays the message on stderr with the date and pid. Overrides the quiet
  * mode during startup.
index dc04e658079b1d5b36e479ab5cc4dcbbe1c29ddf..12f8e27675220f59177d8a33ae2ec6d142363ad7 100644 (file)
@@ -44,8 +44,6 @@
 #define LW_REQHDR      1024    /* request header(s) */
 #define LW_RSPHDR      2048    /* response header(s) */
 
-extern void **pool_requri;
-
 
 #endif /* _TYPES_LOG_H */
 
index 7f5641c4f568b29f1d6ae137db70fddaf2afee38..ed26a54e5bcf8dff8d24d3d6d647dabe84605333 100644 (file)
@@ -664,7 +664,7 @@ void deinit(void)
     
        pool_destroy2(pool2_session);
        pool_destroy2(pool2_buffer);
-       pool_destroy(pool_requri);
+       pool_destroy2(pool2_requri);
        pool_destroy2(pool2_task);
        pool_destroy(pool_capture);
        pool_destroy2(pool2_appsess);
index 51d265cb908de70f867e0a2481e646d5dfdb263b..39d2a463a47c22e61f46899524ce793ed5503d2d 100644 (file)
@@ -243,6 +243,9 @@ void init_proto_http()
                FD_SET(*tmp, url_encode_map);
                tmp++;
        }
+
+       /* memory allocations */
+       pool2_requri = create_pool("requri", REQURI_LEN, MEM_F_SHARED);
 }
 
 /*
@@ -624,7 +627,7 @@ const char sess_cookie[4]     = "NIDV";             /* No cookie, Invalid cookie, cookie fo
 const char sess_set_cookie[8] = "N1I3PD5R";    /* No set-cookie, unknown, Set-Cookie Inserted, unknown,
                                                   Set-cookie seen and left unchanged (passive), Set-cookie Deleted,
                                                   unknown, Set-cookie Rewritten */
-void **pool_requri = NULL;
+struct pool_head *pool2_requri;
 
 /*
  * send a log for the session when we have enough info about it.
@@ -1592,7 +1595,7 @@ int process_cli(struct session *t)
                 */
                if (unlikely(t->logs.logwait & LW_REQ)) {
                        /* we have a complete HTTP request that we must log */
-                       if ((txn->uri = pool_alloc(requri)) != NULL) {
+                       if ((txn->uri = pool_alloc2(pool2_requri)) != NULL) {
                                int urilen = msg->sl.rq.l;
 
                                if (urilen >= REQURI_LEN)
index 1b574a00bb9c50c5a2c4af9b0864ff927250f794..4efc1cebe7484ef6cf55f5fa552034a836f67d2c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <proto/buffers.h>
 #include <proto/hdr_idx.h>
+#include <proto/log.h>
 #include <proto/session.h>
 #include <proto/queue.h>
 
@@ -64,7 +65,7 @@ void session_free(struct session *s)
        }
 
        if (txn->uri)
-               pool_free(requri, txn->uri);
+               pool_free2(pool2_requri, txn->uri);
        if (txn->cli_cookie)
                pool_free(capture, txn->cli_cookie);
        if (txn->srv_cookie)