Changeset 12225


Ignore:
Timestamp:
Mar 24, 2011, 10:57:39 PM (11 years ago)
Author:
jordan
Message:

(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...

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/natpmp.c

    r12204 r12225  
    1515#include <inttypes.h>
    1616
     17#include <event2/util.h> /* evutil_inet_ntop() */
     18
    1719#define ENABLE_STRNATPMPERR
    1820#include <libnatpmp/natpmp.h>
     
    2022#include "transmission.h"
    2123#include "natpmp.h"
    22 #include "net.h" /* inet_ntoa() */
     24#include "net.h" /* tr_netCloseSocket */
    2325#include "port-forwarding.h"
    2426#include "utils.h"
     
    135137        if( val >= 0 )
    136138        {
    137             tr_ninf( getKey( ), _( "Found public address \"%s\"" ),
    138                      inet_ntoa( response.pnu.publicaddress.addr ) );
     139            char str[128];
     140            evutil_inet_ntop( AF_INET, &response.pnu.publicaddress.addr, str, sizeof( str ) );
     141            tr_ninf( getKey( ), _( "Found public address \"%s\"" ), str );
    139142            nat->state = TR_NATPMP_IDLE;
    140143        }
  • trunk/libtransmission/net.c

    r12223 r12225  
    3333 #define _WIN32_WINNT   0x0501
    3434 #include <ws2tcpip.h>
    35 #else
    36  #include <sys/socket.h>
    37  #include <netinet/in.h>
    38  #include <netinet/tcp.h>
    39  #include <arpa/inet.h> /* inet_addr */
    40  #include <netdb.h>
    4135#endif
    4236
    4337#include <event2/util.h>
     38
    4439#include <libutp/utp.h>
    4540
    4641#include "transmission.h"
    47 #include "fdlimit.h"
    48 #include "natpmp.h"
     42#include "fdlimit.h" /* tr_fdSocketClose() */
    4943#include "net.h"
    50 #include "peer-io.h"
    51 #include "platform.h"
    52 #include "session.h"
    53 #include "tr-utp.h"
    54 #include "utils.h"
     44#include "peer-io.h" /* tr_peerIoAddrStr() FIXME this should be moved to net.h */
     45#include "session.h" /* tr_sessionGetPublicAddress() */
     46#include "tr-utp.h" /* tr_utpSendTo() */
     47#include "utils.h" /* tr_time(), tr_dbg() */
    5548
    5649#ifndef IN_MULTICAST
  • trunk/libtransmission/net.h

    r12204 r12225  
    3434 #include <ws2tcpip.h>
    3535#else
    36  #include <sys/types.h>
    3736 #include <sys/socket.h>
    3837 #include <netinet/in.h>
    39  #include <arpa/inet.h>
    4038#endif
    4139
  • trunk/libtransmission/peer-io.c

    r12224 r12225  
    1515#include <limits.h> /* INT_MAX */
    1616#include <string.h>
    17 
    18 #ifdef WIN32
    19  #include <winsock2.h>
    20 #else
    21  #include <arpa/inet.h> /* inet_ntoa */
    22 #endif
    2317
    2418#include <event2/event.h>
  • trunk/libtransmission/tr-lpd.c

    r12204 r12225  
    534534            tr_peerMgrAddPex( tor, TR_PEER_FROM_LPD, peer, -1 );
    535535            tr_tordbg( tor, "Learned %d local peer from LPD (%s:%u)",
    536                 1, inet_ntoa( peer->addr.addr.addr4 ), peerPort );
     536                1, tr_ntop_non_ts( &peer->addr ), peerPort );
    537537
    538538            /* periodic reconnectPulse() deals with the rest... */
  • trunk/utils/create.c

    r12204 r12225  
    1212
    1313#include <errno.h>
    14 #include <stdio.h>
     14#include <stdio.h> /* fprintf() */
    1515#include <stdlib.h> /* EXIT_FAILURE */
    1616#include <unistd.h> /* getcwd() */
  • trunk/utils/edit.c

    r12204 r12225  
    1111 */
    1212
    13 #include <stdio.h>
     13#include <stdio.h> /* fprintf() */
    1414#include <string.h> /* strlen(), strstr(), strcmp() */
    1515#include <stdlib.h> /* EXIT_FAILURE */
  • trunk/utils/show.c

    r12204 r12225  
    1111 */
    1212
    13 #include <stdio.h>
     13#include <stdio.h> /* fprintf() */
    1414#include <string.h> /* strcmp(), strchr(), memcmp() */
    1515#include <stdlib.h> /* getenv(), qsort() */
Note: See TracChangeset for help on using the changeset viewer.