]> granicus.if.org Git - transmission/commitdiff
(trunk libT) copyediting: remove a bunch of seemingly-unneeded network headers in...
authorJordan Lee <jordan@transmissionbt.com>
Thu, 24 Mar 2011 22:57:39 +0000 (22:57 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Thu, 24 Mar 2011 22:57:39 +0000 (22:57 +0000)
I'm less certain that these are unneeded because networking APIs seem to have more variation between platforms, but it's better to remove the cruft and then add back whatever headers $PLATFORM users complain about, than to not remove the cruft at all...

libtransmission/natpmp.c
libtransmission/net.c
libtransmission/net.h
libtransmission/peer-io.c
libtransmission/tr-lpd.c
utils/create.c
utils/edit.c
utils/show.c

index b7f5893b8775b5e36422ec2e07df7f7534b3d3b7..30bcbc4c2b9085a809d7f7045a35b268453e8baa 100644 (file)
 #include <time.h>
 #include <inttypes.h>
 
+#include <event2/util.h> /* evutil_inet_ntop() */
+
 #define ENABLE_STRNATPMPERR
 #include <libnatpmp/natpmp.h>
 
 #include "transmission.h"
 #include "natpmp.h"
-#include "net.h" /* inet_ntoa() */
+#include "net.h" /* tr_netCloseSocket */
 #include "port-forwarding.h"
 #include "utils.h"
 
@@ -134,8 +136,9 @@ tr_natpmpPulse( struct tr_natpmp * nat, tr_port private_port, bool is_enabled, t
         logVal( "readnatpmpresponseorretry", val );
         if( val >= 0 )
         {
-            tr_ninf( getKey( ), _( "Found public address \"%s\"" ),
-                     inet_ntoa( response.pnu.publicaddress.addr ) );
+            char str[128];
+            evutil_inet_ntop( AF_INET, &response.pnu.publicaddress.addr, str, sizeof( str ) );
+            tr_ninf( getKey( ), _( "Found public address \"%s\"" ), str );
             nat->state = TR_NATPMP_IDLE;
         }
         else if( val != NATPMP_TRYAGAIN )
index 014ec899183e4f0ea3145bd6fa80212455fd2b8b..4b30a8c4331cf05f82f3b5498239d8a880812468 100644 (file)
 #ifdef WIN32
  #define _WIN32_WINNT   0x0501
  #include <ws2tcpip.h>
-#else
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>
- #include <arpa/inet.h> /* inet_addr */
- #include <netdb.h>
 #endif
 
 #include <event2/util.h>
+
 #include <libutp/utp.h>
 
 #include "transmission.h"
-#include "fdlimit.h"
-#include "natpmp.h"
+#include "fdlimit.h" /* tr_fdSocketClose() */
 #include "net.h"
-#include "peer-io.h"
-#include "platform.h"
-#include "session.h"
-#include "tr-utp.h"
-#include "utils.h"
+#include "peer-io.h" /* tr_peerIoAddrStr() FIXME this should be moved to net.h */
+#include "session.h" /* tr_sessionGetPublicAddress() */
+#include "tr-utp.h" /* tr_utpSendTo() */
+#include "utils.h" /* tr_time(), tr_dbg() */
 
 #ifndef IN_MULTICAST
 #define IN_MULTICAST( a ) ( ( ( a ) & 0xf0000000 ) == 0xe0000000 )
index cbc3ec92832c17a4c849a07e23ac7372aee8a88d..639dff1f8580c0f01b238fc4f41d56167e182119 100644 (file)
  #include <inttypes.h>
  #include <ws2tcpip.h>
 #else
- #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
- #include <arpa/inet.h>
 #endif
 
 #ifdef WIN32
index 874b9f27432bbb3d04e4c448f04cc87607f17a4d..dd32ea81d71feedff87bef720e7d39a396aaf99e 100644 (file)
 #include <limits.h> /* INT_MAX */
 #include <string.h>
 
-#ifdef WIN32
- #include <winsock2.h>
-#else
- #include <arpa/inet.h> /* inet_ntoa */
-#endif
-
 #include <event2/event.h>
 #include <event2/buffer.h>
 #include <event2/bufferevent.h>
index 84ba3d3a08b625ceded162e2d8f61d4e460c95b1..9590554b1bb62696e69a00efd22e4b3ff4da8714 100644 (file)
@@ -533,7 +533,7 @@ static int tr_lpdConsiderAnnounce( tr_pex* peer, const char* const msg )
             /* we found a suitable peer, add it to the torrent */
             tr_peerMgrAddPex( tor, TR_PEER_FROM_LPD, peer, -1 );
             tr_tordbg( tor, "Learned %d local peer from LPD (%s:%u)",
-                1, inet_ntoa( peer->addr.addr.addr4 ), peerPort );
+                1, tr_ntop_non_ts( &peer->addr ), peerPort );
 
             /* periodic reconnectPulse() deals with the rest... */
 
index e79dc2878dce928a3537e2fe9a04f4c380baa5e5..409d7fa3e4a887980f709e184c89790047dd58e4 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include <errno.h>
-#include <stdio.h>
+#include <stdio.h> /* fprintf() */
 #include <stdlib.h> /* EXIT_FAILURE */
 #include <unistd.h> /* getcwd() */
 
index a86b1c335dd030bdb3daae2b104ef66cf1614ccd..c05318c1a984a6957be38ecdbd3ff363a1e68c7e 100644 (file)
@@ -10,7 +10,7 @@
  * $Id$
  */
 
-#include <stdio.h>
+#include <stdio.h> /* fprintf() */
 #include <string.h> /* strlen(), strstr(), strcmp() */
 #include <stdlib.h> /* EXIT_FAILURE */
 
index 52762314bcdc15bd7c1185da54b3525b4779bb31..312e8c0a831b35ad41cacc9a8628a654f6829aa7 100644 (file)
@@ -10,7 +10,7 @@
  * $Id$
  */
 
-#include <stdio.h>
+#include <stdio.h> /* fprintf() */
 #include <string.h> /* strcmp(), strchr(), memcmp() */
 #include <stdlib.h> /* getenv(), qsort() */
 #include <time.h>