Changeset 61


Ignore:
Timestamp:
Jan 30, 2006, 2:13:40 AM (15 years ago)
Author:
titer
Message:

Removed now unused tables and some now unused code

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/internal.h

    r60 r61  
    147147    tr_peer_t       * peers[TR_MAX_PEER_COUNT];
    148148
    149     uint64_t          dates[10];
    150     uint64_t          downloaded[10];
    151     uint64_t          uploaded[10];
     149    uint64_t          date;
     150    uint64_t          downloaded;
     151    uint64_t          uploaded;
    152152};
    153153
  • trunk/libtransmission/peer.c

    r60 r61  
    245245            tr_rcTransferred( tor->download, ret );
    246246            tr_rcTransferred( tor->globalDownload, ret );
    247             if( parseBuf( tor, peer, ret ) )
     247            if( parseBuf( tor, peer ) )
    248248            {
    249249                return 1;
     
    283283    tr_peer_t * peer;
    284284
    285     tor->dates[9] = tr_date();
    286     if( tor->dates[9] > tor->dates[8] + 1000 )
    287     {
    288         memmove( &tor->downloaded[0], &tor->downloaded[1],
    289                  9 * sizeof( uint64_t ) );
    290         memmove( &tor->uploaded[0], &tor->uploaded[1],
    291                  9 * sizeof( uint64_t ) );
    292         memmove( &tor->dates[0], &tor->dates[1],
    293                  9 * sizeof( uint64_t ) );
     285    if( tr_date() > tor->date + 1000 )
     286    {
     287        tor->date = tr_date();
    294288
    295289        for( i = 0; i < tor->peerCount; )
     
    380374            tr_rcTransferred( tor->globalUpload, ret );
    381375
    382             tor->uploaded[9] += ret;
    383             peer->outTotal   += ret;
    384             peer->outDate     = tr_date();
     376            tor->uploaded  += ret;
     377            peer->outTotal += ret;
     378            peer->outDate   = tr_date();
    385379
    386380            /* In case this block is done, you may have messages
  • trunk/libtransmission/peerparse.h

    r30 r61  
    269269    }
    270270
     271    tor->downloaded += r->length;
     272
    271273    block = tr_block( r->index, r->begin );
    272274    if( tr_cpBlockIsComplete( tor->completion, block ) )
     
    439441}
    440442
    441 static inline int parseBuf( tr_torrent_t * tor, tr_peer_t * peer,
    442                             int newBytes )
     443static inline int parseBuf( tr_torrent_t * tor, tr_peer_t * peer )
    443444{
    444445    tr_info_t * inf = &tor->info;
     
    524525        }
    525526
    526         /* That's a piece coming */
    527         if( p < end && *p == 7 )
    528         {
    529             /* XXX */
    530             tor->downloaded[9] += newBytes;
    531             peer->inTotal      += newBytes;
    532             newBytes            = 0;
    533         }
    534 
    535527        if( &p[len] > end )
    536528        {
  • trunk/libtransmission/tracker.c

    r52 r61  
    283283            "Connection: close\r\n\r\n",
    284284            inf->trackerAnnounce, tor->hashString, tc->id,
    285             tc->bindPort, tor->uploaded[9], tor->downloaded[9],
     285            tc->bindPort, tor->uploaded, tor->downloaded,
    286286            left, tor->key, event, inf->trackerAddress,
    287287            VERSION_MAJOR, VERSION_MINOR );
  • trunk/libtransmission/transmission.c

    r60 r61  
    279279{
    280280    tr_torrent_t * tor = h->torrents[t];
    281     uint64_t       now;
    282     int            i;
    283281
    284282    if( tor->status & ( TR_STATUS_STOPPING | TR_STATUS_STOPPED ) )
     
    291289    tor->tracker  = tr_trackerInit( h, tor );
    292290
    293     now = tr_date();
    294     for( i = 0; i < 10; i++ )
    295     {
    296         tor->dates[i] = now;
    297     }
    298 
     291    tor->date = tr_date();
    299292    tor->die = 0;
    300293    tr_threadCreate( &tor->thread, downloadLoop, tor );
     
    332325    }
    333326
    334     memset( tor->downloaded, 0, sizeof( tor->downloaded ) );
    335     memset( tor->uploaded,   0, sizeof( tor->uploaded ) );
     327    tor->downloaded = 0;
     328    tor->uploaded   = 0;
    336329}
    337330
     
    452445        }
    453446
    454         s[i].downloaded = tor->downloaded[9];
    455         s[i].uploaded   = tor->uploaded[9];
     447        s[i].downloaded = tor->downloaded;
     448        s[i].uploaded   = tor->uploaded;
    456449
    457450        s[i].folder = tor->destination;
Note: See TracChangeset for help on using the changeset viewer.