print ip and hostname when can't connect

This commit is contained in:
Isaac Connor 2016-03-29 11:51:58 -04:00
parent 34c50b8cfc
commit 58f19f14e1
1 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,12 @@ int RemoteCameraHttp::Connect()
{
close(sd);
sd = -1;
Warning("Can't connect to remote camera: %s", strerror(errno) );
char buf[sizeof(struct in6_addr)];
struct sockaddr_in *addr;
addr = (struct sockaddr_in *)p->ai_addr;
inet_ntop( AF_INET, &(addr->sin_addr), buf, INET6_ADDRSTRLEN );
Warning("Can't connect to remote camera mid: %d at %s: %s", id, buf, strerror(errno) );
continue;
}