[master] 01001b9 Use VTCP_open() instead of VSS_open()
Poul-Henning Kamp
phk at FreeBSD.org
Thu Mar 12 00:12:00 CET 2015
commit 01001b90e0799a3a2335b0717983eed352e8f9c3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Mar 11 23:08:57 2015 +0000
Use VTCP_open() instead of VSS_open()
diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index b498efc..954a8be 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -63,7 +63,7 @@
#include "vas.h"
#include "vcli.h"
#include "vnum.h"
-#include "vss.h"
+#include "vtcp.h"
#define RL_EXIT(status) \
do { \
@@ -101,10 +101,11 @@ cli_sock(const char *T_arg, const char *S_arg)
unsigned status;
char *answer = NULL;
char buf[CLI_AUTH_RESPONSE_LEN + 1];
+ const char *err;
- sock = VSS_open(T_arg, timeout);
+ sock = VTCP_open(T_arg, NULL, timeout, &err);
if (sock < 0) {
- fprintf(stderr, "Connection failed (%s)\n", T_arg);
+ fprintf(stderr, "Connection failed (%s): %s\n", T_arg, err);
return (-1);
}
diff --git a/bin/varnishtest/vtc_client.c b/bin/varnishtest/vtc_client.c
index a273776..9403af2 100644
--- a/bin/varnishtest/vtc_client.c
+++ b/bin/varnishtest/vtc_client.c
@@ -74,6 +74,7 @@ client_thread(void *priv)
struct vsb *vsb;
char *p;
char mabuf[32], mpbuf[32];
+ const char *err;
CAST_OBJ_NOTNULL(c, priv, CLIENT_MAGIC);
AN(*c->connect);
@@ -91,9 +92,10 @@ client_thread(void *priv)
vtc_log(vl, 2, "Started (%u iterations)", c->repeat);
for (u = 0; u < c->repeat; u++) {
vtc_log(vl, 3, "Connect to %s", VSB_data(vsb));
- fd = VSS_open(VSB_data(vsb), 10.);
+ fd = VTCP_open(VSB_data(vsb), NULL, 10., &err);
if (fd < 0)
- vtc_log(c->vl, 0, "Failed to open %s", VSB_data(vsb));
+ vtc_log(c->vl, 0, "Failed to open %s: %s",
+ VSB_data(vsb), err);
assert(fd >= 0);
VTCP_blocking(fd);
VTCP_myname(fd, mabuf, sizeof mabuf, mpbuf, sizeof mpbuf);
More information about the varnish-commit
mailing list