Changeset 7769


Ignore:
Timestamp:
Jan 22, 2009, 4:20:30 AM (12 years ago)
Author:
charles
Message:

(trunk libT) well, maybe it's not a problem with sending the pex messages, but with parsing it...

File:
1 edited

Legend:

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

    r7768 r7769  
    11731173    tr_peerIoReadUint8( msgs->peer->io, inbuf, &id );
    11741174    msgs->incoming.id = id;
     1175    dbgmsg( msgs, "msgs->incoming.id is now %d; msgs->incoming.length is %zu", id, (size_t)msgs->incoming.length );
    11751176
    11761177    if( id == BT_PIECE )
     
    13421343    --msglen; /* id length */
    13431344
     1345    dbgmsg( msgs, "got BT id %d, len %d, buffer size is %zu", (int)id, (int)msglen, inlen );
     1346
    13441347    if( inlen < msglen )
    13451348        return READ_LATER;
    1346 
    1347     dbgmsg( msgs, "got BT id %d, len %d, buffer size is %zu", (int)id, (int)msglen, inlen );
    13481349
    13491350    if( !messageLengthIsCorrect( msgs, id, msglen + 1 ) )
     
    16071608    const size_t      inlen = EVBUFFER_LENGTH( in );
    16081609
     1610    dbgmsg( msgs, "canRead: inlen is %zu, msgs->state is %d", inlen, msgs->state );
     1611
    16091612    if( !inlen )
    16101613    {
     
    16301633            assert( 0 );
    16311634    }
     1635
     1636    dbgmsg( msgs, "canRead: ret is %d", (int)ret );
    16321637
    16331638    /* log the raw data that was read */
     
    19631968            int bencLen;
    19641969            uint8_t * tmp, *walk;
     1970            tr_peerIo       * io  = msgs->peer->io;
    19651971            struct evbuffer * out = msgs->outMessages;
    19661972
     
    20452051            /* write the pex message */
    20462052            benc = tr_bencSave( &val, &bencLen );
    2047             tr_peerIoWriteUint32( msgs->peer->io, out, 2 * sizeof( uint8_t ) + bencLen );
    2048             tr_peerIoWriteUint8 ( msgs->peer->io, out, BT_LTEP );
    2049             tr_peerIoWriteUint8 ( msgs->peer->io, out, msgs->ut_pex_id );
    2050             tr_peerIoWriteBytes ( msgs->peer->io, out, benc, bencLen );
     2053            tr_peerIoWriteUint32( io, out, 2 * sizeof( uint8_t ) + bencLen );
     2054            tr_peerIoWriteUint8 ( io, out, BT_LTEP );
     2055            tr_peerIoWriteUint8 ( io, out, msgs->ut_pex_id );
     2056            tr_peerIoWriteBytes ( io, out, benc, bencLen );
    20512057            pokeBatchPeriod( msgs, HIGH_PRIORITY_INTERVAL_SECS );
    20522058            dbgmsg( msgs, "sending a pex message; outMessage size is now %zu", EVBUFFER_LENGTH( out ) );
     2059            dbgOutMessageLen( msgs );
    20532060
    20542061            tr_free( benc );
Note: See TracChangeset for help on using the changeset viewer.