Changeset 2576
- Timestamp:
- Jul 31, 2007, 4:55:47 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r2569 r2576 117 117 msw="yes" 118 118 CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows" 119 CPPFLAGS="$CPPFLAGS -D __MINGW__-DWIN32_LEAN_AND_MEAN"119 CPPFLAGS="$CPPFLAGS -DWIN32 -DWIN32_LEAN_AND_MEAN" 120 120 LIBS="$LIBS -lshell32 -lws2_32" 121 121 transmissionlocaledir="locale" -
trunk/libtransmission/internal.h
r2573 r2576 34 34 #endif 35 35 36 #ifdef SYS_BEOS37 # define socklen_t uint32_t38 #endif39 40 36 #define TR_NAME "Transmission" 41 42 #ifndef INADDR_NONE43 #define INADDR_NONE 0xffffffff44 #endif45 37 46 38 #ifdef __GNUC__ -
trunk/libtransmission/natpmp.c
r2573 r2576 596 596 else if( TR_NET_CLOSE & res ) 597 597 { 598 if( ECONNRESET == errno || ECONNREFUSED ==errno )598 if( ECONNRESET == sockerrno || ECONNREFUSED == sockerrno ) 599 599 { 600 600 tr_dbg( "nat-pmp not supported by device" ); … … 652 652 653 653 res = tr_netSend( req->fd, buf, sizeof( buf ) ); 654 if( TR_NET_CLOSE & res && EHOSTUNREACH == errno )654 if( TR_NET_CLOSE & res && EHOSTUNREACH == sockerrno ) 655 655 { 656 656 res = TR_NET_BLOCK; -
trunk/libtransmission/net.c
r2573 r2576 81 81 * gethostbyname thread. 82 82 **********************************************************************/ 83 void tr_netResolveThreadInit( )83 void tr_netResolveThreadInit( void ) 84 84 { 85 85 resolveDie = 0; … … 97 97 * die and clean itself up. 98 98 **********************************************************************/ 99 void tr_netResolveThreadClose( )99 void tr_netResolveThreadClose( void ) 100 100 { 101 101 tr_lockLock( resolveLock ); … … 290 290 if( connect( s, (struct sockaddr *) &sock, 291 291 sizeof( struct sockaddr_in ) ) < 0 && 292 errno != EINPROGRESS )292 sockerrno != EINPROGRESS ) 293 293 { 294 294 tr_err( "Could not connect socket (%s)", strerror( errno ) ); … … 416 416 return ret; 417 417 418 if( errno == ENOTCONN || errno == EAGAIN ||errno == EWOULDBLOCK )418 if( sockerrno == ENOTCONN || sockerrno == EAGAIN || sockerrno == EWOULDBLOCK ) 419 419 return TR_NET_BLOCK; 420 420 … … 431 431 if( ret < 0 ) 432 432 { 433 if( errno == EAGAIN ||errno == EWOULDBLOCK )433 if( sockerrno == EAGAIN || sockerrno == EWOULDBLOCK ) 434 434 { 435 435 ret = TR_NET_BLOCK; -
trunk/libtransmission/net.h
r2573 r2576 26 26 #define _TR_NET_H_ 27 27 28 #if defined(BEOS_NETSERVER) || defined(__MINGW__) 29 #include <stdint.h> 30 typedef uint16_t tr_port_t; 28 #ifdef WIN32 29 #include <stdint.h> 30 #include <winsock2.h> 31 typedef uint16_t tr_port_t; 31 32 #else 32 #include <arpa/inet.h> 33 typedef in_port_t tr_port_t; 33 #include <sys/socket.h> 34 #include <netinet/in.h> 35 #include <arpa/inet.h> 36 typedef in_port_t tr_port_t; 37 #endif 38 39 #ifdef SYS_BEOS 40 #include <stdint.h> 41 typedef uint32_t socklen_t; 42 #endif 43 44 #ifdef WIN32 45 #define EAGAIN WSAEAGAIN 46 #define ECONNREFUSED WSAECONNREFUSED 47 #define ECONNRESET WSAECONNRESET 48 #define EHOSTUNREACH WSAEHOSTUNREACH 49 #define EINPROGRESS WSAEINPROGRESS 50 #define ENOTCONN WSAENOTCONN 51 #define EWOULDBLOCK WSAEWOULDBLOCK 52 #define sockerrno WSAGetLastError( ) 53 #else 54 #include <errno.h> 55 #define sockerrno errno 56 #endif 57 58 #ifndef INADDR_NONE 59 #define INADDR_NONE 0xffffffff 34 60 #endif 35 61 … … 43 69 44 70 typedef struct tr_resolve_s tr_resolve_t; 45 void tr_netResolveThreadInit( );46 void tr_netResolveThreadClose( );71 void tr_netResolveThreadInit( void ); 72 void tr_netResolveThreadClose( void ); 47 73 tr_resolve_t * tr_netResolveInit( const char * address ); 48 74 tr_tristate_t tr_netResolvePulse( tr_resolve_t *, struct in_addr * ); … … 53 79 * TCP and UDP sockets 54 80 **********************************************************************/ 55 int tr_netOpenTCP ( const struct in_addr * addr, tr_port_t port, int priority );56 int tr_netOpenUDP ( const struct in_addr * addr, tr_port_t port, int priority );81 int tr_netOpenTCP ( const struct in_addr * addr, tr_port_t port, int priority ); 82 int tr_netOpenUDP ( const struct in_addr * addr, tr_port_t port, int priority ); 57 83 int tr_netMcastOpen( int port, const struct in_addr * addr ); 58 int tr_netBindTCP ( int port );59 int tr_netBindUDP ( int port );60 int tr_netAccept ( int s, struct in_addr *, tr_port_t * );61 void tr_netClose ( int s );84 int tr_netBindTCP ( int port ); 85 int tr_netBindUDP ( int port ); 86 int tr_netAccept ( int s, struct in_addr *, tr_port_t * ); 87 void tr_netClose ( int s ); 62 88 63 89 #define TR_NET_BLOCK 0x80000000 -
trunk/libtransmission/platform.c
r2573 r2576 846 846 if( 0 > res ) 847 847 { 848 if( EAGAIN != errno )848 if( EAGAIN != sockerrno ) 849 849 { 850 850 tr_err( "failed to read from routing socket (%s)", 851 strerror( errno ) );851 strerror( sockerrno ) ); 852 852 } 853 853 free( buf ); -
trunk/libtransmission/transmission.h
r2554 r2576 53 53 #endif 54 54 55 #if defined( __MINGW__)55 #if defined(WIN32) 56 56 #define TR_PATH_DELIMITER '\\' 57 57 #define TR_PATH_DELIMITER_STR "\\" -
trunk/libtransmission/upnp.c
r2573 r2576 401 401 (struct sockaddr*) &sin, sizeof( sin ) ) ) 402 402 { 403 if( EAGAIN != errno )403 if( EAGAIN != sockerrno ) 404 404 { 405 405 tr_err( "Could not send SSDP discover message (%s)", 406 strerror( errno ) );406 strerror( sockerrno ) ); 407 407 } 408 408 killSock( &fd ); … … 508 508 else if( TR_NET_CLOSE & *len ) 509 509 { 510 tr_err( "Could not receive SSDP message (%s)", strerror( errno ) );510 tr_err( "Could not receive SSDP message (%s)", strerror( sockerrno ) ); 511 511 return TR_NET_ERROR; 512 512 }
Note: See TracChangeset
for help on using the changeset viewer.