Ignore:
Timestamp:
Feb 18, 2011, 12:40:22 AM (11 years ago)
Author:
jordan
Message:

add dbgmsg statements to peer-io's uTP code

File:
1 edited

Legend:

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

    r11941 r11942  
    379379
    380380    rc = evbuffer_add( io->inbuf, buf, buflen );
     381    dbgmsg( io, "utp_on_read got %zu bytes", buflen );
     382
    381383    if( rc < 0 ) {
    382384        tr_nerr( "UTP", "On read evbuffer_add" );
     
    396398
    397399    rc = evbuffer_remove( io->outbuf, buf, buflen );
     400    dbgmsg( io, "utp_on_write sending %zu bytes... evbuffer_remove returned %d", buflen, rc );
    398401    assert( rc == (int)buflen ); /* if this fails, we've corrupted our bookkeeping somewhere */
    399402    if( rc < (long)buflen ) {
     
    413416    bytes = tr_bandwidthClamp( &io->bandwidth, TR_DOWN, UTP_READ_BUFFER_SIZE );
    414417
     418    dbgmsg( io, "utp_get_rb_size is saying it's ready to read %zu bytes", bytes );
    415419    return UTP_READ_BUFFER_SIZE - bytes;
    416420}
     
    422426    assert( tr_isPeerIo( io ) );
    423427
    424     if( state == UTP_STATE_CONNECT || state == UTP_STATE_WRITABLE ) {
    425         /* noop */
     428    if( state == UTP_STATE_CONNECT ) {
     429        dbgmsg( io, "utp_on_state_change -- changed to readable" );
     430    } else if( state == UTP_STATE_WRITABLE ) {
     431        dbgmsg( io, "utp_on_state_change -- changed to writable" );
    426432    } else if( state == UTP_STATE_EOF ) {
    427433        if( io->gotError )
     
    441447    assert( tr_isPeerIo( io ) );
    442448
     449    dbgmsg( io, "utp_on_error -- errcode is %d", errcode );
     450
    443451    if( io->gotError ) {
    444452        errno = errcode;
     
    452460    tr_peerIo *io = (tr_peerIo *)closure;
    453461    assert( tr_isPeerIo( io ) );
     462
     463    dbgmsg( io, "utp_on_overhead -- count is %zu", count );
    454464
    455465    tr_bandwidthUsed( &io->bandwidth, send ? TR_UP : TR_DOWN,
     
    562572    tr_bandwidthSetPeer( &io->bandwidth, io );
    563573    dbgmsg( io, "bandwidth is %p; its parent is %p", &io->bandwidth, parent );
     574    dbgmsg( io, "socket is %d, utp_socket is %p", socket, utp_socket );
    564575
    565576    if( io->socket >= 0 ) {
     
    570581    } else {
    571582        UTP_SetSockopt( utp_socket, SO_RCVBUF, UTP_READ_BUFFER_SIZE );
     583        dbgmsg( io, "%s", "calling UTP_SetCallbacks &utp_function_table" );
    572584        UTP_SetCallbacks( utp_socket,
    573585                          &utp_function_table,
    574586                          io );
    575         if( !isIncoming )
     587        if( !isIncoming ) {
     588            dbgmsg( io, "%s", "calling UTP_Connect" );
    576589            UTP_Connect( utp_socket );
     590        }
    577591    }
    578592
Note: See TracChangeset for help on using the changeset viewer.