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
28b91058
Commit
28b91058
authored
Sep 05, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass VUTs to callbacks
With the exception of dispatch_f that already has a dispatch_priv.
parent
f3e67485
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
12 deletions
+22
-12
varnishhist.c
bin/varnishhist/varnishhist.c
+2
-1
varnishlog.c
bin/varnishlog/varnishlog.c
+8
-4
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+6
-3
varnishtop.c
bin/varnishtop/varnishtop.c
+2
-1
vut.h
include/vut.h
+2
-1
vut.c
lib/libvarnishapi/vut.c
+2
-2
No files found.
bin/varnishhist/varnishhist.c
View file @
28b91058
...
...
@@ -366,8 +366,9 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
}
static
int
__match_proto__
(
VUT_cb_f
)
sighup
(
void
)
sighup
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
quit
=
1
;
return
(
1
);
}
...
...
bin/varnishlog/varnishlog.c
View file @
28b91058
...
...
@@ -87,9 +87,10 @@ openout(int append)
}
static
int
__match_proto__
(
VUT_cb_f
)
rotateout
(
void
)
rotateout
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
AN
(
LOG
.
w_arg
);
AN
(
LOG
.
fo
);
fclose
(
LOG
.
fo
);
...
...
@@ -99,9 +100,11 @@ rotateout(void)
}
static
int
__match_proto__
(
VUT_cb_f
)
flushout
(
void
)
flushout
(
struct
VUT
*
v
)
{
if
(
v
!=
NULL
)
assert
(
v
==
&
VUT
);
AN
(
LOG
.
fo
);
if
(
fflush
(
LOG
.
fo
))
return
(
-
5
);
...
...
@@ -109,8 +112,9 @@ flushout(void)
}
static
int
__match_proto__
(
VUT_cb_f
)
sighup
(
void
)
sighup
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
return
(
1
);
}
...
...
@@ -177,7 +181,7 @@ main(int argc, char * const *argv)
VUT_Main
();
VUT_Fini
();
(
void
)
flushout
();
(
void
)
flushout
(
NULL
);
exit
(
0
);
}
bin/varnishncsa/varnishncsa.c
View file @
28b91058
...
...
@@ -183,9 +183,10 @@ openout(int append)
}
static
int
__match_proto__
(
VUT_cb_f
)
rotateout
(
void
)
rotateout
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
AN
(
CTX
.
w_arg
);
AN
(
CTX
.
fo
);
fclose
(
CTX
.
fo
);
...
...
@@ -195,9 +196,10 @@ rotateout(void)
}
static
int
__match_proto__
(
VUT_cb_f
)
flushout
(
void
)
flushout
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
AN
(
CTX
.
fo
);
if
(
fflush
(
CTX
.
fo
))
return
(
-
5
);
...
...
@@ -1104,8 +1106,9 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
}
static
int
__match_proto__
(
VUT_cb_f
)
sighup
(
void
)
sighup
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
return
(
1
);
}
...
...
bin/varnishtop/varnishtop.c
View file @
28b91058
...
...
@@ -178,8 +178,9 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
}
static
int
__match_proto__
(
VUT_cb_f
)
sighup
(
void
)
sighup
(
struct
VUT
*
v
)
{
assert
(
v
==
&
VUT
);
quit
=
1
;
return
(
1
);
}
...
...
include/vut.h
View file @
28b91058
...
...
@@ -29,10 +29,11 @@
* Common functions for the utilities
*/
struct
VUT
;
struct
vopt_spec
;
typedef
void
VUT_sighandler_f
(
int
);
typedef
int
VUT_cb_f
(
void
);
typedef
int
VUT_cb_f
(
struct
VUT
*
);
struct
VUT
{
const
char
*
progname
;
...
...
lib/libvarnishapi/vut.c
View file @
28b91058
...
...
@@ -324,7 +324,7 @@ VUT_Main(void)
if
(
VUT
.
sighup
&&
VUT
.
sighup_f
)
{
/* sighup callback */
VUT
.
sighup
=
0
;
i
=
VUT
.
sighup_f
();
i
=
VUT
.
sighup_f
(
&
VUT
);
if
(
i
)
break
;
}
...
...
@@ -370,7 +370,7 @@ VUT_Main(void)
else
if
(
i
==
0
)
{
/* Nothing to do but wait */
if
(
VUT
.
idle_f
)
{
i
=
VUT
.
idle_f
();
i
=
VUT
.
idle_f
(
&
VUT
);
if
(
i
)
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