(trunk libT) add a stub for UTP_Close() s.t. peer-mgr.c doesn't need the #ifdefs from r11960

This commit is contained in:
Jordan Lee 2011-02-18 01:06:42 +00:00
parent cd04051de8
commit 8e87147c61
2 changed files with 18 additions and 4 deletions

View File

@ -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... */
{

View File

@ -21,6 +21,7 @@ THE SOFTWARE.
*/
#include <assert.h>
#include <unistd.h>
#include <event.h>
@ -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; }