[MPlayer-dev-eng] [PATCH] consistent network use

Joey Parrish joey at nicewarrior.org
Tue Apr 1 00:39:04 CEST 2003


Hello,

Recent changes have left some differences in the way network stuff is
done.  Attached below are two patches.  Each will keep things
consistent, but one will be with the new way and one will be with the
old way.  (ifdefs around each inet_pton/inet_aton vs. a #define wrapper)

--Joey
-------------- next part --------------
Index: libmpdemux/network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.73
diff -u -r1.73 network.c
--- libmpdemux/network.c	30 Mar 2003 17:10:36 -0000	1.73
+++ libmpdemux/network.c	31 Mar 2003 22:42:38 -0000
@@ -888,7 +888,11 @@
 		}
 		memcpy( (void*)&server_address.sin_addr.s_addr, (void*)hp->h_addr, hp->h_length );
 	} else {
+#ifdef USE_ATON
+		inet_aton(url->hostname, &server_address.sin_addr);
+#else
 		inet_pton(AF_INET, url->hostname, &server_address.sin_addr);
+#endif
 	}
 	server_address.sin_family=AF_INET;
 	server_address.sin_port=htons(url->port);
Index: libmpdemux/network.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.h,v
retrieving revision 1.15
diff -u -r1.15 network.h
--- libmpdemux/network.h	29 Oct 2002 09:18:53 -0000	1.15
+++ libmpdemux/network.h	31 Mar 2003 22:42:38 -0000
@@ -54,18 +54,4 @@
 
 int http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry);
 
-/* 
- * Joey Parrish <joey at yunamusic.com>:
- *
- * This define is to allow systems without inet_pton() to fallback on
- * inet_aton().  The difference between the two is that inet_aton() is
- * strictly for IPv4 networking, while inet_pton() is for IPv4 and IPv6
- * both.  Slightly limited network functionality seems better than no
- * network functionality to me, and as all systems (Cygwin) start to
- * implement inet_pton(), configure will decide not to use this code.
- */
-#ifdef USE_ATON
-# define inet_pton(a, b, c) inet_aton(b, c)
-#endif
-
 #endif
-------------- next part --------------
Index: libmpdemux/network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.73
diff -u -r1.73 network.c
--- libmpdemux/network.c	30 Mar 2003 17:10:36 -0000	1.73
+++ libmpdemux/network.c	31 Mar 2003 22:45:20 -0000
@@ -214,11 +214,7 @@
 	
 	bzero(&server_address, sizeof(server_address));
 	
-#ifdef USE_ATON
-	if (inet_aton(host, our_s_addr)!=1)
-#else
 	if (inet_pton(af, host, our_s_addr)!=1)
-#endif
 	{
 		mp_msg(MSGT_NETWORK,MSGL_STATUS,"Resolving %s for %s...\n", host, af2String(af));
 		


More information about the MPlayer-dev-eng mailing list