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
7b8e01ef
Commit
7b8e01ef
authored
Mar 12, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite the TCP_KEEPALIVE prober to use VTCP_listen_on()
parent
dc80d950
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
mgt_param_tcp.c
bin/varnishd/mgt/mgt_param_tcp.c
+8
-20
No files found.
bin/varnishd/mgt/mgt_param_tcp.c
View file @
7b8e01ef
...
...
@@ -46,7 +46,6 @@
#include "mgt/mgt.h"
#include "common/params.h"
#include "vss.h"
#include "vtcp.h"
#include "mgt/mgt_param.h"
...
...
@@ -94,31 +93,20 @@ tcp_probe(int sock, int nam, const char *param, unsigned def)
MCF_SetDefault
(
param
,
p
);
}
static
int
__match_proto__
(
vss_resolve_f
)
tkp_callback
(
void
*
priv
,
const
struct
suckaddr
*
sa
)
{
int
s
;
(
void
)
priv
;
s
=
VTCP_listen
(
sa
,
10
,
NULL
);
if
(
s
>=
0
)
{
tcp_probe
(
s
,
TCP_KEEPIDLE
,
"tcp_keepalive_time"
,
600
);
tcp_probe
(
s
,
TCP_KEEPCNT
,
"tcp_keepalive_probes"
,
5
);
tcp_probe
(
s
,
TCP_KEEPINTVL
,
"tcp_keepalive_intvl"
,
5
);
AZ
(
close
(
s
));
return
(
1
);
}
return
(
0
);
}
static
void
tcp_keep_probes
(
void
)
{
const
char
*
err
;
/* Probe a dummy socket for default values */
(
void
)
VSS_resolver
(
":0"
,
NULL
,
tkp_callback
,
NULL
,
&
err
);
int
s
;
s
=
VTCP_listen_on
(
":0"
,
NULL
,
10
,
&
err
);
if
(
err
!=
NULL
)
ARGV_ERR
(
"Could not probe TCP keepalives: %s"
,
err
);
assert
(
s
>
0
);
tcp_probe
(
s
,
TCP_KEEPIDLE
,
"tcp_keepalive_time"
,
600
);
tcp_probe
(
s
,
TCP_KEEPCNT
,
"tcp_keepalive_probes"
,
5
);
tcp_probe
(
s
,
TCP_KEEPINTVL
,
"tcp_keepalive_intvl"
,
5
);
AZ
(
close
(
s
));
}
#endif
...
...
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