Changeset 8443


Ignore:
Timestamp:
May 20, 2009, 3:55:09 AM (12 years ago)
Author:
charles
Message:

(trunk libT) modified transmission-dht-20090619.patch

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r8433 r8443  
    14441444            dbgmsg( msgs, "Got a BT_PORT" );
    14451445            tr_peerIoReadUint16( msgs->peer->io, inbuf, &msgs->peer->dht_port );
     1446            if( msgs->peer->port > 0 )
     1447                tr_dhtAddNode( msgs->session, &msgs->peer->addr, msgs->peer->dht_port, 0 );
    14461448            break;
    14471449
  • trunk/libtransmission/tr-dht.c

    r8437 r8443  
    4747#include "tr-dht.h"
    4848#include "utils.h"
     49#include "version.h"
    4950
    5051static int dht_socket;
     
    109110    const uint8_t * raw;
    110111    size_t len;
     112    char v[5];
    111113
    112114    if(session)
     
    162164    }
    163165
    164     rc = dht_init(dht_socket, myid);
     166    tr_snprintf( v, sizeof( v ), "TR%02x", SVN_REVISION_NUM );
     167    rc = dht_init( dht_socket, myid, (const unsigned char*)v );
    165168    if(rc < 0)
    166169        goto fail;
     
    395398    memcpy(hash_return, sha1, hash_size > 20 ? 20 : hash_size);
    396399}
     400
     401int
     402dht_random_bytes( void * buf, size_t size )
     403{
     404    tr_cryptoRandBuf( buf, size );
     405    return size;
     406}
Note: See TracChangeset for help on using the changeset viewer.