ELinks 0.18.0
bittorrent_piece_cache_entry Struct Reference

#include <piececache.h>

Collaboration diagram for bittorrent_piece_cache_entry:

Public Member Functions

 LIST_HEAD_EL (struct bittorrent_piece_cache_entry)

Data Fields

uint16_t rarity
 Piece rarity index To keep track of the client's view of the swarm in regards to pieces a piece rarity index for neighboring peers is maintained for each piece in the torrent.
unsigned int completed:1
 All blocks was downloaded.
unsigned int remaining:1
 Nothing has been even requested.
unsigned int locked:1
 Edge piece from partial downloads.
unsigned int selected:1
 Piece is part of partial download.
struct bitfieldblocks
 A bitfield of the blocks which remains to be downloaded for this piece.
char * data
 The data of the piece.

Member Function Documentation

◆ LIST_HEAD_EL()

bittorrent_piece_cache_entry::LIST_HEAD_EL ( struct bittorrent_piece_cache_entry )

Field Documentation

◆ blocks

struct bitfield* bittorrent_piece_cache_entry::blocks

A bitfield of the blocks which remains to be downloaded for this piece.

May be NULL if downloading is not in progress.

◆ completed

unsigned int bittorrent_piece_cache_entry::completed

All blocks was downloaded.

◆ data

char* bittorrent_piece_cache_entry::data

The data of the piece.

May be NULL if data has not been downloaded or the piece has been written to disk. XXX: This memory is mmaped using the mem_mmap_*() functions.

◆ locked

unsigned int bittorrent_piece_cache_entry::locked

Edge piece from partial downloads.

◆ rarity

uint16_t bittorrent_piece_cache_entry::rarity

Piece rarity index To keep track of the client's view of the swarm in regards to pieces a piece rarity index for neighboring peers is maintained for each piece in the torrent.

It keeps track of how many neighboring peers have the piece. The smaller the value the more rare the piece is. The table is updated when the client receives bitfield or have messages. Zero indicates that no neightboring peer has the piece.

◆ remaining

unsigned int bittorrent_piece_cache_entry::remaining

Nothing has been even requested.

◆ selected

unsigned int bittorrent_piece_cache_entry::selected

Piece is part of partial download.


The documentation for this struct was generated from the following file: