Changeset 11926


Ignore:
Timestamp:
Feb 18, 2011, 12:35:56 AM (11 years ago)
Author:
jch
Message:

Push testig for UTP enabled further down.

There's no need to test for DHT/uTP being enabled in tr-udp. The DHT
will silently discard any packets directed at the wrong session (see the
beginning of dhtCallback). As to uTP, we need to grok uTP packets
to close any remaining connections after we disabled uTP, so it's better
to participate in uTP, just reject any incoming connections.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tr-udp.c

    r11925 r11926  
    136136        return;
    137137
    138     if((buf[0] == 'd') && tr_sessionIsDHTEnabled(ss)) {
     138    if( buf[0] == 'd' ) {
    139139        /* DHT packet. */
    140140        buf[rc] = '\0';
    141141        tr_dhtCallback(buf, rc, (struct sockaddr*)&from, fromlen, sv);
    142     } else if(tr_sessionIsUTPEnabled(ss)){
     142    } else {
    143143        rc = tr_utpPacket(buf, rc, (struct sockaddr*)&from, fromlen, ss);
    144144        if(!rc)
  • trunk/libtransmission/tr-utp.c

    r11922 r11926  
    5050    tr_address addr;
    5151    tr_port port;
     52
     53    if( !tr_sessionIsUTPEnabled(ss) ) {
     54        UTP_Close(s);
     55        return;
     56    }
    5257   
    5358    UTP_GetPeerName(s, from, &fromlen);
Note: See TracChangeset for help on using the changeset viewer.