diff options
author | fcolin | 2010-11-22 15:50:17 +0000 |
---|---|---|
committer | fcolin | 2010-11-22 15:50:17 +0000 |
commit | e5d1c6fad7130dac302e314b66ad32150eaba91b (patch) | |
tree | 1e412b6af76d00cf19d6616b0c0742acc867d718 /src/ivysocket.c | |
parent | 6deabe1a51d61be0a173c2afa667d9f984f7c488 (diff) | |
download | ivy-c-e5d1c6fad7130dac302e314b66ad32150eaba91b.zip ivy-c-e5d1c6fad7130dac302e314b66ad32150eaba91b.tar.gz ivy-c-e5d1c6fad7130dac302e314b66ad32150eaba91b.tar.bz2 ivy-c-e5d1c6fad7130dac302e314b66ad32150eaba91b.tar.xz |
Correct Pb on Mac OS
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r-- | src/ivysocket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ivysocket.c b/src/ivysocket.c index 4f0ae58..3f94048 100644 --- a/src/ivysocket.c +++ b/src/ivysocket.c @@ -745,6 +745,7 @@ Client SocketConnectAddr (int ipv6, struct sockaddr_storage * addr, unsigned sho HANDLE handle; Client client; struct sockaddr_storage remote; + socklen_t addrlen; #ifdef WIN32 u_long iMode = 1; /* non blocking Mode */ #else @@ -765,6 +766,7 @@ Client SocketConnectAddr (int ipv6, struct sockaddr_storage * addr, unsigned sho remote6->sin6_scope_id = ((struct sockaddr_in6*)addr)->sin6_scope_id; remote6->sin6_flowinfo = ((struct sockaddr_in6*)addr)->sin6_flowinfo; remote6->sin6_port = htons (port); + addrlen = sizeof(struct sockaddr_in6); } else { @@ -772,9 +774,10 @@ Client SocketConnectAddr (int ipv6, struct sockaddr_storage * addr, unsigned sho remote4->sin_family = AF_INET; remote4->sin_addr = ((struct sockaddr_in*)addr)->sin_addr; remote4->sin_port = htons (port); + addrlen = sizeof(struct sockaddr_in); } - if (connect (handle, (const struct sockaddr*)&remote, sizeof( remote ) ) < 0){ + if (connect (handle, (const struct sockaddr*)&remote, addrlen ) < 0){ perror ("*** client connect ***"); return NULL; }; |