Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
831318ad
Commit
831318ad
authored
Oct 28, 2011
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tempcommit: works for single lines
parent
670f56f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+47
-0
No files found.
bin/varnishncsa/varnishncsa.c
View file @
831318ad
...
@@ -105,6 +105,8 @@ static struct logline {
...
@@ -105,6 +105,8 @@ static struct logline {
uint64_t
bitmap
;
/* Bitmap for regex matches */
uint64_t
bitmap
;
/* Bitmap for regex matches */
VTAILQ_HEAD
(,
hdr
)
req_headers
;
/* Request headers */
VTAILQ_HEAD
(,
hdr
)
req_headers
;
/* Request headers */
VTAILQ_HEAD
(,
hdr
)
resp_headers
;
/* Response headers */
VTAILQ_HEAD
(,
hdr
)
resp_headers
;
/* Response headers */
char
*
log1
;
/* How the request was handled (hit/miss/pass/pipe) */
// VTAILQ_HEAD(, hdr) vcl_log; /* vcl.log() entries */
}
**
ll
;
}
**
ll
;
struct
VSM_data
*
vd
;
struct
VSM_data
*
vd
;
...
@@ -216,6 +218,23 @@ resp_header(struct logline *l, const char *name)
...
@@ -216,6 +218,23 @@ resp_header(struct logline *l, const char *name)
return
NULL
;
return
NULL
;
}
}
static
char
*
vcl_log
(
struct
logline
*
l
,
const
char
*
name
)
{
struct
hdr
*
h
;
// JEJE
VTAILQ_FOREACH
(
h
,
&
l
->
resp_headers
,
list
)
{
if
(
strcasecmp
(
h
->
key
,
name
)
==
0
)
{
return
h
->
value
;
break
;
}
}
return
NULL
;
}
static
void
static
void
clean_logline
(
struct
logline
*
lp
)
clean_logline
(
struct
logline
*
lp
)
{
{
...
@@ -462,6 +481,28 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
...
@@ -462,6 +481,28 @@ collect_client(struct logline *lp, enum VSL_tag_e tag, unsigned spec,
}
}
break
;
break
;
case
SLT_VCL_Log
:
if
(
!
lp
->
active
)
break
;
lp
->
log1
=
trimline
(
ptr
,
end
);
/*
if (strncmp(ptr, "hit", len) == 0) {
lp->df_hitmiss = "hit";
lp->df_handling = "hit";
} else if (strncmp(ptr, "miss", len) == 0) {
lp->df_hitmiss = "miss";
lp->df_handling = "miss";
} else if (strncmp(ptr, "pass", len) == 0) {
lp->df_hitmiss = "miss";
lp->df_handling = "pass";
} else if (strncmp(ptr, "pipe", len) == 0) {
clean_logline(lp);
break;
}
*/
break
;
case
SLT_VCL_call
:
case
SLT_VCL_call
:
if
(
!
lp
->
active
)
if
(
!
lp
->
active
)
break
;
break
;
...
@@ -690,6 +731,7 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
...
@@ -690,6 +731,7 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
memcpy
(
fname
,
p
+
1
,
tmp
-
p
-
2
);
memcpy
(
fname
,
p
+
1
,
tmp
-
p
-
2
);
fname
[
tmp
-
p
-
2
]
=
0
;
fname
[
tmp
-
p
-
2
]
=
0
;
}
}
// printf("fname is: %s", fname);
switch
(
type
)
{
switch
(
type
)
{
case
'i'
:
case
'i'
:
...
@@ -715,7 +757,12 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
...
@@ -715,7 +757,12 @@ h_ncsa(void *priv, enum VSL_tag_e tag, unsigned fd,
VSB_cat
(
os
,
(
lp
->
df_handling
?
lp
->
df_handling
:
"-"
));
VSB_cat
(
os
,
(
lp
->
df_handling
?
lp
->
df_handling
:
"-"
));
p
=
tmp
;
p
=
tmp
;
break
;
break
;
}
else
if
(
strcmp
(
fname
,
"Varnish:vcllog"
)
==
0
)
{
VSB_cat
(
os
,
(
lp
->
log1
?
lp
->
log1
:
"-"
));
p
=
tmp
;
break
;
}
}
default:
default:
fprintf
(
stderr
,
"Unknown format starting at: %s
\n
"
,
--
p
);
fprintf
(
stderr
,
"Unknown format starting at: %s
\n
"
,
--
p
);
exit
(
1
);
exit
(
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment