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
e8b3d50e
Commit
e8b3d50e
authored
Feb 01, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't wait for a CLI connection if the varnishd process closed the
debug pipe.
parent
c157e5fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+17
-5
No files found.
bin/varnishtest/vtc_varnish.c
View file @
e8b3d50e
...
...
@@ -237,7 +237,7 @@ varnish_launch(struct varnish *v)
int
i
,
nfd
,
nap
;
struct
vss_addr
**
ap
;
char
abuf
[
128
],
pbuf
[
128
];
struct
pollfd
fd
;
struct
pollfd
fd
[
2
]
;
enum
cli_status_e
u
;
char
*
r
;
...
...
@@ -301,13 +301,25 @@ varnish_launch(struct varnish *v)
AZ
(
pthread_create
(
&
v
->
tp
,
NULL
,
varnish_thread
,
v
));
/* Wait for the varnish to call home */
fd
.
fd
=
v
->
cli_fd
;
fd
.
events
=
POLLIN
;
i
=
poll
(
&
fd
,
1
,
10000
);
if
(
i
!=
1
)
{
fd
[
0
].
fd
=
v
->
cli_fd
;
fd
[
0
].
events
=
POLLIN
;
fd
[
1
].
fd
=
v
->
fds
[
0
];
fd
[
1
].
events
=
POLLOUT
;
i
=
poll
(
fd
,
2
,
10000
);
vtc_log
(
v
->
vl
,
4
,
"CLIPOLL %d 0x%x 0x%x"
,
i
,
fd
[
0
].
revents
,
fd
[
1
].
revents
);
if
(
i
==
0
)
{
vtc_log
(
v
->
vl
,
0
,
"FAIL timeout waiting for CLI connection"
);
return
;
}
if
(
fd
[
1
].
revents
&
POLLHUP
)
{
vtc_log
(
v
->
vl
,
0
,
"FAIL debug pipe closed"
);
return
;
}
if
(
!
(
fd
[
0
].
revents
&
POLLIN
))
{
vtc_log
(
v
->
vl
,
0
,
"FAIL CLI connection wait failure"
);
return
;
}
nfd
=
accept
(
v
->
cli_fd
,
NULL
,
NULL
);
if
(
nfd
<
0
)
{
vtc_log
(
v
->
vl
,
0
,
"FAIL no CLI connection accepted"
);
...
...
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