Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
524b9dcb
Commit
524b9dcb
authored
Apr 16, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cleanup
parent
cf5cd43d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+11
-19
No files found.
bin/varnishncsa/varnishncsa.c
View file @
524b9dcb
...
...
@@ -487,7 +487,7 @@ addf_int32(int32_t *i)
}
static
void
addf_time
(
char
type
,
const
char
*
fmt
,
const
char
*
str
)
addf_time
(
char
type
,
const
char
*
fmt
)
{
struct
format
*
f
;
...
...
@@ -499,10 +499,6 @@ addf_time(char type, const char *fmt, const char *str)
f
->
time_fmt
=
strdup
(
fmt
);
AN
(
f
->
time_fmt
);
}
if
(
str
!=
NULL
)
{
f
->
string
=
strdup
(
str
);
AN
(
f
->
string
);
}
VTAILQ_INSERT_TAIL
(
&
CTX
.
format
,
f
,
list
);
}
...
...
@@ -526,8 +522,7 @@ addf_vcl_log(const char *key, const char *str)
AN
(
key
);
ALLOC_OBJ
(
w
,
WATCH_MAGIC
);
AN
(
w
);
w
->
key
=
strdup
(
key
);
AN
(
w
->
key
);
assert
(
asprintf
(
&
w
->
key
,
"%s:"
,
key
)
>
0
);
w
->
keylen
=
strlen
(
w
->
key
);
VTAILQ_INSERT_TAIL
(
&
CTX
.
watch_vcl_log
,
w
,
list
);
...
...
@@ -727,7 +722,7 @@ parse_format(const char *format)
addf_fragment
(
&
CTX
.
frag
[
F_b
],
"-"
);
break
;
case
'D'
:
/* Float request time */
addf_time
(
*
p
,
NULL
,
NULL
);
addf_time
(
*
p
,
NULL
);
break
;
case
'h'
:
/* Client host name / IP Address */
addf_fragment
(
&
CTX
.
frag
[
F_h
],
"-"
);
...
...
@@ -757,10 +752,10 @@ parse_format(const char *format)
addf_fragment
(
&
CTX
.
frag
[
F_s
],
"-"
);
break
;
case
't'
:
/* strftime */
addf_time
(
*
p
,
TIME_FMT
,
NULL
);
addf_time
(
*
p
,
TIME_FMT
);
break
;
case
'T'
:
/* Int request time */
addf_time
(
*
p
,
NULL
,
NULL
);
addf_time
(
*
p
,
NULL
);
break
;
case
'u'
:
/* Remote user from auth */
addf_auth
(
"-"
);
...
...
@@ -790,7 +785,7 @@ parse_format(const char *format)
addf_hdr
(
&
CTX
.
watch_resphdr
,
buf
,
"-"
);
break
;
case
't'
:
addf_time
(
*
q
,
buf
,
NULL
);
addf_time
(
*
q
,
buf
);
break
;
case
'x'
:
parse_x_format
(
buf
);
...
...
@@ -903,11 +898,12 @@ static void
process_hdr
(
const
struct
watch_head
*
head
,
const
char
*
b
,
const
char
*
e
)
{
struct
watch
*
w
;
const
char
*
p
;
VTAILQ_FOREACH
(
w
,
head
,
list
)
{
if
(
e
-
b
<
w
->
keylen
||
strncasecmp
(
b
,
w
->
key
,
w
->
keylen
))
if
(
!
isprefix
(
w
->
key
,
w
->
keylen
,
b
,
e
,
&
p
))
continue
;
frag_line
(
1
,
b
+
w
->
keylen
,
e
,
&
w
->
frag
);
frag_line
(
1
,
p
,
e
,
&
w
->
frag
);
}
}
...
...
@@ -942,6 +938,7 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
const
char
*
b
,
*
e
,
*
p
;
struct
watch
*
w
;
int
i
,
skip
,
be_mark
;
(
void
)
vsl
;
(
void
)
priv
;
...
...
@@ -1087,15 +1084,10 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
case
SLT_VCL_Log
:
VTAILQ_FOREACH
(
w
,
&
CTX
.
watch_vcl_log
,
list
)
{
CHECK_OBJ_NOTNULL
(
w
,
WATCH_MAGIC
);
if
(
e
-
b
<
=
w
->
keylen
||
if
(
e
-
b
<
w
->
keylen
||
strncmp
(
b
,
w
->
key
,
w
->
keylen
))
continue
;
p
=
b
+
w
->
keylen
;
if
(
*
p
!=
':'
)
continue
;
p
++
;
if
(
p
>
e
)
continue
;
frag_line
(
0
,
p
,
e
,
&
w
->
frag
);
}
break
;
...
...
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