- Fix #545: improved logging, the ip address of the error is printed

on the same log-line as the error.


git-svn-id: file:///svn/unbound/trunk@3112 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2014-04-10 14:40:20 +00:00
parent eb5e9a89c4
commit c19f818c52
7 changed files with 79 additions and 49 deletions
+2 -3
View File
@@ -200,15 +200,14 @@ contact_server(const char* svr, struct config_file* cfg, int statuscmd)
#endif
}
if(connect(fd, (struct sockaddr*)&addr, addrlen) < 0) {
log_addr(0, "address", &addr, addrlen);
#ifndef USE_WINSOCK
log_err("connect: %s", strerror(errno));
log_err_addr("connect", strerror(errno), &addr, addrlen);
if(errno == ECONNREFUSED && statuscmd) {
printf("unbound is stopped\n");
exit(3);
}
#else
log_err("connect: %s", wsa_strerror(WSAGetLastError()));
log_err_addr("connect", wsa_strerror(WSAGetLastError()), &addr, addrlen);
if(WSAGetLastError() == WSAECONNREFUSED && statuscmd) {
printf("unbound is stopped\n");
exit(3);