mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-01 00:50:53 +00:00
[MAJOR] ported the captures to use the new mempool v2
The "capture.c" file has also been removed since it was empty.
This commit is contained in:
parent
332f8bfc5b
commit
086b3b4c9f
2
Makefile
2
Makefile
@ -215,7 +215,7 @@ all: haproxy
|
|||||||
OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \
|
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/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/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/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
|
src/session.o src/hdr_idx.o src/ev_select.o src/acl.o src/memory.o
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ LDFLAGS = -g
|
|||||||
OBJS = src/haproxy.o src/list.o src/chtbl.o src/hashpjw.o src/base64.o \
|
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/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/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/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/session.o src/hdr_idx.o src/ev_select.o src/ev_poll.o \
|
||||||
src/ev_kqueue.o src/acl.o src/memory.o
|
src/ev_kqueue.o src/acl.o src/memory.o
|
||||||
|
@ -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 \
|
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/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/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/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/session.o src/hdr_idx.o src/ev_select.o src/ev_poll.o src/acl.o \
|
||||||
src/memory.o
|
src/memory.o
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
include/types/capture.h
|
include/types/capture.h
|
||||||
This file defines everything related to captures.
|
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
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
@ -23,6 +23,7 @@
|
|||||||
#define _TYPES_CAPTURE_H
|
#define _TYPES_CAPTURE_H
|
||||||
|
|
||||||
#include <common/config.h>
|
#include <common/config.h>
|
||||||
|
#include <common/memory.h>
|
||||||
|
|
||||||
struct cap_hdr {
|
struct cap_hdr {
|
||||||
struct cap_hdr *next;
|
struct cap_hdr *next;
|
||||||
@ -33,7 +34,7 @@ struct cap_hdr {
|
|||||||
void *pool; /* pool of pre-allocated memory area of (len+1) bytes */
|
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 */
|
#endif /* _TYPES_CAPTURE_H */
|
||||||
|
|
||||||
|
@ -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:
|
|
||||||
*/
|
|
@ -666,7 +666,7 @@ void deinit(void)
|
|||||||
pool_destroy2(pool2_buffer);
|
pool_destroy2(pool2_buffer);
|
||||||
pool_destroy2(pool2_requri);
|
pool_destroy2(pool2_requri);
|
||||||
pool_destroy2(pool2_task);
|
pool_destroy2(pool2_task);
|
||||||
pool_destroy(pool_capture);
|
pool_destroy2(pool2_capture);
|
||||||
pool_destroy2(pool2_appsess);
|
pool_destroy2(pool2_appsess);
|
||||||
pool_destroy2(pool2_pendconn);
|
pool_destroy2(pool2_pendconn);
|
||||||
|
|
||||||
|
@ -246,6 +246,7 @@ void init_proto_http()
|
|||||||
|
|
||||||
/* memory allocations */
|
/* memory allocations */
|
||||||
pool2_requri = create_pool("requri", REQURI_LEN, MEM_F_SHARED);
|
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,
|
Set-cookie seen and left unchanged (passive), Set-cookie Deleted,
|
||||||
unknown, Set-cookie Rewritten */
|
unknown, Set-cookie Rewritten */
|
||||||
struct pool_head *pool2_requri;
|
struct pool_head *pool2_requri;
|
||||||
|
struct pool_head *pool2_capture;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* send a log for the session when we have enough info about it.
|
* 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) {
|
memcmp(p1, t->fe->capture_name, t->fe->capture_namelen) == 0) {
|
||||||
int log_len = p4 - p1;
|
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");
|
Alert("HTTP logging : out of memory.\n");
|
||||||
} else {
|
} else {
|
||||||
if (log_len > t->fe->capture_len)
|
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) {
|
memcmp(p1, t->be->capture_name, t->be->capture_namelen) == 0) {
|
||||||
int log_len = p4 - p1;
|
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");
|
Alert("HTTP logging : out of memory.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ void session_free(struct session *s)
|
|||||||
if (txn->uri)
|
if (txn->uri)
|
||||||
pool_free2(pool2_requri, txn->uri);
|
pool_free2(pool2_requri, txn->uri);
|
||||||
if (txn->cli_cookie)
|
if (txn->cli_cookie)
|
||||||
pool_free(capture, txn->cli_cookie);
|
pool_free2(pool2_capture, txn->cli_cookie);
|
||||||
if (txn->srv_cookie)
|
if (txn->srv_cookie)
|
||||||
pool_free(capture, txn->srv_cookie);
|
pool_free2(pool2_capture, txn->srv_cookie);
|
||||||
|
|
||||||
pool_free2(pool2_session, s);
|
pool_free2(pool2_session, s);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user