Commit 8c3aee3b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

retry backend open, log diagnostics


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@299 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 71ee32c1
......@@ -30,6 +30,7 @@
#include <pthread.h>
#include <queue.h>
#include <sbuf.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -101,11 +102,14 @@ connect_to_backend(struct vbe_conn *vc, struct backend *bp)
do {
s = socket(res0->ai_family, res0->ai_socktype,
res0->ai_protocol);
if (s < 0)
if (s < 0) {
VSL(SLT_Debug, 0, "Socket errno=%d", errno);
continue;
}
error = connect(s, res0->ai_addr, res0->ai_addrlen);
if (!error)
break;
VSL(SLT_Debug, 0, "Connect errno=%d", errno);
close(s);
s = -1;
} while ((res0 = res0->ai_next) != NULL);
......
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