]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MAJOR] ported the captures to use the new mempool v2
authorWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 19:45:51 +0000 (21:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 13 May 2007 19:45:51 +0000 (21:45 +0200)
The "capture.c" file has also been removed since it was empty.

Makefile
Makefile.bsd
Makefile.osx
include/types/capture.h
src/capture.c [deleted file]
src/haproxy.c
src/proto_http.c
src/session.c

index 122f1c6fa8f4b909b0b7452d64ba66ca4318e0f1..37439c30edd278f6cba5fa766e67e1a3bd2922a0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -215,7 +215,7 @@ all: haproxy
 OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \
        src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \
        src/time.o src/fd.o src/regex.o src/cfgparse.o src/server.o \
-       src/checks.o src/queue.o src/capture.o src/client.o src/proxy.o \
+       src/checks.o src/queue.o src/client.o src/proxy.o \
        src/proto_http.o src/stream_sock.o src/appsession.o src/backend.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/acl.o src/memory.o
 
index 945b08e24cda941e58d1a82d179c8698b55a1e8e..cc80040861c43b046d95e85716fe895f800d1780 100644 (file)
@@ -85,7 +85,7 @@ LDFLAGS = -g
 OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \
        src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \
        src/time.o src/fd.o src/regex.o src/cfgparse.o src/server.o \
-       src/checks.o src/queue.o src/capture.o src/client.o src/proxy.o \
+       src/checks.o src/queue.o src/client.o src/proxy.o \
        src/proto_http.o src/stream_sock.o src/appsession.o src/backend.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/ev_poll.o \
        src/ev_kqueue.o src/acl.o src/memory.o
index 0618e68c9c299aec7a7d91972bd7c7ce949d63e5..5cf4f08fd9400c43cfccca8b79cc31ccb311de54 100644 (file)
@@ -85,7 +85,7 @@ LDFLAGS = -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
 OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \
        src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \
        src/time.o src/fd.o src/regex.o src/cfgparse.o src/server.o \
-       src/checks.o src/queue.o src/capture.o src/client.o src/proxy.o \
+       src/checks.o src/queue.o src/client.o src/proxy.o \
        src/proto_http.o src/stream_sock.o src/appsession.o src/backend.o \
        src/session.o src/hdr_idx.o src/ev_select.o src/ev_poll.o src/acl.o \
        src/memory.o
index d0271a2e24849f0c75a72fb998d70571556666b8..49f4d535ac18d00da73d347f6ec80ce4517edcf7 100644 (file)
@@ -2,7 +2,7 @@
   include/types/capture.h
   This file defines everything related to captures.
 
-  Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
+  Copyright (C) 2000-2007 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,6 +23,7 @@
 #define _TYPES_CAPTURE_H
 
 #include <common/config.h>
+#include <common/memory.h>
 
 struct cap_hdr {
     struct cap_hdr *next;
@@ -33,7 +34,7 @@ struct cap_hdr {
     void *pool;                                /* pool of pre-allocated memory area of (len+1) bytes */
 };
 
-extern void **pool_capture;
+extern struct pool_head *pool2_capture;
 
 #endif /* _TYPES_CAPTURE_H */
 
diff --git a/src/capture.c b/src/capture.c
deleted file mode 100644 (file)
index c0c4a75..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Capture variables and functions.
- *
- * Copyright 2000-2006 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
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- */
-
-#include <stdlib.h>
-
-#include <common/config.h>
-#include <types/capture.h>
-
-void **pool_capture  = NULL;
-
-
-/*
- * Local variables:
- *  c-indent-level: 8
- *  c-basic-offset: 8
- * End:
- */
index ed26a54e5bcf8dff8d24d3d6d647dabe84605333..344238976dc7f93603f85bec4fdef0332cfeca4a 100644 (file)
@@ -666,7 +666,7 @@ void deinit(void)
        pool_destroy2(pool2_buffer);
        pool_destroy2(pool2_requri);
        pool_destroy2(pool2_task);
-       pool_destroy(pool_capture);
+       pool_destroy2(pool2_capture);
        pool_destroy2(pool2_appsess);
        pool_destroy2(pool2_pendconn);
     
index 39d2a463a47c22e61f46899524ce793ed5503d2d..64ab50799e93522c0cbb502ef0088acf38ec8bf6 100644 (file)
@@ -246,6 +246,7 @@ void init_proto_http()
 
        /* memory allocations */
        pool2_requri = create_pool("requri", REQURI_LEN, MEM_F_SHARED);
+       pool2_capture = create_pool("capture", CAPTURE_LEN, MEM_F_SHARED);
 }
 
 /*
@@ -628,6 +629,7 @@ const char sess_set_cookie[8] = "N1I3PD5R"; /* No set-cookie, unknown, Set-Cooki
                                                   Set-cookie seen and left unchanged (passive), Set-cookie Deleted,
                                                   unknown, Set-cookie Rewritten */
 struct pool_head *pool2_requri;
+struct pool_head *pool2_capture;
 
 /*
  * send a log for the session when we have enough info about it.
@@ -4172,7 +4174,7 @@ void manage_client_side_cookies(struct session *t, struct buffer *req)
                                    memcmp(p1, t->fe->capture_name, t->fe->capture_namelen) == 0) {
                                        int log_len = p4 - p1;
 
-                                       if ((txn->cli_cookie = pool_alloc(capture)) == NULL) {
+                                       if ((txn->cli_cookie = pool_alloc2(pool2_capture)) == NULL) {
                                                Alert("HTTP logging : out of memory.\n");
                                        } else {
                                                if (log_len > t->fe->capture_len)
@@ -4707,7 +4709,7 @@ void manage_server_side_cookies(struct session *t, struct buffer *rtr)
                            memcmp(p1, t->be->capture_name, t->be->capture_namelen) == 0) {
                                int log_len = p4 - p1;
 
-                               if ((txn->srv_cookie = pool_alloc(capture)) == NULL) {
+                               if ((txn->srv_cookie = pool_alloc2(pool2_capture)) == NULL) {
                                        Alert("HTTP logging : out of memory.\n");
                                }
 
index 4efc1cebe7484ef6cf55f5fa552034a836f67d2c..38889c4e22fb4e8022b0bb938561894e5bf2e0ca 100644 (file)
@@ -67,9 +67,9 @@ void session_free(struct session *s)
        if (txn->uri)
                pool_free2(pool2_requri, txn->uri);
        if (txn->cli_cookie)
-               pool_free(capture, txn->cli_cookie);
+               pool_free2(pool2_capture, txn->cli_cookie);
        if (txn->srv_cookie)
-               pool_free(capture, txn->srv_cookie);
+               pool_free2(pool2_capture, txn->srv_cookie);
 
        pool_free2(pool2_session, s);
 }