summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorSimon Rettberg2018-03-12 15:28:33 +0100
committerSimon Rettberg2018-03-12 15:28:33 +0100
commite53dfcbdbed04cad690823ce5def521fea7b5483 (patch)
tree4a5d31e53515ad6a505d2cc4948abaa54a392b8c /server.c
parentAdd version information and --version (diff)
downloadldadp-e53dfcbdbed04cad690823ce5def521fea7b5483.tar.gz
ldadp-e53dfcbdbed04cad690823ce5def521fea7b5483.tar.xz
ldadp-e53dfcbdbed04cad690823ce5def521fea7b5483.zip
4s timeout when connecting to server; send error to client on failure
Diffstat (limited to 'server.c')
-rw-r--r--server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.c b/server.c
index a4106f9..f22c5bf 100644
--- a/server.c
+++ b/server.c
@@ -696,17 +696,17 @@ static int server_connectInternal(server_t *server)
if (server->lastLookup + 300 < time(NULL)) {
sock = helper_connect4(server->addr, port, server->ip);
if (sock == -1) {
- printf("[Proxy] Could not resolve hostname or connect to AD server %s\n", server->addr);
+ printf("[Proxy] Could not resolve hostname or connect to AD server %s (errno=%d)\n", server->addr, errno);
return -1;
}
} else {
- sock = socket_tcp4b();
+ sock = helper_newSocket();
if (sock == -1) {
- printf("[Proxy] Could not allocate socket for connection to AD server %s\n", server->addr);
+ printf("[Proxy] Could not allocate socket for connection to AD server %s (errno=%d)\n", server->addr, errno);
return -1;
}
if (socket_connect4(sock, server->ip, port) == -1) {
- printf("[Proxy] Could not connect to cached IP (%s) of %s\n", server->ip, server->addr);
+ printf("[Proxy] Could not connect to cached IP (%s) of %s (errno=%d)\n", server->ip, server->addr, errno);
server->lastLookup = 0;
close(sock);
return -1;