source: trunk/libtransmission/peer-mgr-private.h @ 3295

Last change on this file since 3295 was 3295, checked in by charles, 15 years ago
  • add a per-peer request queue to hold the next 10-15 seconds' worth of requests so that we always have more requests at hand when the current requests start to run low.
  • increase the tracker `numwant' variable to grow our peer pool
  • bugfixes in cancelling requests.
  • make the debug log sexy and readable like uTorrent's ;)
  • Property svn:keywords set to Date Rev Author Id
File size: 1.5 KB
Line 
1/*
2 * This file Copyright (C) 2007 Charles Kerr <charles@rebelbase.com>
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: peer-mgr-private.h 3295 2007-10-06 18:20:52Z charles $
11 */
12
13#ifndef TR_PEER_MGR_PRIVATE_H
14#define TR_PEER_MGR_PRIVATE_H
15
16#include <inttypes.h> /* uint16_t */
17#include <arpa/inet.h> /* struct in_addr */
18#include "publish.h" /* tr_publisher_tag */
19
20struct tr_bitfield;
21struct tr_peerIo;
22struct tr_peermsgs;
23
24enum
25{
26    ENCRYPTION_PREFERENCE_UNKNOWN,
27    ENCRYPTION_PREFERENCE_YES,
28    ENCRYPTION_PREFERENCE_NO
29};
30
31typedef struct tr_peer
32{
33    unsigned int  peerIsChoked : 1;
34    unsigned int  peerIsInterested : 1;
35    unsigned int  clientIsChoked : 1;
36    unsigned int  clientIsInterested : 1;
37    unsigned int  doPurge : 1;
38
39    uint8_t encryption_preference;
40    uint16_t port;
41    struct in_addr in_addr;
42    struct tr_peerIo * io;
43
44    struct tr_bitfield * banned;
45    struct tr_bitfield * blame;
46    struct tr_bitfield * have;
47    float progress;
48
49    /* the client name from the `v' string in LTEP's handshake dictionary */
50    char * client;
51
52    time_t peerSentPieceDataAt;
53    time_t chokeChangedAt;
54    time_t pieceDataActivityDate;
55
56    struct tr_peermsgs * msgs;
57    tr_publisher_tag msgsTag;
58
59    struct tr_ratecontrol * rcToClient;
60    struct tr_ratecontrol * rcToPeer;
61
62    double rateToClient;
63    double rateToPeer;
64}
65tr_peer;
66
67#endif
Note: See TracBrowser for help on using the repository browser.