@ -363,8 +363,6 @@ IsUnixSocket(const char *name)
rfbBool
rfbBool
ConnectToRFBServer ( rfbClient * client , const char * hostname , int port )
ConnectToRFBServer ( rfbClient * client , const char * hostname , int port )
{
{
unsigned int host ;
if ( client - > serverPort = = - 1 ) {
if ( client - > serverPort = = - 1 ) {
/* serverHost is a file recorded by vncrec. */
/* serverHost is a file recorded by vncrec. */
const char * magic = " vncLog0.0 " ;
const char * magic = " vncLog0.0 " ;
@ -399,12 +397,20 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
else
else
# endif
# endif
{
{
/* serverHost is a hostname */
# ifdef LIBVNCSERVER_IPv6
if ( ! StringToIPAddr ( hostname , & host ) ) {
client - > sock = ConnectClientToTcpAddr6 ( hostname , port ) ;
rfbClientLog ( " Couldn't convert '%s' to host address \n " , hostname ) ;
if ( client - > sock = = - 1 )
return FALSE ;
# endif
{
unsigned int host ;
/* serverHost is a hostname */
if ( ! StringToIPAddr ( hostname , & host ) ) {
rfbClientLog ( " Couldn't convert '%s' to host address \n " , hostname ) ;
return FALSE ;
}
client - > sock = ConnectClientToTcpAddr ( host , port ) ;
}
}
client - > sock = ConnectClientToTcpAddr ( host , port ) ;
}
}
if ( client - > sock < 0 ) {
if ( client - > sock < 0 ) {
@ -421,17 +427,23 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
rfbBool ConnectToRFBRepeater ( rfbClient * client , const char * repeaterHost , int repeaterPort , const char * destHost , int destPort )
rfbBool ConnectToRFBRepeater ( rfbClient * client , const char * repeaterHost , int repeaterPort , const char * destHost , int destPort )
{
{
unsigned int host ;
rfbProtocolVersionMsg pv ;
rfbProtocolVersionMsg pv ;
int major , minor ;
int major , minor ;
char tmphost [ 250 ] ;
char tmphost [ 250 ] ;
if ( ! StringToIPAddr ( repeaterHost , & host ) ) {
# ifdef LIBVNCSERVER_IPv6
rfbClientLog ( " Couldn't convert '%s' to host address \n " , repeaterHost ) ;
client - > sock = ConnectClientToTcpAddr6 ( repeaterHost , repeaterPort ) ;
return FALSE ;
if ( client - > sock = = - 1 )
}
# endif
{
unsigned int host ;
if ( ! StringToIPAddr ( repeaterHost , & host ) ) {
rfbClientLog ( " Couldn't convert '%s' to host address \n " , repeaterHost ) ;
return FALSE ;
}
client - > sock = ConnectClientToTcpAddr ( host , repeaterPort ) ;
client - > sock = ConnectClientToTcpAddr ( host , repeaterPort ) ;
}
if ( client - > sock < 0 ) {
if ( client - > sock < 0 ) {
rfbClientLog ( " Unable to connect to VNC repeater \n " ) ;
rfbClientLog ( " Unable to connect to VNC repeater \n " ) ;