[MAJOR] ported the captures to use the new mempool v2
The "capture.c" file has also been removed since it was empty.
diff --git a/Makefile b/Makefile
index 122f1c6..37439c3 100644
--- a/Makefile
+++ b/Makefile
@@ -215,7 +215,7 @@
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
diff --git a/Makefile.bsd b/Makefile.bsd
index 945b08e..cc80040 100644
--- a/Makefile.bsd
+++ b/Makefile.bsd
@@ -85,7 +85,7 @@
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
diff --git a/Makefile.osx b/Makefile.osx
index 0618e68..5cf4f08 100644
--- a/Makefile.osx
+++ b/Makefile.osx
@@ -85,7 +85,7 @@
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
diff --git a/include/types/capture.h b/include/types/capture.h
index d0271a2..49f4d53 100644
--- a/include/types/capture.h
+++ b/include/types/capture.h
@@ -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 @@
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
index c0c4a75..0000000
--- a/src/capture.c
+++ /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:
- */
diff --git a/src/haproxy.c b/src/haproxy.c
index ed26a54..3442389 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -666,7 +666,7 @@
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);
diff --git a/src/proto_http.c b/src/proto_http.c
index 39d2a46..64ab507 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -246,6 +246,7 @@
/* 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 @@
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 @@
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 @@
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");
}
diff --git a/src/session.c b/src/session.c
index 4efc1ce..38889c4 100644
--- a/src/session.c
+++ b/src/session.c
@@ -67,9 +67,9 @@
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);
}