diff options
author | Simon Rettberg | 2018-03-12 15:28:33 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-03-12 15:28:33 +0100 |
commit | e53dfcbdbed04cad690823ce5def521fea7b5483 (patch) | |
tree | 4a5d31e53515ad6a505d2cc4948abaa54a392b8c /server.c | |
parent | Add version information and --version (diff) | |
download | ldadp-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |