1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

if we haven't advertised that we support pex, then even if a peer sends us a pex message, don't send one back.

This commit is contained in:
Charles Kerr 2007-11-16 04:42:51 +00:00
parent b6b339e25a
commit c3dce15a9e

View file

@ -735,6 +735,7 @@ sendLtepHandshake( tr_peermsgs * msgs )
#if 0 #if 0
dbgmsg( msgs, "here is the ltep handshake we sent:" ); dbgmsg( msgs, "here is the ltep handshake we sent:" );
tr_bencPrint( &val ); tr_bencPrint( &val );
dbgmsg( msgs, "here is the ltep handshake we read [%s]:", tr_bencSave( &val, NULL ) );
#endif #endif
/* cleanup */ /* cleanup */
@ -761,6 +762,7 @@ parseLtepHandshake( tr_peermsgs * msgs, int len, struct evbuffer * inbuf )
#if 0 #if 0
dbgmsg( msgs, "here is the ltep handshake we read:" ); dbgmsg( msgs, "here is the ltep handshake we read:" );
tr_bencPrint( &val ); tr_bencPrint( &val );
dbgmsg( msgs, "here is the ltep handshake we read [%s]:", tr_bencSave( &val, NULL ) );
#endif #endif
/* does the peer prefer encrypted connections? */ /* does the peer prefer encrypted connections? */
@ -839,8 +841,11 @@ parseLtep( tr_peermsgs * msgs, int msglen, struct evbuffer * inbuf )
{ {
dbgmsg( msgs, "got ltep handshake" ); dbgmsg( msgs, "got ltep handshake" );
parseLtepHandshake( msgs, msglen, inbuf ); parseLtepHandshake( msgs, msglen, inbuf );
sendLtepHandshake( msgs ); if( tr_peerIoSupportsLTEP( msgs->io ) )
sendPex( msgs ); {
sendLtepHandshake( msgs );
sendPex( msgs );
}
} }
else if( ltep_msgid == msgs->ut_pex_id ) else if( ltep_msgid == msgs->ut_pex_id )
{ {