Ignore:
Timestamp:
Jun 27, 2007, 5:14:38 AM (15 years ago)
Author:
charles
Message:

add tr_torrentCanAdd() as per BentMyWookie?'s request... clear tracker error string when restarting... fix r2202 "completed" announce bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r2184 r2206  
    6464    else if( S_ISREG( sb.st_mode ) )
    6565    {
    66         struct FileList * node = tr_malloc( sizeof( struct FileList ) );
     66        struct FileList * node = tr_new( struct FileList, 1 );
    6767        node->size = sb.st_size;
    6868        node->filename = tr_strdup( buf );
     
    118118    struct FileList * files;
    119119    struct FileList * walk;
    120     tr_metainfo_builder_t * ret = tr_calloc( 1, sizeof(tr_metainfo_builder_t) );
     120    tr_metainfo_builder_t * ret = tr_new0( tr_metainfo_builder_t, 1 );
    121121    ret->top = tr_strdup( topFile );
    122122    ret->handle = handle;
     
    143143        ++ret->fileCount;
    144144
    145     ret->files = tr_calloc(ret->fileCount, sizeof(tr_metainfo_builder_file_t));
     145    ret->files = tr_new0( tr_metainfo_builder_file_t, ret->fileCount );
    146146
    147147    for( i=0, walk=files; walk!=NULL; ++i )
     
    194194{
    195195    int fileIndex = 0;
    196     uint8_t *ret = (uint8_t*) tr_malloc ( SHA_DIGEST_LENGTH * b->pieceCount );
     196    uint8_t *ret = tr_new( uint8_t, SHA_DIGEST_LENGTH * b->pieceCount );
    197197    uint8_t *walk = ret;
    198     uint8_t *buf = tr_malloc( b->pieceSize );
     198    uint8_t *buf = tr_new( uint8_t, b->pieceSize );
    199199    uint64_t totalRemain;
    200200    uint64_t off = 0;
     
    423423    if( lock == NULL )
    424424    {
    425         lock = tr_calloc( 1, sizeof( tr_lock_t ) );
     425        lock = tr_new0( tr_lock_t, 1 );
    426426        tr_lockInit( lock );
    427427    }
Note: See TracChangeset for help on using the changeset viewer.