Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
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
varnishevent3
Commits
c4752004
Commit
c4752004
authored
Jan 29, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varnishevent - check against exceeding max_headers
parent
a1da0e1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
30 deletions
+31
-30
varnishevent.c
bin/varnishevent/varnishevent.c
+31
-30
No files found.
bin/varnishevent/varnishevent.c
View file @
c4752004
...
...
@@ -100,12 +100,8 @@ typedef struct fd_t {
static
fd_t
*
fd_tbl
;
static
unsigned
seen
=
0
;
static
unsigned
open
=
0
;
static
unsigned
submitted
=
0
;
static
unsigned
occ_hi
=
0
;
static
unsigned
waits
=
0
;
static
unsigned
len_overflows
=
0
;
static
unsigned
seen
=
0
,
open
=
0
,
submitted
=
0
,
occ_hi
=
0
,
waits
=
0
,
len_overflows
=
0
,
hdr_overflows
=
0
;
static
volatile
sig_atomic_t
reopen
;
...
...
@@ -132,10 +128,11 @@ void
RDR_Stats
(
void
)
{
LOG_Log
(
LOG_INFO
,
"Reader (%s): fd_max=%u seen=%u open=%u load=%.2f "
"submitted=%u occ_hi=%u waits=%u free=%u len_overflows=%u"
,
"submitted=%u occ_hi=%u waits=%u free=%u len_overflows=%u "
"hdr_overflows=%u"
,
waiting
?
"waiting"
:
"running"
,
config
.
max_fd
,
seen
,
open
,
100
.
0
*
open
/
config
.
max_fd
,
submitted
,
occ_hi
,
waits
,
rdr_free
,
len_overflows
);
len_overflows
,
hdr_overflows
);
}
static
inline
logline_t
...
...
@@ -180,8 +177,8 @@ static inline void
collect
(
struct
logline_t
*
lp
,
enum
VSL_tag_e
tag
,
unsigned
spec
,
const
char
*
ptr
,
unsigned
len
)
{
char
*
dest
;
unsigned
*
llen
;
hdr_t
*
hdr
=
NULL
;
record_t
*
rec
=
NULL
;
if
(
spec
&
VSL_S_BACKEND
||
spec
&
VSL_S_CLIENT
)
{
if
(
!
lp
->
spec
)
...
...
@@ -191,32 +188,36 @@ collect(struct logline_t *lp, enum VSL_tag_e tag, unsigned spec,
}
if
(
len
>
config
.
max_reclen
)
{
LOG_Log
(
LOG_ALERT
,
"Data length %u exceeds max %u [%.*s]"
,
len
,
config
.
max_reclen
,
len
,
ptr
);
LOG_Log
(
LOG_ALERT
,
"Data length %u exceeds max %u, DATA TRUNCATED: %s [%.*s]"
,
len
,
config
.
max_reclen
,
VSL_tags
[
tag
],
len
,
ptr
);
len_overflows
++
;
len
=
config
.
max_reclen
;
}
/* XXX: check against overflow for lp->nrec */
if
(
tag
==
SLT_RxHeader
)
{
dest
=
lp
->
rx_headers
.
record
[
lp
->
rx_headers
.
nrec
].
data
;
llen
=
&
lp
->
rx_headers
.
record
[
lp
->
rx_headers
.
nrec
++
].
len
;
}
else
if
(
tag
==
SLT_TxHeader
)
{
dest
=
lp
->
tx_headers
.
record
[
lp
->
tx_headers
.
nrec
].
data
;
llen
=
&
lp
->
tx_headers
.
record
[
lp
->
tx_headers
.
nrec
++
].
len
;
}
else
if
(
tag
==
SLT_VCL_Log
)
{
dest
=
lp
->
vcl_log
.
record
[
lp
->
vcl_log
.
nrec
].
data
;
llen
=
&
lp
->
vcl_log
.
record
[
lp
->
vcl_log
.
nrec
++
].
len
;
}
if
(
tag
==
SLT_RxHeader
)
hdr
=
&
lp
->
rx_headers
;
else
if
(
tag
==
SLT_TxHeader
)
hdr
=
&
lp
->
tx_headers
;
else
if
(
tag
==
SLT_VCL_Log
)
hdr
=
&
lp
->
vcl_log
;
if
(
hdr
!=
NULL
)
{
if
(
hdr
->
nrec
<
config
.
max_headers
)
rec
=
&
hdr
->
record
[
hdr
->
nrec
++
];
else
{
dest
=
lp
->
tag
[
tag
].
data
;
llen
=
&
lp
->
tag
[
tag
].
len
;
LOG_Log
(
LOG_ALERT
,
"Number of headers exceeds max %u, DATA DISCARDED: %s [%.*s]"
,
config
.
max_headers
,
VSL_tags
[
tag
],
len
,
ptr
);
hdr_overflows
++
;
return
;
}
}
else
rec
=
&
lp
->
tag
[
tag
];
memcpy
(
dest
,
ptr
,
len
);
*
l
len
=
len
;
memcpy
(
rec
->
data
,
ptr
,
len
);
rec
->
len
=
len
;
switch
(
tag
)
{
case
SLT_BackendReuse
:
...
...
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