mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
Quick fix for the 'getting unconnectable' problem (adds a timeout on
incoming connections)
This commit is contained in:
parent
a2066e56bf
commit
eba49d3d2a
3 changed files with 12 additions and 0 deletions
|
@ -264,6 +264,11 @@ int tr_peerRead( tr_torrent_t * tor, tr_peer_t * peer )
|
|||
return 0;
|
||||
}
|
||||
|
||||
uint64_t tr_peerDate( tr_peer_t * peer )
|
||||
{
|
||||
return peer->date;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* tr_peerHash
|
||||
***********************************************************************
|
||||
|
|
|
@ -32,6 +32,7 @@ void tr_peerAttach ( tr_torrent_t *, tr_peer_t * );
|
|||
void tr_peerDestroy ( tr_fd_t *, tr_peer_t * );
|
||||
void tr_peerRem ( tr_torrent_t *, int );
|
||||
int tr_peerRead ( tr_torrent_t *, tr_peer_t * );
|
||||
uint64_t tr_peerDate ( tr_peer_t * );
|
||||
uint8_t * tr_peerHash ( tr_peer_t * );
|
||||
void tr_peerPulse ( tr_torrent_t * );
|
||||
int tr_peerIsConnected ( tr_peer_t * );
|
||||
|
|
|
@ -655,6 +655,12 @@ static void acceptLoop( void * _h )
|
|||
tr_peerDestroy( h->fdlimit, h->acceptPeers[ii] );
|
||||
goto removePeer;
|
||||
}
|
||||
if( date1 > tr_peerDate( h->acceptPeers[ii] ) + 10000 )
|
||||
{
|
||||
/* Give them 10 seconds to send the handshake */
|
||||
tr_peerDestroy( h->fdlimit, h->acceptPeers[ii] );
|
||||
goto removePeer;
|
||||
}
|
||||
ii++;
|
||||
continue;
|
||||
removePeer:
|
||||
|
|
Loading…
Reference in a new issue