~sense/ubuntu/lucid/transmission/fix-497882

« back to all changes in this revision

Viewing changes to libtransmission/session.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2008-11-28 15:33:48 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20081128153348-it70trfnxiroblmc
Tags: 1.40-0ubuntu1
* New upstream release (LP: #302672)
  - Tracker communication uses fewer resources
  - More accurate bandwidth limits
  - Reduce disk fragmentation by preallocating files (LP: #287726)
  - Stability, security and performance improvements to the RPC /
    Web UI server (closes LP: #290423)
  - Support compression when serving Web UI and RPC responses
  - Simplify the RPC whitelist
  - Fix bug that prevented handshakes with encrypted BitComet peers
  - Fix 1.3x bug that could re-download some data unnecessarily
    (LP: #295040)
  - Option to automatically update the blocklist weekly
  - Added off-hour bandwidth scheduling
  - Simplify file/priority selection in the details dialog
  - Fix a couple of crashes
  - New / updated translations
  - Don't inhibit hibernation by default (LP: #292929)
  - Use "close" animation when sending to notification area (LP: #130811)
  - Fix resize problems (LP: #269872)
  - Support "--version" option when launching from command line
    (LP: #292011)
  - Correctly parse announce URLs that have leading or trailing
    spaces (LP: #262411)
  - Display an error when "Open Torrent" fails (LP: #281463)
* Dropped 10_fix_crasher_from_upstream.dpatch: Fix is in this
  upstream release.
* debian/control: Don't just build-depend on libcurl-dev, which is
  a virtual package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: session.h 6329 2008-07-15 01:03:03Z charles $
 
2
 * $Id: session.h 7069 2008-11-08 02:49:04Z charles $
3
3
 *
4
4
 * Copyright (c) 2005-2008 Transmission authors and contributors
5
5
 *
28
28
#define TR_NAME "Transmission"
29
29
 
30
30
#ifndef UNUSED
31
 
#ifdef __GNUC__
32
 
#define UNUSED __attribute__((unused))
33
 
#else
34
 
#define UNUSED
35
 
#endif
36
 
#endif
 
31
 #ifdef __GNUC__
 
32
  #define UNUSED __attribute__ ( ( unused ) )
 
33
 #else
 
34
  #define UNUSED
 
35
 #endif
 
36
#endif
 
37
 
37
38
 
38
39
typedef enum { TR_NET_OK, TR_NET_ERROR, TR_NET_WAIT } tr_tristate_t;
39
40
 
40
 
uint8_t* tr_peerIdNew( void );
 
41
uint8_t*       tr_peerIdNew( void );
41
42
 
42
43
const uint8_t* tr_getPeerId( void );
43
44
 
44
45
struct tr_metainfo_lookup
45
46
{
46
 
    char hashString[2*SHA_DIGEST_LENGTH+1];
47
 
    char * filename;
 
47
    char    hashString[2 * SHA_DIGEST_LENGTH + 1];
 
48
    char *  filename;
48
49
};
49
50
 
 
51
struct tr_ratecontrol;
 
52
 
50
53
struct tr_handle
51
54
{
52
55
    unsigned int                 isPortSet          : 1;
57
60
    unsigned int                 isClosed           : 1;
58
61
    unsigned int                 useUploadLimit     : 1;
59
62
    unsigned int                 useDownloadLimit   : 1;
 
63
    unsigned int                 useLazyBitfield    : 1;
60
64
 
61
65
    tr_encryption_mode           encryptionMode;
62
66
 
63
 
    struct tr_event_handle     * events;
 
67
    struct tr_event_handle *     events;
64
68
 
65
69
    int                          proxyPort;
66
70
    int                          peerSocketTOS;
67
71
 
68
72
    int                          torrentCount;
69
 
    tr_torrent                 * torrentList;
70
 
 
71
 
    char                       * tag;
72
 
 
73
 
    char                       * configDir;
74
 
    char                       * downloadDir;
75
 
    char                       * resumeDir;
76
 
    char                       * torrentDir;
 
73
    tr_torrent *                 torrentList;
 
74
 
 
75
    char *                       tag;
 
76
 
 
77
    char *                       configDir;
 
78
    char *                       downloadDir;
 
79
    char *                       resumeDir;
 
80
    char *                       torrentDir;
77
81
 
78
82
    tr_proxy_type                proxyType;
79
 
    char                       * proxy;
80
 
    char                       * proxyUsername;
81
 
    char                       * proxyPassword;
82
 
 
83
 
    struct tr_ratecontrol      * upload;
84
 
    struct tr_ratecontrol      * download;
85
 
 
86
 
    struct tr_list             * blocklists;
87
 
    struct tr_peerMgr          * peerMgr;
88
 
    struct tr_shared           * shared;
89
 
 
90
 
    struct tr_lock             * lock;
91
 
 
92
 
    struct tr_web              * web;
93
 
 
94
 
    struct tr_rpc_server       * rpcServer;
 
83
    char *                       proxy;
 
84
    char *                       proxyUsername;
 
85
    char *                       proxyPassword;
 
86
 
 
87
    int                          uploadLimit;
 
88
    int                          downloadLimit;
 
89
 
 
90
    struct tr_list *             blocklists;
 
91
    struct tr_peerMgr *          peerMgr;
 
92
    struct tr_shared *           shared;
 
93
 
 
94
    struct tr_lock *             lock;
 
95
 
 
96
    struct tr_web *              web;
 
97
 
 
98
    struct tr_rpc_server *       rpcServer;
95
99
    tr_rpc_func                  rpc_func;
96
 
    void                       * rpc_func_user_data;
97
 
 
98
 
    struct tr_stats_handle     * sessionStats;
99
 
    struct tr_tracker_handle   * tracker;
100
 
 
101
 
    struct tr_metainfo_lookup  * metainfoLookup;
 
100
    void *                       rpc_func_user_data;
 
101
 
 
102
    struct tr_stats_handle *     sessionStats;
 
103
    struct tr_tracker_handle *   tracker;
 
104
 
 
105
    struct tr_metainfo_lookup *  metainfoLookup;
102
106
    int                          metainfoLookupCount;
 
107
 
 
108
    /* the rate at which pieces are being transferred between client and peer.
 
109
     * protocol overhead is NOT included; this is only the piece data */
 
110
    struct tr_ratecontrol     *  pieceSpeed[2];
 
111
 
 
112
    /* the rate at which bytes are being transferred between client and peer. */
 
113
    struct tr_ratecontrol     *  rawSpeed[2];
103
114
};
104
115
 
105
116
const char * tr_sessionFindTorrentFile( const tr_session * session,
106
 
                                        const char       * hashString );
 
117
                                        const char *       hashString );
107
118
 
108
 
void tr_sessionSetTorrentFile( tr_session   * session,
109
 
                               const char   * hashString,
110
 
                               const char   * filename );
 
119
void         tr_sessionSetTorrentFile( tr_session * session,
 
120
                                       const char * hashString,
 
121
                                       const char * filename );
111
122
 
112
123
struct in_addr;
113
124
 
114
 
int tr_sessionIsAddressBlocked( const tr_session     * session,
115
 
                                const struct in_addr * addr );
116
 
 
117
 
 
118
 
void tr_globalLock       ( tr_session * );
119
 
void tr_globalUnlock     ( tr_session * );
120
 
int  tr_globalIsLocked   ( const tr_session * );
121
 
 
122
 
 
123
 
#define TR_ERROR_IS_IO(e) (TR_ERROR_IO_PARENT<=(e) && (e)<=TR_ERROR_IO_OTHER)
124
 
#define TR_ERROR_IS_TC(e) (TR_ERROR_TC_ERROR<=(e) && (e)<=TR_ERROR_TC_WARNING)
125
 
 
 
125
int          tr_sessionIsAddressBlocked( const tr_session *     session,
 
126
                                         const struct in_addr * addr );
 
127
 
 
128
 
 
129
void         tr_globalLock( tr_session * );
 
130
 
 
131
void         tr_globalUnlock( tr_session * );
 
132
 
 
133
int          tr_globalIsLocked( const tr_session * );
126
134
 
127
135
#endif