# HG changeset patch # User bertrand # Date 1033154420 0 # Node ID cd2b939b2dfbd88e6a41f7dfabcebd659fde8b60 # Parent 0df2e3079aa45dbb8bd732d539adda4529fe5f03 Display the IP address that has been resolved. diff -r 0df2e3079aa4 -r cd2b939b2dfb libmpdemux/network.c --- a/libmpdemux/network.c Thu Sep 26 23:53:50 2002 +0000 +++ b/libmpdemux/network.c Fri Sep 27 19:20:20 2002 +0000 @@ -149,8 +149,7 @@ fd_set set; struct timeval tv; struct sockaddr_in server_address; - - mp_msg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s:%d ...\n", host, port ); + struct hostent *hp; socket_server_fd = socket(AF_INET, SOCK_STREAM, 0); if( socket_server_fd==-1 ) { @@ -159,7 +158,7 @@ } if( isalpha(host[0]) ) { - struct hostent *hp; + mp_msg(MSGT_NETWORK,MSGL_STATUS,"Resolving %s ...\n", host ); hp=(struct hostent*)gethostbyname( host ); if( hp==NULL ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Counldn't resolve name: %s\n", host); @@ -173,6 +172,11 @@ server_address.sin_port=htons(port); // Turn the socket as non blocking so we can timeout on the connection + if( isalpha(host[0]) ) { + mp_msg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%d.%d.%d.%d]:%d ...\n", host, (hp->h_addr_list[0][0])&0xff, (hp->h_addr_list[0][1])&0xff, (hp->h_addr_list[0][2])&0xff, (hp->h_addr_list[0][3])&0xff, port ); + } else { + mp_msg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s:%d ...\n", host, port ); + } fcntl( socket_server_fd, F_SETFL, fcntl(socket_server_fd, F_GETFL) | O_NONBLOCK ); if( connect( socket_server_fd, (struct sockaddr*)&server_address, sizeof(server_address) )==-1 ) { if( errno!=EINPROGRESS ) {