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
726b7926
Commit
726b7926
authored
Mar 31, 2015
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -t VSM open timeout option
This option controls the timeout for the initial VSM open operation
parent
3bfcf8b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
vut.h
include/vut.h
+1
-0
vut_options.h
include/vut_options.h
+12
-0
vut.c
lib/libvarnishtools/vut.c
+11
-0
No files found.
include/vut.h
View file @
726b7926
...
...
@@ -43,6 +43,7 @@ struct VUT {
char
*
P_arg
;
char
*
q_arg
;
char
*
r_arg
;
double
t_arg
;
/* State */
struct
VSL_data
*
vsl
;
...
...
include/vut_options.h
View file @
726b7926
...
...
@@ -84,6 +84,18 @@
"Read log in binary file format from this file." \
)
#define VUT_OPT_t \
VOPT("t:", "[-t seconds|<off>]", "VSM connection timeout", \
"Timeout before returning error on initial VSM connection." \
" If set the VSM connection is retried every 0.5 seconds" \
" for this many seconds. If zero the connection is" \
" attempted only once and will fail immediately if" \
" unsuccessful. If set to \"off\", the connection will not" \
" fail, allowing the utility to start and wait" \
" indefinetely for the Varnish instance to appear. " \
" Defaults to 5 seconds." \
)
#define VUT_OPT_V \
VOPT("V", "[-V]", "Version", \
"Print version information and exit." \
...
...
lib/libvarnishtools/vut.c
View file @
726b7926
...
...
@@ -39,6 +39,7 @@
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <math.h>
#include "compat/daemon.h"
#include "vdef.h"
...
...
@@ -49,6 +50,7 @@
#include "vas.h"
#include "miniobj.h"
#include "vcs.h"
#include "vnum.h"
#include "vut.h"
...
...
@@ -134,6 +136,7 @@ VUT_Arg(int opt, const char *arg)
{
int
i
;
char
*
p
;
double
d
;
switch
(
opt
)
{
case
'd'
:
...
...
@@ -182,6 +185,13 @@ VUT_Arg(int opt, const char *arg)
/* Binary file input */
REPLACE
(
VUT
.
r_arg
,
arg
);
return
(
1
);
case
't'
:
/* VSM connect timeout */
d
=
VNUM
(
arg
);
if
(
isnan
(
d
))
VUT_Error
(
1
,
"-t: Syntax error"
);
VUT
.
t_arg
=
d
;
return
(
1
);
case
'V'
:
/* Print version number and exit */
VCS_Message
(
VUT
.
progname
);
...
...
@@ -205,6 +215,7 @@ VUT_Init(const char *progname)
VUT
.
vsl
=
VSL_New
();
AN
(
VUT
.
vsl
);
VUT
.
k_arg
=
-
1
;
VUT
.
t_arg
=
5
.;
}
void
...
...
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