(trunk libT) copyediting: remove a bunch of seemingly-unneeded network headers in net.[ch].

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...
This commit is contained in:
Jordan Lee 2011-03-24 22:57:39 +00:00
parent f7005889d1
commit 87ef45cf3d
8 changed files with 16 additions and 28 deletions

View File

@ -14,12 +14,14 @@
#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 )

View File

@ -32,26 +32,19 @@
#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 )

View File

@ -33,10 +33,8 @@
#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

View File

@ -15,12 +15,6 @@
#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>

View 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... */

View File

@ -11,7 +11,7 @@
*/
#include <errno.h>
#include <stdio.h>
#include <stdio.h> /* fprintf() */
#include <stdlib.h> /* EXIT_FAILURE */
#include <unistd.h> /* getcwd() */

View File

@ -10,7 +10,7 @@
* $Id$
*/
#include <stdio.h>
#include <stdio.h> /* fprintf() */
#include <string.h> /* strlen(), strstr(), strcmp() */
#include <stdlib.h> /* EXIT_FAILURE */

View 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>