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
c99f522f
Commit
c99f522f
authored
Mar 11, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retire VSS_open
parent
01001b90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
59 deletions
+0
-59
vss.h
include/vss.h
+0
-1
vss.c
lib/libvarnish/vss.c
+0
-58
No files found.
include/vss.h
View file @
c99f522f
...
@@ -37,4 +37,3 @@ int VSS_resolver(const char *addr, const char *def_port, vss_resolved_f *func,
...
@@ -37,4 +37,3 @@ int VSS_resolver(const char *addr, const char *def_port, vss_resolved_f *func,
int
VSS_resolve
(
const
char
*
addr
,
const
char
*
port
,
struct
vss_addr
***
ta
);
int
VSS_resolve
(
const
char
*
addr
,
const
char
*
port
,
struct
vss_addr
***
ta
);
int
VSS_bind
(
const
struct
vss_addr
*
addr
);
int
VSS_bind
(
const
struct
vss_addr
*
addr
);
int
VSS_listen
(
const
struct
vss_addr
*
addr
,
int
depth
);
int
VSS_listen
(
const
struct
vss_addr
*
addr
,
int
depth
);
int
VSS_open
(
const
char
*
str
,
double
tmo
);
lib/libvarnish/vss.c
View file @
c99f522f
...
@@ -288,61 +288,3 @@ VSS_listen(const struct vss_addr *va, int depth)
...
@@ -288,61 +288,3 @@ VSS_listen(const struct vss_addr *va, int depth)
}
}
return
(
sd
);
return
(
sd
);
}
}
/*
* Connect to the socket specified by the address info in va.
* Return the socket.
*/
static
int
vss_connect
(
const
struct
vss_addr
*
va
,
int
nonblock
)
{
int
sd
,
i
;
sd
=
socket
(
va
->
va_family
,
va
->
va_socktype
,
va
->
va_protocol
);
if
(
sd
<
0
)
{
if
(
errno
!=
EPROTONOSUPPORT
)
perror
(
"socket()"
);
return
(
-
1
);
}
if
(
nonblock
)
(
void
)
VTCP_nonblocking
(
sd
);
i
=
connect
(
sd
,
(
const
void
*
)
&
va
->
va_addr
,
va
->
va_addrlen
);
if
(
i
==
0
||
(
nonblock
&&
errno
==
EINPROGRESS
))
return
(
sd
);
perror
(
"connect()"
);
(
void
)
close
(
sd
);
return
(
-
1
);
}
/*
* And the totally brutal version: Give me connection to this address
*/
int
VSS_open
(
const
char
*
str
,
double
tmo
)
{
int
retval
=
-
1
;
int
nvaddr
,
n
,
i
;
struct
vss_addr
**
vaddr
;
struct
pollfd
pfd
;
nvaddr
=
VSS_resolve
(
str
,
NULL
,
&
vaddr
);
for
(
n
=
0
;
n
<
nvaddr
;
n
++
)
{
retval
=
vss_connect
(
vaddr
[
n
],
tmo
!=
0
.
0
);
if
(
retval
>=
0
&&
tmo
!=
0
.
0
)
{
pfd
.
fd
=
retval
;
pfd
.
events
=
POLLOUT
;
i
=
poll
(
&
pfd
,
1
,
tmo
*
1e3
);
if
(
i
==
0
||
pfd
.
revents
!=
POLLOUT
)
{
(
void
)
close
(
retval
);
retval
=
-
1
;
}
}
if
(
retval
>=
0
)
break
;
}
for
(
n
=
0
;
n
<
nvaddr
;
n
++
)
free
(
vaddr
[
n
]);
free
(
vaddr
);
return
(
retval
);
}
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