]> granicus.if.org Git - transmission/commitdiff
(trunk libT) commit some debugging messages that were added to trackdown the multicas...
authorCharles Kerr <charles@transmissionbt.com>
Fri, 2 Jan 2009 21:50:51 +0000 (21:50 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 2 Jan 2009 21:50:51 +0000 (21:50 +0000)
libtransmission/bandwidth.c
libtransmission/peer-mgr.c

index f8820edbbfbb7f7f468485f0398e99c372fb123f..e0841519ae958416c21490498285395e51c2626a 100644 (file)
 #include "ptrarray.h"
 #include "utils.h"
 
+#define dbgmsg( ... ) \
+    do { \
+        if( tr_deepLoggingIsActive( ) ) \
+            tr_deepLog( __FILE__, __LINE__, NULL, __VA_ARGS__ ); \
+    } while( 0 )
+
 /***
 ****
 ***/
@@ -212,9 +218,7 @@ tr_bandwidthAllocate( tr_bandwidth  * b,
      * small chunk of bandwidth.  Keep looping until we run out of bandwidth
      * and/or peers that can use it */
     n = peerCount;
-#ifdef DEBUG_DIRECTION
-if( dir == DEBUG_DIRECTION ) fprintf( stderr, "bandwidth.c: allocate: number of peerIos to go round-robin: %d\n", n );
-#endif
+    dbgmsg( "direction %s ... %d pees to go round-robin", (dir==TR_UP?"UP":"DOWN"), n );
     i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a random starting point */
     while( n > 1 )
     {
index 505d969aa5364151cb0a699c98f07720cc8a857d..a2b874828fcabf9b8704426e0b4003b11005f407 100644 (file)
@@ -2313,6 +2313,8 @@ reconnectPulse( void * vtorrent )
 
             if( io == NULL )
             {
+                tordbg( t, "peerIo not created; marking peer %s as unreachable",
+                        tr_peerIoAddrStr( &atom->addr, atom->port ) );
                 atom->myflags |= MYFLAG_UNREACHABLE;
             }
             else