mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
(trunk libT) probably fix r7618 reported in #transmission by Rolcol
This commit is contained in:
parent
5ccd5a7700
commit
124658791a
2 changed files with 8 additions and 2 deletions
|
@ -1095,7 +1095,7 @@ void
|
|||
tr_handshakeFree( tr_handshake * handshake )
|
||||
{
|
||||
if( handshake->io )
|
||||
tr_peerIoUnref( handshake->io );
|
||||
tr_peerIoUnref( handshake->io ); /* balanced by the ref in tr_handshakeNew */
|
||||
|
||||
tr_free( handshake );
|
||||
}
|
||||
|
@ -1172,6 +1172,7 @@ tr_handshakeNew( tr_peerIo * io,
|
|||
handshake->doneUserData = doneUserData;
|
||||
handshake->session = tr_peerIoGetSession( io );
|
||||
|
||||
tr_peerIoRef( io ); /* balanced by the unref in tr_handshakeFree */
|
||||
tr_peerIoSetIOFuncs( handshake->io, canRead, NULL, gotError, handshake );
|
||||
|
||||
if( tr_peerIoIsIncoming( handshake->io ) )
|
||||
|
|
|
@ -355,7 +355,7 @@ peerDestructor( tr_peer * peer )
|
|||
tr_peerMsgsFree( peer->msgs );
|
||||
}
|
||||
|
||||
tr_peerIoUnref( peer->io );
|
||||
tr_peerIoUnref( peer->io ); /* balanced by the ref in handshakeDoneCB() */
|
||||
|
||||
tr_bitfieldFree( peer->have );
|
||||
tr_bitfieldFree( peer->blame );
|
||||
|
@ -1258,6 +1258,7 @@ myHandshakeDoneCB( tr_handshake * handshake,
|
|||
|
||||
peer->port = port;
|
||||
peer->io = tr_handshakeStealIO( handshake );
|
||||
tr_peerIoRef( peer->io ); /* balanced by the unref in peerDestructor() */
|
||||
tr_peerIoSetParent( peer->io, t->tor->bandwidth );
|
||||
tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
|
||||
|
||||
|
@ -1304,6 +1305,8 @@ tr_peerMgrAddIncoming( tr_peerMgr * manager,
|
|||
myHandshakeDoneCB,
|
||||
manager );
|
||||
|
||||
tr_peerIoUnref( io ); /* balanced by the implicit ref in tr_peerIoNewIncoming() */
|
||||
|
||||
tr_ptrArrayInsertSorted( &manager->incomingHandshakes, handshake,
|
||||
handshakeCompare );
|
||||
}
|
||||
|
@ -2325,6 +2328,8 @@ tordbg( t, "nCandidates is %d, MAX_RECONNECTIONS_PER_PULSE is %d, getPeerCount(t
|
|||
|
||||
assert( tr_peerIoGetTorrentHash( io ) );
|
||||
|
||||
tr_peerIoUnref( io ); /* balanced by the implicit ref in tr_peerIoNewOutgoing() */
|
||||
|
||||
++newConnectionsThisSecond;
|
||||
|
||||
tr_ptrArrayInsertSorted( &t->outgoingHandshakes, handshake,
|
||||
|
|
Loading…
Reference in a new issue