ipv6 connect sanity checking: error message if not able to connect,
instead of just segfaulting. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@442 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
3249d71586
commit
ec91795552
8
tcp.c
8
tcp.c
@ -147,7 +147,7 @@ tcp_connect(char *server)
|
|||||||
|
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
{
|
{
|
||||||
error("getaddrinfo error:: [%s]\n", gai_strerror(n));
|
error("getaddrinfo: %s\n", gai_strerror(n));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,6 +167,12 @@ tcp_connect(char *server)
|
|||||||
}
|
}
|
||||||
freeaddrinfo(ressave);
|
freeaddrinfo(ressave);
|
||||||
|
|
||||||
|
if (sock == -1)
|
||||||
|
{
|
||||||
|
error("%s: unable to connect\n", server);
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
|
||||||
#else /* no IPv6 support */
|
#else /* no IPv6 support */
|
||||||
|
|
||||||
struct hostent *nslookup;
|
struct hostent *nslookup;
|
||||||
|
Loading…
Reference in New Issue
Block a user