Ignore:
Timestamp:
May 8, 2010, 8:42:45 AM (12 years ago)
Author:
charles
Message:

(trunk) #3060 "Local Peer Discovery" -- in the code, rename LDS as LPD for Local Peer Discovery

File:
1 moved

Legend:

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

    r10634 r10635  
    4545#include "session.h"
    4646#include "torrent.h" /* tr_torrentFindFromHash() */
    47 #include "tr-lds.h"
     47#include "tr-lpd.h"
    4848#include "utils.h"
    4949#include "version.h"
     
    5151/**
    5252* @brief Local Peer Discovery
    53 * @file tr-lds.c
    54 *
    55 * This module implements the Local Peer Discovery (LDS) protocol as supported by the
    56 * uTorrent client application.  A typical LDS datagram is 119 bytes long.
     53* @file tr-lpd.c
     54*
     55* This module implements the Local Peer Discovery (LPD) protocol as supported by the
     56* uTorrent client application.  A typical LPD datagram is 119 bytes long.
    5757*
    5858* $Id$
     
    6161static void event_callback( int, short, void* );
    6262
    63 static int lds_socket; /**<separate multicast receive socket */
    64 static int lds_socket2; /**<and multicast send socket */
    65 static struct event lds_event;
    66 static tr_port lds_port;
    67 
    68 static tr_torrent* lds_torStaticType UNUSED; /* just a helper for static type analysis */
     63static int lpd_socket; /**<separate multicast receive socket */
     64static int lpd_socket2; /**<and multicast send socket */
     65static struct event lpd_event;
     66static tr_port lpd_port;
     67
     68static tr_torrent* lpd_torStaticType UNUSED; /* just a helper for static type analysis */
    6969static tr_session* session;
    7070
    71 enum { lds_maxDatagramLength = 200 }; /**<the size an LDS datagram must not exceed */
    72 const char lds_mcastGroup[] = "239.192.152.143"; /**<LDS multicast group */
    73 const int lds_mcastPort = 6771; /**<LDS source and destination UPD port */
    74 static struct sockaddr_in lds_mcastAddr; /**<initialized from the above constants in tr_ldsInit */
     71enum { lpd_maxDatagramLength = 200 }; /**<the size an LPD datagram must not exceed */
     72const char lpd_mcastGroup[] = "239.192.152.143"; /**<LPD multicast group */
     73const int lpd_mcastPort = 6771; /**<LPD source and destination UPD port */
     74static struct sockaddr_in lpd_mcastAddr; /**<initialized from the above constants in tr_lpdInit */
    7575
    7676/**
    7777* @brief Protocol-related information carried by a Local Peer Discovery packet */
    78 struct lds_protocolVersion
     78struct lpd_protocolVersion
    7979{
    8080    int major, minor;
    8181};
    8282
    83 enum lds_enumTimeToLive {
    84     lds_ttlSameSubnet = 1,
    85     lds_ttlSameSite = 32,
    86     lds_ttlSameRegion = 64,
    87     lds_ttlSameContinent = 128,
    88     lds_ttlUnrestricted = 255
     83enum lpd_enumTimeToLive {
     84    lpd_ttlSameSubnet = 1,
     85    lpd_ttlSameSite = 32,
     86    lpd_ttlSameRegion = 64,
     87    lpd_ttlSameContinent = 128,
     88    lpd_ttlUnrestricted = 255
    8989};
    9090
    9191enum {
    92     lds_announceInterval = 4 * 60, /**<4 min announce interval per torrent */
    93     lds_announceScope = lds_ttlSameSubnet /**<the maximum scope for LDS datagrams */
     92    lpd_announceInterval = 4 * 60, /**<4 min announce interval per torrent */
     93    lpd_announceScope = lpd_ttlSameSubnet /**<the maximum scope for LPD datagrams */
    9494};
    9595
     
    113113* @brief allow at most ten messages per second (interval average)
    114114* @note this constraint is only enforced once per housekeeping interval */
    115 enum { lds_announceCapFactor = 10 };
     115enum { lpd_announceCapFactor = 10 };
    116116
    117117/**
     
    119119* @brief number of unsolicited messages during the last HK interval
    120120* @remark counts downwards */
    121 static int lds_unsolicitedMsgCounter;
     121static int lpd_unsolicitedMsgCounter;
    122122
    123123/**
    124124* @def CRLF
    125 * @brief a line-feed, as understood by the LDS protocol */
     125* @brief a line-feed, as understood by the LPD protocol */
    126126#define CRLF "\r\n"
    127127
     
    145145* in this case the function returns a character sequence beginning with CRLF).
    146146* If parameter is not NULL, the declared protocol version is returned as part of
    147 * the lds_protocolVersion structure.
    148 */
    149 static const char* lds_extractHeader( const char* s, struct lds_protocolVersion* const ver )
     147* the lpd_protocolVersion structure.
     148*/
     149static const char* lpd_extractHeader( const char* s, struct lpd_protocolVersion* const ver )
    150150{
    151151    int major = -1, minor = -1;
     
    156156
    157157    /* something might be rotten with this chunk of data */
    158     if( len == 0 || len > lds_maxDatagramLength )
     158    if( len == 0 || len > lpd_maxDatagramLength )
    159159        return NULL;
    160160
     
    199199*   - copy back value from end to next "\r\n"
    200200*/
    201 static int lds_extractParam( const char* const str, const char* const name, int n, char* const val )
     201static int lpd_extractParam( const char* const str, const char* const name, int n, char* const val )
    202202{
    203203    /* configure maximum length of search string here */
     
    245245/**
    246246* @brief Configures additional capabilities for a socket */
    247 static inline int lds_configureSocket( int sock, int add )
     247static inline int lpd_configureSocket( int sock, int add )
    248248{
    249249    /* read-modify-write socket flags */
     
    265265* and event-based message handling.
    266266*
    267 * @remark Since the LDS service does not use another protocol family yet, this code is
     267* @remark Since the LPD service does not use another protocol family yet, this code is
    268268* IPv4 only for the time being.
    269269*/
    270 int tr_ldsInit( tr_session* ss, tr_address* tr_addr UNUSED )
     270int tr_lpdInit( tr_session* ss, tr_address* tr_addr UNUSED )
    271271{
    272272    struct ip_mreq mcastReq;
     
    276276        return -1;
    277277
    278     assert( lds_announceInterval > 0 );
    279     assert( lds_announceScope > 0 );
    280 
    281     lds_port = tr_sessionGetPeerPort( ss );
    282     if( lds_port <= 0 )
     278    assert( lpd_announceInterval > 0 );
     279    assert( lpd_announceScope > 0 );
     280
     281    lpd_port = tr_sessionGetPeerPort( ss );
     282    if( lpd_port <= 0 )
    283283        return -1;
    284284
    285     tr_ndbg( "LDS", "Initialising Local Peer Discovery" );
     285    tr_ndbg( "LPD", "Initialising Local Peer Discovery" );
    286286
    287287    /* setup datagram socket (receive) */
    288288    {
    289         lds_socket = socket( PF_INET, SOCK_DGRAM, 0 );
    290         if( lds_socket < 0 )
     289        lpd_socket = socket( PF_INET, SOCK_DGRAM, 0 );
     290        if( lpd_socket < 0 )
    291291            goto fail;
    292292
    293293        /* enable non-blocking operation */
    294         if( lds_configureSocket( lds_socket, O_NONBLOCK ) < 0 )
    295             goto fail;
    296 
    297         if( setsockopt( lds_socket, SOL_SOCKET, SO_REUSEADDR,
     294        if( lpd_configureSocket( lpd_socket, O_NONBLOCK ) < 0 )
     295            goto fail;
     296
     297        if( setsockopt( lpd_socket, SOL_SOCKET, SO_REUSEADDR,
    298298                &opt_on, sizeof opt_on ) < 0 )
    299299            goto fail;
    300300
    301         memset( &lds_mcastAddr, 0, sizeof lds_mcastAddr );
    302         lds_mcastAddr.sin_family = AF_INET;
    303         lds_mcastAddr.sin_port = htons( lds_mcastPort );
    304         if( inet_pton( lds_mcastAddr.sin_family, lds_mcastGroup,
    305                 &lds_mcastAddr.sin_addr ) < 0 )
    306             goto fail;
    307 
    308         if( bind( lds_socket, (struct sockaddr*) &lds_mcastAddr,
    309                 sizeof lds_mcastAddr ) < 0 )
    310             goto fail;
    311 
    312         /* we want to join that LDS multicast group */
     301        memset( &lpd_mcastAddr, 0, sizeof lpd_mcastAddr );
     302        lpd_mcastAddr.sin_family = AF_INET;
     303        lpd_mcastAddr.sin_port = htons( lpd_mcastPort );
     304        if( inet_pton( lpd_mcastAddr.sin_family, lpd_mcastGroup,
     305                &lpd_mcastAddr.sin_addr ) < 0 )
     306            goto fail;
     307
     308        if( bind( lpd_socket, (struct sockaddr*) &lpd_mcastAddr,
     309                sizeof lpd_mcastAddr ) < 0 )
     310            goto fail;
     311
     312        /* we want to join that LPD multicast group */
    313313        memset( &mcastReq, 0, sizeof mcastReq );
    314         mcastReq.imr_multiaddr = lds_mcastAddr.sin_addr;
     314        mcastReq.imr_multiaddr = lpd_mcastAddr.sin_addr;
    315315        mcastReq.imr_interface.s_addr = htonl( INADDR_ANY );
    316         if( setsockopt( lds_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
     316        if( setsockopt( lpd_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
    317317                &mcastReq, sizeof mcastReq ) < 0 )
    318318            goto fail;
    319319
    320         if( setsockopt( lds_socket, IPPROTO_IP, IP_MULTICAST_LOOP,
     320        if( setsockopt( lpd_socket, IPPROTO_IP, IP_MULTICAST_LOOP,
    321321                &opt_off, sizeof opt_off ) < 0 )
    322322            goto fail;
     
    325325    /* setup datagram socket (send) */
    326326    {
    327         const unsigned char scope = lds_announceScope;
    328 
    329         lds_socket2 = socket( PF_INET, SOCK_DGRAM, 0 );
    330         if( lds_socket2 < 0 )
     327        const unsigned char scope = lpd_announceScope;
     328
     329        lpd_socket2 = socket( PF_INET, SOCK_DGRAM, 0 );
     330        if( lpd_socket2 < 0 )
    331331            goto fail;
    332332
    333333        /* enable non-blocking operation */
    334         if( lds_configureSocket( lds_socket2, O_NONBLOCK ) < 0 )
     334        if( lpd_configureSocket( lpd_socket2, O_NONBLOCK ) < 0 )
    335335            goto fail;
    336336
    337337        /* configure outbound multicast TTL */
    338         if( setsockopt( lds_socket2, IPPROTO_IP, IP_MULTICAST_TTL,
     338        if( setsockopt( lpd_socket2, IPPROTO_IP, IP_MULTICAST_TTL,
    339339                &scope, sizeof scope ) < 0 )
    340340            goto fail;
    341341
    342         if( setsockopt( lds_socket2, IPPROTO_IP, IP_MULTICAST_LOOP,
     342        if( setsockopt( lpd_socket2, IPPROTO_IP, IP_MULTICAST_LOOP,
    343343                &opt_off, sizeof opt_off ) < 0 )
    344344            goto fail;
     
    347347    session = ss;
    348348
    349     /* Note: lds_unsolicitedMsgCounter remains 0 until the first timeout event, thus
     349    /* Note: lpd_unsolicitedMsgCounter remains 0 until the first timeout event, thus
    350350     * any announcement received during the initial interval will be discarded. */
    351351
    352     event_set( &lds_event, lds_socket, EV_READ | EV_PERSIST, event_callback, NULL );
    353     event_add( &lds_event, NULL );
    354 
    355     tr_ndbg( "LDS", "Local Peer Discovery initialised" );
     352    event_set( &lpd_event, lpd_socket, EV_READ | EV_PERSIST, event_callback, NULL );
     353    event_add( &lpd_event, NULL );
     354
     355    tr_ndbg( "LPD", "Local Peer Discovery initialised" );
    356356
    357357    return 1;
     
    360360    {
    361361        const int save = errno;
    362         close( lds_socket );
    363         close( lds_socket2 );
    364         lds_socket = lds_socket2 = -1;
     362        close( lpd_socket );
     363        close( lpd_socket2 );
     364        lpd_socket = lpd_socket2 = -1;
    365365        session = NULL;
    366         tr_ndbg( "LDS", "LDS initialisation failed (errno = %d)", save );
     366        tr_ndbg( "LPD", "LPD initialisation failed (errno = %d)", save );
    367367        errno = save;
    368368    }
     
    372372}
    373373
    374 void tr_ldsUninit( tr_session* ss )
     374void tr_lpdUninit( tr_session* ss )
    375375{
    376376    if( session != ss )
    377377        return;
    378378
    379     tr_ndbg( "LDS", "Uninitialising Local Peer Discovery" );
    380 
    381     event_del( &lds_event );
     379    tr_ndbg( "LPD", "Uninitialising Local Peer Discovery" );
     380
     381    event_del( &lpd_event );
    382382
    383383    /* just shut down, we won't remember any former nodes */
    384     EVUTIL_CLOSESOCKET( lds_socket );
    385     EVUTIL_CLOSESOCKET( lds_socket2 );
    386     tr_ndbg( "LDS", "Done uninitialising Local Peer Discovery" );
     384    EVUTIL_CLOSESOCKET( lpd_socket );
     385    EVUTIL_CLOSESOCKET( lpd_socket2 );
     386    tr_ndbg( "LPD", "Done uninitialising Local Peer Discovery" );
    387387
    388388    session = NULL;
    389389}
    390390
    391 tr_bool tr_ldsEnabled( const tr_session* ss )
     391tr_bool tr_lpdEnabled( const tr_session* ss )
    392392{
    393393    return ss && ( ss == session );
     
    399399* @brief Performs some (internal) software consistency checks at compile time.
    400400* @remark Declared inline for the compiler not to allege us of feeding unused
    401 * functions. In any other respect, lds_consistencyCheck is an orphaned function.
    402 */
    403 static inline void lds_consistencyCheck( void )
     401* functions. In any other respect, lpd_consistencyCheck is an orphaned function.
     402*/
     403static inline void lpd_consistencyCheck( void )
    404404{
    405405    /* if the following check fails, the definition of a hash string has changed
    406      * without our knowledge; revise string handling in functions tr_ldsSendAnnounce
    407      * and tr_ldsConsiderAnnounce. However, the code is designed to function as long
     406     * without our knowledge; revise string handling in functions tr_lpdSendAnnounce
     407     * and tr_lpdConsiderAnnounce. However, the code is designed to function as long
    408408     * as interfaces to the rest of the lib remain compatible with char* strings. */
    409     STATIC_ASSERT( sizeof(lds_torStaticType->info.hashString[0]) == sizeof(char) );
     409    STATIC_ASSERT( sizeof(lpd_torStaticType->info.hashString[0]) == sizeof(char) );
    410410}
    411411/**
     
    414414
    415415/**
    416 * @defgroup LdsProto LDS announcement processing
     416* @defgroup LdsProto LPD announcement processing
    417417* @{
    418418*/
     
    424424* @return Returns TRUE on success
    425425*
    426 * Send a query for torrent t out to the LDS multicast group (or the LAN, for that
     426* Send a query for torrent t out to the LPD multicast group (or the LAN, for that
    427427* matter).  A listening client on the same network might react by adding us to his
    428428* peer pool for torrent t.
    429429*/
    430 tr_bool tr_ldsSendAnnounce( const tr_torrent* t )
     430tr_bool tr_lpdSendAnnounce( const tr_torrent* t )
    431431{
    432432    const char fmt[] =
     
    439439
    440440    char hashString[lengthof( t->info.hashString )];
    441     char query[lds_maxDatagramLength + 1] = { };
     441    char query[lpd_maxDatagramLength + 1] = { };
    442442
    443443    if( t == NULL )
     
    449449
    450450    /* prepare a zero-terminated announce message */
    451     snprintf( query, lds_maxDatagramLength + 1, fmt, 1, 1,
    452         lds_mcastGroup, lds_mcastPort, lds_port, hashString );
    453 
    454     /* actually send the query out using [lds_socket2] */
     451    snprintf( query, lpd_maxDatagramLength + 1, fmt, 1, 1,
     452        lpd_mcastGroup, lpd_mcastPort, lpd_port, hashString );
     453
     454    /* actually send the query out using [lpd_socket2] */
    455455    {
    456456        const int len = strlen( query );
    457457
    458         /* destination address info has already been set up in tr_ldsInit(),
     458        /* destination address info has already been set up in tr_lpdInit(),
    459459         * so we refrain from preparing another sockaddr_in here */
    460         int res = sendto( lds_socket2, query, len, 0,
    461             (const struct sockaddr*) &lds_mcastAddr, sizeof lds_mcastAddr );
     460        int res = sendto( lpd_socket2, query, len, 0,
     461            (const struct sockaddr*) &lpd_mcastAddr, sizeof lpd_mcastAddr );
    462462
    463463        if( res != len )
     
    465465    }
    466466
    467     tr_tordbg( t, "LDS announce message away" );
     467    tr_tordbg( t, "LPD announce message away" );
    468468
    469469    return TRUE;
     
    480480* the peer in/out parameter.
    481481*
    482 * @note The port information gets added to the peer structure if tr_ldsConsiderAnnounce
     482* @note The port information gets added to the peer structure if tr_lpdConsiderAnnounce
    483483* is able to extract the necessary information from the announce message.  That is, if
    484484* return != 0, the caller may retrieve the value from the passed structure.
    485485*/
    486 static int tr_ldsConsiderAnnounce( tr_pex* peer, const char* const msg )
     486static int tr_lpdConsiderAnnounce( tr_pex* peer, const char* const msg )
    487487{
    488488    enum
    489489    {
    490490        maxValueLen = 25,
    491         maxHashLen = lengthof(lds_torStaticType->info.hashString)
     491        maxHashLen = lengthof(lpd_torStaticType->info.hashString)
    492492    };
    493493
    494     struct lds_protocolVersion ver = { -1, -1 };
     494    struct lpd_protocolVersion ver = { -1, -1 };
    495495    char value[maxValueLen] = { };
    496496    char hashString[maxHashLen] = { };
     
    501501        tr_torrent* tor = NULL;
    502502
    503         const char* params = lds_extractHeader( msg, &ver );
     503        const char* params = lpd_extractHeader( msg, &ver );
    504504        if( params == NULL || ver.major != 1 ) /* allow messages of protocol v1 */
    505505            return 0;
     
    507507        /* save the effort to check Host, which seems to be optional anyway */
    508508
    509         if( lds_extractParam( params, "Port", maxValueLen, value ) == 0 )
     509        if( lpd_extractParam( params, "Port", maxValueLen, value ) == 0 )
    510510            return 0;
    511511
     
    517517        res = -1; /* signal caller side-effect to peer->port via return != 0 */
    518518
    519         if( lds_extractParam( params, "Infohash", maxHashLen, hashString ) == 0 )
     519        if( lpd_extractParam( params, "Infohash", maxHashLen, hashString ) == 0 )
    520520            return res;
    521521
    522522        tor = tr_torrentFindFromHashString( session, hashString );
    523523
    524         if( tr_isTorrent( tor ) && tr_torrentAllowsLDS( tor ) )
     524        if( tr_isTorrent( tor ) && tr_torrentAllowsLPD( tor ) )
    525525        {
    526526            /* we found a suitable peer, add it to the torrent */
    527             tr_peerMgrAddPex( tor, TR_PEER_FROM_LDS, peer, -1 );
    528             tr_tordbg( tor, "Learned %d local peer from LDS (%s:%u)",
     527            tr_peerMgrAddPex( tor, TR_PEER_FROM_LPD, peer, -1 );
     528            tr_tordbg( tor, "Learned %d local peer from LPD (%s:%u)",
    529529                1, inet_ntoa( peer->addr.addr.addr4 ), peerPort );
    530530
     
    534534        }
    535535        else
    536             tr_ndbg( "LDS", "Cannot serve torrent #%s", hashString );
     536            tr_ndbg( "LPD", "Cannot serve torrent #%s", hashString );
    537537    }
    538538
     
    544544
    545545/**
    546 * @note Since it possible for tr_ldsAnnounceMore to get called from outside the LDS module,
     546* @note Since it possible for tr_lpdAnnounceMore to get called from outside the LPD module,
    547547* the function needs to be informed of the externally employed housekeeping interval.
    548 * Further, by setting interval to zero (or negative) the caller may actually disable LDS
     548* Further, by setting interval to zero (or negative) the caller may actually disable LPD
    549549* announces on a per-interval basis.
    550550*/
    551 int tr_ldsAnnounceMore( const time_t now, const int interval )
     551int tr_lpdAnnounceMore( const time_t now, const int interval )
    552552{
    553553    tr_torrent* tor = NULL;
     
    558558
    559559    while(( tor = tr_torrentNext( session, tor ) )
    560           && tr_sessionAllowsLDS( session ) )
     560          && tr_sessionAllowsLPD( session ) )
    561561    {
    562562        if( tr_isTorrent( tor ) )
    563563        {
    564             if( !tr_torrentAllowsLDS( tor ) || (
     564            if( !tr_torrentAllowsLPD( tor ) || (
    565565                    ( tr_torrentGetActivity( tor ) != TR_STATUS_DOWNLOAD ) &&
    566566                    ( tr_torrentGetActivity( tor ) != TR_STATUS_SEED ) ) )
    567567                continue;
    568568
    569             if( tor->ldsAnnounceAt <= now )
     569            if( tor->lpdAnnounceAt <= now )
    570570            {
    571                 if( tr_ldsSendAnnounce( tor ) )
     571                if( tr_lpdSendAnnounce( tor ) )
    572572                    announcesSent++;
    573573
    574                 tor->ldsAnnounceAt = now + lds_announceInterval;
     574                tor->lpdAnnounceAt = now + lpd_announceInterval;
    575575                break; /* that's enough; for this interval */
    576576            }
     
    580580    /* perform housekeeping for the flood protection mechanism */
    581581    {
    582         const int maxAnnounceCap = interval * lds_announceCapFactor;
    583 
    584         if( lds_unsolicitedMsgCounter < 0 )
    585             tr_ninf( "LDS", "Dropped %d announces in the last interval (max. %d "
    586                      "allowed)", -lds_unsolicitedMsgCounter, maxAnnounceCap );
    587 
    588         lds_unsolicitedMsgCounter = maxAnnounceCap;
     582        const int maxAnnounceCap = interval * lpd_announceCapFactor;
     583
     584        if( lpd_unsolicitedMsgCounter < 0 )
     585            tr_ninf( "LPD", "Dropped %d announces in the last interval (max. %d "
     586                     "allowed)", -lpd_unsolicitedMsgCounter, maxAnnounceCap );
     587
     588        lpd_unsolicitedMsgCounter = maxAnnounceCap;
    589589    }
    590590
     
    594594/**
    595595* @brief Processing of timeout notifications and incoming data on the socket
    596 * @note maximum rate of read events is limited according to @a lds_maxAnnounceCap
     596* @note maximum rate of read events is limited according to @a lpd_maxAnnounceCap
    597597* @see DoS */
    598598static void event_callback( int s UNUSED, short type, void* ignore UNUSED )
     
    600600    assert( tr_isSession( session ) );
    601601
    602     /* do not allow announces to be processed if LDS is disabled */
    603     if( !tr_sessionAllowsLDS( session ) )
     602    /* do not allow announces to be processed if LPD is disabled */
     603    if( !tr_sessionAllowsLPD( session ) )
    604604        return;
    605605
     
    610610
    611611        /* be paranoid enough about zero terminating the foreign string */
    612         char foreignMsg[lds_maxDatagramLength + 1] = { };
     612        char foreignMsg[lpd_maxDatagramLength + 1] = { };
    613613
    614614        /* process local announcement from foreign peer */
    615         int res = recvfrom( lds_socket, foreignMsg, lds_maxDatagramLength,
     615        int res = recvfrom( lpd_socket, foreignMsg, lpd_maxDatagramLength,
    616616            0, (struct sockaddr*) &foreignAddr, (socklen_t*) &addrLen );
    617617
    618618        /* besides, do we get flooded? then bail out! */
    619         if( --lds_unsolicitedMsgCounter < 0 )
     619        if( --lpd_unsolicitedMsgCounter < 0 )
    620620            return;
    621621
    622         if( res > 0 && res <= lds_maxDatagramLength )
     622        if( res > 0 && res <= lpd_maxDatagramLength )
    623623        {
    624624            struct tr_pex foreignPeer =
     
    629629
    630630            foreignPeer.addr.addr.addr4 = foreignAddr.sin_addr;
    631             if( tr_ldsConsiderAnnounce( &foreignPeer, foreignMsg ) != 0 )
     631            if( tr_lpdConsiderAnnounce( &foreignPeer, foreignMsg ) != 0 )
    632632                return; /* OK so far, no log message */
    633633        }
    634634
    635         tr_ndbg( "LDS", "Discarded invalid multicast message" );
    636     }
    637 }
    638 
     635        tr_ndbg( "LPD", "Discarded invalid multicast message" );
     636    }
     637}
     638
Note: See TracChangeset for help on using the changeset viewer.