Changeset 9173


Ignore:
Timestamp:
Sep 26, 2009, 3:36:58 AM (13 years ago)
Author:
charles
Message:

(trunk) copy-by-value changes to tr_tracker_stat

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/rpc-spec.txt

    r9170 r9173  
    255255   trackerStats       | array of objects, each containing:   |
    256256                      +-------------------------+------------+
     257                      | announce                | string     | tr_tracker_stat
    257258                      | downloadCount           | number     | tr_tracker_stat
    258259                      | hasAnnounced            | boolean    | tr_tracker_stat
  • trunk/libtransmission/announcer.c

    r9170 r9173  
    16441644            tr_tracker_stat * st = ret + out++;
    16451645
    1646             st->host = tr_strdup( tracker->host->name );
     1646            tr_strlcpy( st->host, tracker->host->name, sizeof( st->host ) );
     1647            tr_strlcpy( st->announce, tracker->announce, sizeof( st->announce ) );
    16471648            st->tier = i + 1;
    16481649            st->isActive = tracker == tier->currentTracker;
     
    16801681void
    16811682tr_announcerStatsFree( tr_tracker_stat * trackers,
    1682                        int               trackerCount )
    1683 {
    1684     int i;
    1685     for( i=0; i<trackerCount; ++i )
    1686         tr_free( trackers[i].host );
     1683                       int trackerCount UNUSED )
     1684{
    16871685    tr_free( trackers );
    16881686}
  • trunk/libtransmission/rpcimpl.c

    r9170 r9173  
    375375    {
    376376        const tr_tracker_stat * s = &st[i];
    377         tr_benc * d = tr_bencListAddDict( list, 23 );
     377        tr_benc * d = tr_bencListAddDict( list, 24 );
     378        tr_bencDictAddStr ( d, "announce", s->announce );
    378379        tr_bencDictAddInt ( d, "downloadCount", s->downloadCount );
    379380        tr_bencDictAddBool( d, "hasAnnounced", s->hasAnnounced );
     
    654655        addInfo( torrents[i], tr_bencListAdd( list ), fields );
    655656
    656 fprintf( stderr, "%s\n", tr_bencToStr( args_out, TR_FMT_JSON, NULL ) );
    657 
    658657    tr_free( torrents );
    659658    return msg;
  • trunk/libtransmission/transmission.h

    r9172 r9173  
    12431243
    12441244    /* ex: legaltorrents.com */
    1245     char * host;
     1245    char host[1024];
     1246
     1247    /* the full announce URL */
     1248    char announce[1024];
    12461249
    12471250    /* true if we're trying to use this tracker.
Note: See TracChangeset for help on using the changeset viewer.