]> granicus.if.org Git - transmission/commitdiff
(trunk libT) add a stub for UTP_Close() s.t. peer-mgr.c doesn't need the #ifdefs...
authorJordan Lee <jordan@transmissionbt.com>
Fri, 18 Feb 2011 01:06:42 +0000 (01:06 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 18 Feb 2011 01:06:42 +0000 (01:06 +0000)
libtransmission/peer-mgr.c
libtransmission/tr-utp.c

index d498fd94307fedd741e33e119bb281c807a48e03..8e38dd23deaa10087a0c45d3c5545e9b7330be4f 100644 (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... */
     {
index 1e8033c5305f60bd18dd93122913f80c2107f72b..a327c7023ee2770f8d4236bc9259027cf71be6c2 100644 (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; }