(trunk libT) add a couple more debugging assertions into the nightlies to try & smoke out the handshake/peer-io crashes

This commit is contained in:
Charles Kerr 2009-10-09 20:06:22 +00:00
parent 5b19021ab1
commit f92fd55a80
1 changed files with 10 additions and 1 deletions

View File

@ -119,11 +119,18 @@ tr_bandwidthSetParent( tr_bandwidth * b,
assert( tr_isBandwidth( b ) );
assert( b != parent );
//fprintf( stderr, "setting parent for %p: %p\n", b, parent );
if( b->parent )
{
void * removed;
assert( tr_isBandwidth( b->parent ) );
tr_ptrArrayRemoveSorted( &b->parent->children, b, comparePointers );
removed = tr_ptrArrayRemoveSorted( &b->parent->children, b, comparePointers );
assert( removed == b );
assert( tr_ptrArrayFindSorted( &b->parent->children, b, comparePointers ) == NULL );
//fprintf( stderr, "removed child bandwidth %p from old parent %p\n", b, b->parent );
b->parent = NULL;
}
@ -133,6 +140,8 @@ tr_bandwidthSetParent( tr_bandwidth * b,
assert( parent->parent != b );
tr_ptrArrayInsertSorted( &parent->children, b, comparePointers );
assert( tr_ptrArrayFindSorted( &parent->children, b, comparePointers ) == b );
//fprintf( stderr, "set new parent for %p: %p\n", b, parent );
b->parent = parent;
}
}