Commit deb2133e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use VSS_open()



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2702 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a63b2347
...@@ -51,10 +51,6 @@ struct client { ...@@ -51,10 +51,6 @@ struct client {
char *spec; char *spec;
const char *connect; const char *connect;
int naddr;
struct vss_addr **vss_addr;
char *addr;
char *port;
pthread_t tp; pthread_t tp;
}; };
...@@ -70,19 +66,14 @@ static void * ...@@ -70,19 +66,14 @@ static void *
client_thread(void *priv) client_thread(void *priv)
{ {
struct client *c; struct client *c;
int i;
int fd = -1; int fd = -1;
CAST_OBJ_NOTNULL(c, priv, CLIENT_MAGIC); CAST_OBJ_NOTNULL(c, priv, CLIENT_MAGIC);
assert(c->naddr > 0); AN(c->connect);
printf("## %-4s started\n", c->name); printf("## %-4s started\n", c->name);
printf("### %-4s connect to %s\n", c->name, c->connect); printf("### %-4s connect to %s\n", c->name, c->connect);
for (i = 0; i < c->naddr; i++) { fd = VSS_open(c->connect);
fd = VSS_connect(c->vss_addr[i]);
if (fd >= 0)
break;
}
assert(fd >= 0); assert(fd >= 0);
printf("### %-4s connected to %s fd is %d\n", printf("### %-4s connected to %s fd is %d\n",
c->name, c->connect, fd); c->name, c->connect, fd);
...@@ -196,9 +187,6 @@ cmd_client(char **av, void *priv) ...@@ -196,9 +187,6 @@ cmd_client(char **av, void *priv)
if (!strcmp(*av, "-connect")) { if (!strcmp(*av, "-connect")) {
c->connect = av[1]; c->connect = av[1];
av++; av++;
AZ(VSS_parse(c->connect, &c->addr, &c->port));
c->naddr = VSS_resolve(c->addr, c->port, &c->vss_addr);
assert(c->naddr > 0);
continue; continue;
} }
if (!strcmp(*av, "-start")) { if (!strcmp(*av, "-start")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment