mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
MINOR: capture: extend the captures to support non-header keys
This patch adds support for captures with no header name. The purpose is to allow extra captures to be defined and logged along with the header captures.
This commit is contained in:
parent
5b4bf70a95
commit
54da8db40b
@ -27,8 +27,8 @@
|
||||
|
||||
struct cap_hdr {
|
||||
struct cap_hdr *next;
|
||||
char *name; /* header name, case insensitive */
|
||||
int namelen; /* length of the header name, to speed-up lookups */
|
||||
char *name; /* header name, case insensitive, NULL if not header */
|
||||
int namelen; /* length of the header name, to speed-up lookups, 0 if !name */
|
||||
int len; /* capture length, not including terminal zero */
|
||||
int index; /* index in the output array */
|
||||
struct pool_head *pool; /* pool of pre-allocated memory area of (len+1) bytes */
|
||||
|
||||
@ -1029,7 +1029,7 @@ struct pool_head *pool2_uniqueid;
|
||||
|
||||
/*
|
||||
* Capture headers from message starting at <som> according to header list
|
||||
* <cap_hdr>, and fill the <idx> structure appropriately.
|
||||
* <cap_hdr>, and fill the <cap> pointers appropriately.
|
||||
*/
|
||||
void capture_headers(char *som, struct hdr_idx *idx,
|
||||
char **cap, struct cap_hdr *cap_hdr)
|
||||
@ -1054,7 +1054,7 @@ void capture_headers(char *som, struct hdr_idx *idx,
|
||||
sov++;
|
||||
|
||||
for (h = cap_hdr; h; h = h->next) {
|
||||
if ((h->namelen == col - sol) &&
|
||||
if (h->namelen && (h->namelen == col - sol) &&
|
||||
(strncasecmp(sol, h->name, h->namelen) == 0)) {
|
||||
if (cap[h->index] == NULL)
|
||||
cap[h->index] =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user