From 042e50eecc0351a6ba263f8d682a46de25d6c137 Mon Sep 17 00:00:00 2001 From: guotie Date: Fri, 11 Oct 2013 14:28:43 +0800 Subject: [PATCH] Update zm_remote_camera_http.cpp --- src/zm_remote_camera_http.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_remote_camera_http.cpp b/src/zm_remote_camera_http.cpp index 59c6f53e0..9ee3523ab 100644 --- a/src/zm_remote_camera_http.cpp +++ b/src/zm_remote_camera_http.cpp @@ -89,14 +89,14 @@ int RemoteCameraHttp::Connect() { if ( sd < 0 ) { - sd = socket( hp->h_addrtype, SOCK_STREAM, 0 ); + sd = socket( hp->ai_family, SOCK_STREAM, 0 ); if ( sd < 0 ) { Error( "Can't create socket: %s", strerror(errno) ); return( -1 ); } - if ( connect( sd, (struct sockaddr *)&sa, sizeof(sa) ) < 0 ) + if ( connect( sd, (struct sockaddr *)sa, hp->ai_addrlen ) < 0 ) { Error( "Can't connect to remote camera: %s", strerror(errno) ); Disconnect();