From 58f19f14e1968f0b8fd8b384f0178526733f5aa6 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 29 Mar 2016 11:51:58 -0400 Subject: [PATCH] print ip and hostname when can't connect --- src/zm_remote_camera_http.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 006f80faf..cb26413e0 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -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; }