[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.59,1.60

Bertrand Baudet bertrand at mplayerhq.hu
Fri Sep 27 21:20:34 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv11940

Modified Files:
	network.c 
Log Message:
Display the IP address that has been resolved.


Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- network.c	13 Sep 2002 22:39:48 -0000	1.59
+++ network.c	27 Sep 2002 19:20:20 -0000	1.60
@@ -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 ) {




More information about the MPlayer-cvslog mailing list