Last change
on this file since 7125 was
7125,
checked in by charles, 12 years ago
|
(libT) better possible fix for #1468: Speed display is very jumpy
|
-
Property svn:keywords set to
Date Rev Author Id
|
File size:
1.4 KB
|
Line | |
---|
1 | /* |
---|
2 | * This file Copyright (C) 2008 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-common.h 7125 2008-11-17 04:00:57Z charles $ |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef TR_PEER_H |
---|
14 | #define TR_PEER_H |
---|
15 | |
---|
16 | /** |
---|
17 | *** Fields common to webseed and bittorrent peers |
---|
18 | **/ |
---|
19 | |
---|
20 | #include "transmission.h" |
---|
21 | #include "publish.h" |
---|
22 | |
---|
23 | typedef enum |
---|
24 | { |
---|
25 | TR_ADDREQ_OK = 0, |
---|
26 | TR_ADDREQ_FULL, |
---|
27 | TR_ADDREQ_DUPLICATE, |
---|
28 | TR_ADDREQ_MISSING, |
---|
29 | TR_ADDREQ_CLIENT_CHOKED |
---|
30 | } |
---|
31 | tr_addreq_t; |
---|
32 | |
---|
33 | /** |
---|
34 | *** Peer Publish / Subscribe |
---|
35 | **/ |
---|
36 | |
---|
37 | typedef enum |
---|
38 | { |
---|
39 | TR_PEER_CLIENT_GOT_BLOCK, |
---|
40 | TR_PEER_CLIENT_GOT_DATA, |
---|
41 | TR_PEER_PEER_GOT_DATA, |
---|
42 | TR_PEER_PEER_PROGRESS, |
---|
43 | TR_PEER_ERROR, |
---|
44 | TR_PEER_CANCEL, |
---|
45 | TR_PEER_NEED_REQ |
---|
46 | } |
---|
47 | PeerEventType; |
---|
48 | |
---|
49 | typedef struct |
---|
50 | { |
---|
51 | PeerEventType eventType; |
---|
52 | uint32_t pieceIndex; /* for GOT_BLOCK, CANCEL */ |
---|
53 | uint32_t offset; /* for GOT_BLOCK */ |
---|
54 | uint32_t length; /* for GOT_BLOCK + GOT_DATA */ |
---|
55 | float progress; /* for PEER_PROGRESS */ |
---|
56 | int err; /* errno for GOT_ERROR */ |
---|
57 | int wasPieceData; /* for GOT_DATA */ |
---|
58 | } |
---|
59 | tr_peer_event; |
---|
60 | |
---|
61 | #ifdef WIN32 |
---|
62 | #define EMSGSIZE WSAEMSGSIZE |
---|
63 | #endif |
---|
64 | |
---|
65 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.