Ignore:
Timestamp:
Aug 16, 2007, 8:00:06 PM (15 years ago)
Author:
charles
Message:

the new tracker code seems to be working, so now it's time for me to learn yet again how much better users are at noticing bugs than I am. :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer.c

    r2803 r2805  
    4141#include "peertree.h"
    4242#include "ratecontrol.h"
     43#include "trcompat.h" /* for strlcpy */
    4344#include "utils.h"
    4445
     
    295296}
    296297
     298static const char* getPeerId( void )
     299{
     300    static char * peerId = NULL;
     301    if( !peerId ) {
     302        peerId = tr_new0( char, TR_ID_LEN + 1 );
     303        tr_peerIdNew( peerId, TR_ID_LEN + 1 );
     304    }
     305    return peerId;
     306}
     307
    297308#include "peerext.h"
    298309#include "peeraz.h"
     
    583594                               HANDSHAKE_EXTPREF_WANT_EXT );
    584595        memcpy( buf + HANDSHAKE_HASH_OFF, inf->hash, SHA_DIGEST_LENGTH );
    585         memcpy( buf + HANDSHAKE_PEERID_OFF, tor->peer_id, TR_ID_LEN );
     596        memcpy( buf + HANDSHAKE_PEERID_OFF, getPeerId(), TR_ID_LEN );
    586597
    587598        switch( tr_netSend( peer->socket, buf, 68 ) )
Note: See TracChangeset for help on using the changeset viewer.