Changeset 3815


Ignore:
Timestamp:
Nov 12, 2007, 10:26:10 PM (14 years ago)
Author:
charles
Message:

minor tweaks.

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r3775 r3815  
    4949};
    5050
     51static void
     52tr_cpReset( tr_completion * cp )
     53{
     54    tr_torrent * tor = cp->tor;
     55
     56    tr_bitfieldClear( cp->pieceBitfield );
     57    tr_bitfieldClear( cp->blockBitfield );
     58    memset( cp->completeBlocks, 0, sizeof(uint16_t) * tor->info.pieceCount );
     59
     60    cp->doneDirty = TRUE;
     61    cp->doneHave = 0;
     62    cp->doneTotal = 0;
     63    cp->completeHave = 0;
     64}
     65
    5166tr_completion * tr_cpInit( tr_torrent * tor )
    5267{
     
    7085    tr_bitfieldFree( cp->blockBitfield );
    7186    tr_free(         cp );
    72 }
    73 
    74 void tr_cpReset( tr_completion * cp )
    75 {
    76     tr_torrent * tor = cp->tor;
    77 
    78     tr_bitfieldClear( cp->pieceBitfield );
    79     tr_bitfieldClear( cp->blockBitfield );
    80     memset( cp->completeBlocks, 0, sizeof(uint16_t) * tor->info.pieceCount );
    81 
    82     cp->doneDirty = TRUE;
    83     cp->doneHave = 0;
    84     cp->doneTotal = 0;
    85     cp->completeHave = 0;
    8687}
    8788
     
    311312        b -= (info->pieceSize - (info->totalSize % info->pieceSize));
    312313
    313    return b;
     314    return b;
    314315}
    315316
     
    317318tr_cpHaveTotal( const tr_completion * cp )
    318319{
    319    return cp->completeHave;
    320 }
     320    return cp->completeHave;
     321}
  • trunk/libtransmission/completion.h

    r3178 r3815  
    3232tr_completion  * tr_cpInit( tr_torrent * );
    3333void             tr_cpClose( tr_completion * );
    34 void             tr_cpReset( tr_completion * );
    3534
    3635/* General */
  • trunk/libtransmission/fastresume.c

    r3775 r3815  
    789789
    790790        /* if we didn't read the data, seek past it */
    791         tr_inf( "Skipping resume data type %02x, %u bytes", id, len );
     791        tr_dbg( "Skipping resume data type %02x, %u bytes", id, len );
    792792        fseek( file, len, SEEK_CUR );
    793793    }
  • trunk/libtransmission/ratecontrol.c

    r3615 r3815  
    2323 *****************************************************************************/
    2424
    25 #include <string.h>
     25#include <string.h> /* memset */
    2626
    2727#include "transmission.h"
    2828#include "platform.h"
    2929#include "ratecontrol.h"
    30 #include "shared.h"
    3130#include "utils.h"
    3231
     
    3635#define HISTORY_SIZE (LONG_INTERVAL_MSEC / GRANULARITY_MSEC)
    3736
    38 typedef struct
     37struct tr_transfer
    3938{
    4039    uint64_t date;
    4140    uint64_t size;
    42 }
    43 tr_transfer_t;
     41};
    4442
    4543struct tr_ratecontrol
     
    4846    int limit;
    4947    int newest;
    50     tr_transfer_t transfers[HISTORY_SIZE];
     48    struct tr_transfer transfers[HISTORY_SIZE];
    5149};
    5250
     
    183181    tr_lockLock( (tr_lock*)r->lock );
    184182    r->newest = 0;
    185     memset( r->transfers, 0, sizeof(tr_transfer_t) * HISTORY_SIZE );
     183    memset( r->transfers, 0, sizeof(struct tr_transfer) * HISTORY_SIZE );
    186184    tr_lockUnlock( (tr_lock*)r->lock );
    187185}
  • trunk/libtransmission/upnp.c

    r3770 r3815  
    6565        struct UPNPDev * devlist = upnpDiscover( 2000, NULL );
    6666        if( UPNP_GetValidIGD( devlist, &handle->urls, &handle->data, handle->lanaddr, sizeof(handle->lanaddr))) {
    67             tr_dbg( "Found Internet Gateway Device '%s'", handle->urls.controlURL );
    68             tr_dbg( "Local LAN IP Address is '%s'", handle->lanaddr );
     67            tr_dbg( "UPNP: Found Internet Gateway Device '%s'", handle->urls.controlURL );
     68            tr_dbg( "UPNP: Local LAN IP Address is '%s'", handle->lanaddr );
    6969        }
    7070        freeUPNPDevlist( devlist );
     
    8585                                                      "Transmission", "TCP" ) );
    8686
    87         tr_dbg( "UPNP Port Forwarding via '%s', service '%s'.  (local address: %s:%d)",
     87        tr_inf( "UPNP: Port Forwarding via '%s', service '%s'.  (local address: %s:%d)",
    8888                handle->urls.controlURL, handle->data.servicetype, handle->lanaddr, handle->port );
    89         tr_dbg( "UPNP Port Forwarding Enabled?  %s", (handle->isForwarding?"Yes":"No") );
     89        tr_inf( "UPNP: Port Forwarding Enabled?  %s", (handle->isForwarding?"Yes":"No") );
    9090    }
    9191}
Note: See TracChangeset for help on using the changeset viewer.