From 8e87147c611d1e988d7e5bdd2f506997233aa544 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 18 Feb 2011 01:06:42 +0000 Subject: [PATCH] (trunk libT) add a stub for UTP_Close() s.t. peer-mgr.c doesn't need the #ifdefs from r11960 --- libtransmission/peer-mgr.c | 4 ---- libtransmission/tr-utp.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index d498fd943..8e38dd23d 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -2048,19 +2048,15 @@ tr_peerMgrAddIncoming( tr_peerMgr * manager, tr_dbg( "Banned IP address \"%s\" tried to connect to us", tr_ntop_non_ts( addr ) ); if(socket >= 0) tr_netClose( session, socket ); -#ifdef WITH_UTP else UTP_Close( utp_socket ); -#endif } else if( getExistingHandshake( &manager->incomingHandshakes, addr ) ) { if(socket >= 0) tr_netClose( session, socket ); -#ifdef WITH_UTP else UTP_Close( utp_socket ); -#endif } else /* we don't have a connection to them yet... */ { diff --git a/libtransmission/tr-utp.c b/libtransmission/tr-utp.c index 1e8033c53..a327c7023 100644 --- a/libtransmission/tr-utp.c +++ b/libtransmission/tr-utp.c @@ -21,6 +21,7 @@ THE SOFTWARE. */ +#include #include #include @@ -33,9 +34,26 @@ THE SOFTWARE. #include "peer-io.h" #include "peer-mgr.h" #include "tr-utp.h" +#include "utils.h" + +#define MY_NAME "UTP" + +#define dbgmsg( ... ) \ + do { \ + if( tr_deepLoggingIsActive( ) ) \ + tr_deepLog( __FILE__, __LINE__, MY_NAME, __VA_ARGS__ ); \ + } while( 0 ) #ifndef WITH_UTP +void +UTP_Close(struct UTPSocket * socket ) +{ + tr_nerr( MY_NAME, "UTP_Close(%p) was called.", socket ); + dbgmsg( "UTP_Close(%p) was called.", socket ); + assert( 0 ); /* FIXME: this is too much for the long term, but probably needed in the short term */ +} + int tr_utpPacket(const unsigned char *buf UNUSED, size_t buflen UNUSED, const struct sockaddr *from UNUSED, socklen_t fromlen UNUSED, tr_session *ss UNUSED) { return -1; }