mirror of
https://github.com/transmission/transmission
synced 2025-02-07 23:14:41 +00:00
(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:
parent
5b19021ab1
commit
f92fd55a80
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue