Changeset 10201


Ignore:
Timestamp:
Feb 14, 2010, 7:35:09 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2903 "Don't send DHT port messages to peers if we didn't advertise support for DHT in the handshake" -- fixed in trunk for 1.90

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r9868 r10201  
    226226    HANDSHAKE_SET_FASTEXT( walk );
    227227
    228     /* Note that this doesn't depend on whether the torrent is private.  We
    229        don't accept DHT peers for a private torrent, but we participate in
    230        the DHT regardless. */
    231     if(tr_dhtEnabled(handshake->session))
     228    /* Note that this doesn't depend on whether the torrent is private.
     229     * We don't accept DHT peers for a private torrent,
     230     * but we participate in the DHT regardless. */
     231    if( tr_dhtEnabled( handshake->session ) )
    232232        HANDSHAKE_SET_DHT( walk );
    233233
     
    313313    tr_peerIoEnableFEXT( handshake->io, HANDSHAKE_HAS_FASTEXT( reserved ) );
    314314
    315     /* This is independent of whether or not DHT is actually used.
    316      * it's okay to set this flag even for private torrents */
    317     if( tor && tr_sessionAllowsDHT( tor->session ) )
    318         tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) );
     315    tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) );
    319316
    320317    return HANDSHAKE_OK;
     
    676673    tr_peerIoEnableFEXT( handshake->io, HANDSHAKE_HAS_FASTEXT( reserved ) );
    677674
    678     /* This is independent of whether or not DHT is actually used.
    679      * it's okay to set this flag even for private torrents */
    680     if( tr_sessionAllowsDHT( handshake->session ) )
    681         tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) );
     675    tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) );
    682676
    683677    /* torrent hash */
  • trunk/libtransmission/peer-msgs.c

    r10140 r10201  
    23592359        sendLtepHandshake( m );
    23602360
    2361     if(tr_peerIoSupportsDHT(peer->io)) {
     2361    if( tr_dhtEnabled( torrent->session ) && tr_peerIoSupportsDHT( peer->io ))
     2362    {
    23622363        /* Only send PORT over IPv6 when the IPv6 DHT is running (BEP-32). */
    23632364        const struct tr_address *addr = tr_peerIoGetAddress( peer->io, NULL );
  • trunk/libtransmission/tr-dht.c

    r10160 r10201  
    483483
    484484tr_bool
    485 tr_dhtEnabled( tr_session * ss )
     485tr_dhtEnabled( const tr_session * ss )
    486486{
    487487    return ss && ( ss == session );
  • trunk/libtransmission/tr-dht.h

    r9765 r10201  
    3636int  tr_dhtInit( tr_session *, const tr_address * );
    3737void tr_dhtUninit( tr_session * );
    38 tr_bool tr_dhtEnabled( tr_session * );
     38tr_bool tr_dhtEnabled( const tr_session * );
    3939tr_port tr_dhtPort ( tr_session * );
    4040int tr_dhtStatus( tr_session *, int af, int * setme_nodeCount );
Note: See TracChangeset for help on using the changeset viewer.