1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

bittorrent: Overflow occuring when a piece was rejected.

This commit is contained in:
Witold Filipczyk 2008-03-25 22:37:13 +01:00 committed by Witold Filipczyk
parent 003d09ed78
commit 23ff9ac7a9

View File

@ -950,7 +950,7 @@ add_to_bittorrent_piece_cache(struct bittorrent_peer_connection *peer,
cache->rejected_pieces++; cache->rejected_pieces++;
mem_mmap_free(entry->data, piece_length); mem_mmap_free(entry->data, piece_length);
entry->data = NULL; entry->data = NULL;
update_bittorrent_connection_stats(bittorrent, (off_t) -piece_length, 0, 0); update_bittorrent_connection_stats(bittorrent, -(off_t)piece_length, 0, 0);
set_bittorrent_piece_cache_remaining(cache, piece, 1); set_bittorrent_piece_cache_remaining(cache, piece, 1);
if (bittorrent->mode == BITTORRENT_MODE_END_GAME) if (bittorrent->mode == BITTORRENT_MODE_END_GAME)
bittorrent->mode = BITTORRENT_MODE_NORMAL; bittorrent->mode = BITTORRENT_MODE_NORMAL;