~ubuntu-branches/ubuntu/natty/transmission/natty

« back to all changes in this revision

Viewing changes to libtransmission/transmission.h

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-12-08 10:49:11 UTC
  • mfrom: (1.1.29 upstream) (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20091208104911-06gio45n2nla3vpg
Tags: 1.80~b1-0ubuntu1
* New upstream release (LP: #460620), rebased on debian unstable
  remaining changes:
  - debian/control:
    + Added replaces & provides clutch (now included as part of transmission).
      Can be removed in lucid+1
    + Added quilt, liblaunchpad-integration-dev and lsb-release to Build-Depends
  - debian/rules:
    + create a po template during package build.
  - debian/patches/01_lpi.patch:
    + integrate transmission with launchpad
  - debian/patches/20_add_x-ubuntu-gettext-domain.diff:
    + add x-ubuntu-gettext-domain to .desktop file.
  - debian/transmission-daemon.default:
    - remove --auth from OPTIONS
* Fixes bugs:
  - tray menu shows wrong status for "main window" when started minimized
    (LP: #451415)
* Refreshed patches:
  - dont_build_libevent.patch
  - 99_autoreconf.patch
* Removed patches:
  - 21_onPortTested.diff, 23_tr_torrentNext.diff and
    24_tr_torrentDeleteLocalData_do_move.diff
* debian/patches/21_fix_inhibition.patch:
  - The right value for suspend inhibition is 4
* debian/control:
  - Build-Depend on libgconf2-dev to enable magnet link registration and on
    libcanberra-gtk-dev for notification sound.
* debian/watch:
  - make it detect beta versions, to be removed after 1.80 is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: transmission.h 8929 2009-08-14 12:53:08Z charles $
 
2
 * $Id: transmission.h 9644 2009-12-01 00:07:18Z charles $
3
3
 *
4
4
 * Copyright (c) 2005-2008 Transmission authors and contributors
5
5
 *
168
168
#define TR_PREFS_KEY_DHT_ENABLED                "dht-enabled"
169
169
#define TR_PREFS_KEY_DOWNLOAD_DIR               "download-dir"
170
170
#define TR_PREFS_KEY_ENCRYPTION                 "encryption"
 
171
#define TR_PREFS_KEY_INCOMPLETE_DIR             "incomplete-dir"
 
172
#define TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED     "incomplete-dir-enabled"
171
173
#define TR_PREFS_KEY_LAZY_BITFIELD              "lazy-bitfield-enabled"
172
174
#define TR_PREFS_KEY_MSGLEVEL                   "message-level"
173
175
#define TR_PREFS_KEY_OPEN_FILE_LIMIT            "open-file-limit"
190
192
#define TR_PREFS_KEY_PROXY_USERNAME             "proxy-auth-username"
191
193
#define TR_PREFS_KEY_RATIO                      "ratio-limit"
192
194
#define TR_PREFS_KEY_RATIO_ENABLED              "ratio-limit-enabled"
 
195
#define TR_PREFS_KEY_RENAME_PARTIAL_FILES       "rename-partial-files"
193
196
#define TR_PREFS_KEY_RPC_AUTH_REQUIRED          "rpc-authentication-required"
194
197
#define TR_PREFS_KEY_RPC_BIND_ADDRESS           "rpc-bind-address"
195
198
#define TR_PREFS_KEY_RPC_ENABLED                "rpc-enabled"
226
229
 * @see tr_sessionInit()
227
230
 * @see tr_getDefaultConfigDir()
228
231
 */
229
 
void tr_sessionGetDefaultSettings( struct tr_benc * dictionary );
 
232
void tr_sessionGetDefaultSettings( const char * configDir, struct tr_benc * dictionary );
230
233
 
231
234
/**
232
235
 * Add the session's current configuration settings to the benc dictionary.
300
303
                             tr_bool          messageQueueingEnabled,
301
304
                             struct tr_benc * settings );
302
305
 
 
306
void tr_sessionSet( tr_session      * session,
 
307
                    struct tr_benc  * settings );
 
308
 
 
309
void tr_sessionReloadBlocklists( tr_session * session );
 
310
 
 
311
 
303
312
/** @brief End a libtransmission session
304
313
    @see tr_sessionInit() */
305
314
void tr_sessionClose( tr_session * );
330
339
const char * tr_sessionGetDownloadDir( const tr_session * session );
331
340
 
332
341
/**
 
342
 * @brief Set the per-session incomplete download folder.
 
343
 *
 
344
 * When you add a new torrent and the session's incomplete directory is enabled,
 
345
 * the new torrent will start downloading into that directory, and then be moved
 
346
 * to tr_torrent.downloadDir when the torrent is finished downloading.
 
347
 *
 
348
 * Torrents are not moved as a result of changing the session's incomplete dir --
 
349
 * it's applied to new torrents, not existing ones.
 
350
 *
 
351
 * tr_torrentSetLocation() overrules the incomplete dir: when a user specifies
 
352
 * a new location, that becomes the torrent's new downloadDir and the torrent
 
353
 * is moved there immediately regardless of whether or not it's complete.
 
354
 *
 
355
 * @see tr_sessionInit()
 
356
 * @see tr_sessionGetIncompleteDir()
 
357
 * @see tr_sessionSetIncompleteDirEnabled()
 
358
 * @see tr_sessionGetIncompleteDirEnabled()
 
359
 */
 
360
void tr_sessionSetIncompleteDir( tr_session * session, const char * dir );
 
361
 
 
362
const char* tr_sessionGetIncompleteDir( const tr_session * session );
 
363
 
 
364
void tr_sessionSetIncompleteDirEnabled( tr_session * session, tr_bool );
 
365
 
 
366
tr_bool tr_sessionIsIncompleteDirEnabled( const tr_session * session );
 
367
 
 
368
 
 
369
/**
 
370
 * @brief When enabled, newly-created files will have ".part" appended
 
371
 *        to their filename until the file is fully downloaded
 
372
 *
 
373
 * This is not retroactive -- toggling this will not rename existing files.
 
374
 * It only applies to new files created by Transmission after this API call.
 
375
 *
 
376
 * @see tr_sessionIsIncompleteFileNamingEnabled()
 
377
 */
 
378
void tr_sessionSetIncompleteFileNamingEnabled( tr_session * session, tr_bool );
 
379
 
 
380
tr_bool tr_sessionIsIncompleteFileNamingEnabled( const tr_session * session );
 
381
 
 
382
/**
333
383
 * @brief Set whether or not RPC calls are allowed in this session.
334
384
 *
335
385
 * @details If true, libtransmission will open a server socket to listen
408
458
    TR_RPC_TORRENT_STOPPED,
409
459
    TR_RPC_TORRENT_REMOVING,
410
460
    TR_RPC_TORRENT_CHANGED, /* catch-all for the "torrent-set" rpc method */
 
461
    TR_RPC_TORRENT_MOVED,
411
462
    TR_RPC_SESSION_CHANGED
412
463
}
413
464
tr_rpc_callback_type;
810
861
void        tr_ctorSetDeleteSource( tr_ctor * ctor,
811
862
                                    tr_bool   doDelete );
812
863
 
 
864
int         tr_ctorSetMagnet( tr_ctor * ctor,
 
865
                              const char * url );
 
866
 
813
867
int         tr_ctorSetMetainfo( tr_ctor *       ctor,
814
868
                                const uint8_t * metainfo,
815
869
                                size_t          len );
833
887
                                   tr_ctorMode  mode,
834
888
                                   const char * directory );
835
889
 
 
890
/**
 
891
 * @brief Set the incompleteDir for this torrent.
 
892
 *
 
893
 * This is not a supported API call.
 
894
 * It only exists so the mac client can migrate
 
895
 * its older incompleteDir settings, and that's
 
896
 * the only place where it should be used.
 
897
 */
 
898
void tr_ctorSetIncompleteDir( tr_ctor * ctor, const char * directory );
 
899
 
836
900
/** Set whether or not the torrent begins downloading/seeding when created.
837
901
    (Default: not paused) */
838
902
void        tr_ctorSetPaused( tr_ctor      * ctor,
862
926
                                   tr_ctorMode      mode,
863
927
                                   const char    ** setmeDownloadDir );
864
928
 
 
929
int         tr_ctorGetIncompleteDir( const tr_ctor  * ctor,
 
930
                                     const char    ** setmeIncompleteDir );
 
931
 
865
932
int         tr_ctorGetMetainfo( const tr_ctor         * ctor,
866
933
                                const struct tr_benc ** setme );
867
934
 
978
1045
 
979
1046
tr_torrent* tr_torrentFindFromId( tr_session * session, int id );
980
1047
 
 
1048
tr_torrent* tr_torrentFindFromHash( tr_session * session, const uint8_t * hash );
 
1049
 
 
1050
 
 
1051
 
 
1052
/**
 
1053
 * @brief find the location of a torrent's file by looking with and without
 
1054
 *        the ".part" suffix, looking in downloadDir and incompleteDir, etc.
 
1055
 * @return a newly-allocated string (that must be tr_freed() by the caller when done)
 
1056
 *         that gives the location of this file on disk, or NULL if no file exists yet.
 
1057
 * @param tor the torrent whose file we're looking for
 
1058
 * @param fileNum the fileIndex, in [0...tr_info.fileCount)
 
1059
 */
 
1060
char* tr_torrentFindFile( const tr_torrent * tor, tr_file_index_t fileNo );
 
1061
 
981
1062
 
982
1063
/***
983
1064
****  Torrent speed limits
1073
1154
                         tr_file_index_t     file );
1074
1155
 
1075
1156
/** @brief Set a batch of files to be downloaded or not. */
1076
 
void            tr_torrentSetFileDLs( tr_torrent       * torrent,
1077
 
                                      tr_file_index_t  * files,
1078
 
                                      tr_file_index_t    fileCount,
1079
 
                                      tr_bool            do_download );
 
1157
void tr_torrentSetFileDLs( tr_torrent       * torrent,
 
1158
                           tr_file_index_t  * files,
 
1159
                           tr_file_index_t    fileCount,
 
1160
                           tr_bool            do_download );
1080
1161
 
1081
1162
 
1082
1163
const tr_info * tr_torrentInfo( const tr_torrent * torrent );
1089
1170
const char * tr_torrentGetDownloadDir( const tr_torrent * torrent );
1090
1171
 
1091
1172
/**
 
1173
 * Returns the root directory of where the torrent is.
 
1174
 *
 
1175
 * This will usually be the downloadDir.  However if the torrent
 
1176
 * has an incompleteDir enabled and hasn't finished downloading
 
1177
 * yet, that will be returned instead.
 
1178
 */
 
1179
const char * tr_torrentGetCurrentDir( const tr_torrent * tor );
 
1180
 
 
1181
 
 
1182
/**
 
1183
 * Returns a newly-allocated string with a magnet link of the torrent.
 
1184
 * Use tr_free() to free the string when done.
 
1185
 */
 
1186
char* tr_torrentGetMagnetLink( const tr_torrent * tor );
 
1187
 
 
1188
/**
1092
1189
***
1093
1190
**/
1094
1191
 
1101
1198
}
1102
1199
tr_tracker_info;
1103
1200
 
 
1201
 
 
1202
typedef enum
 
1203
{
 
1204
  TR_ANNOUNCE_LIST_OK,
 
1205
  TR_ANNOUNCE_LIST_HAS_DUPLICATES,
 
1206
  TR_ANNOUNCE_LIST_HAS_BAD
 
1207
}
 
1208
tr_announce_list_err;
 
1209
 
1104
1210
/**
1105
1211
 * @brief Modify a torrent's tracker list.
1106
1212
 *
1113
1219
 *                 libtransmission derives `scrape' from `announce'.
1114
1220
 * @param trackerCount size of the `trackers' array
1115
1221
 */
1116
 
void tr_torrentSetAnnounceList( tr_torrent *            torrent,
1117
 
                                const tr_tracker_info * trackers,
1118
 
                                int                     trackerCount );
 
1222
tr_announce_list_err
 
1223
tr_torrentSetAnnounceList( tr_torrent             * torrent,
 
1224
                           const tr_tracker_info  * trackers,
 
1225
                           int                      trackerCount );
1119
1226
 
1120
1227
 
1121
1228
/**
1158
1265
void tr_torrentClearCompletenessCallback( tr_torrent * torrent );
1159
1266
 
1160
1267
 
 
1268
 
 
1269
typedef void ( tr_torrent_metadata_func )( tr_torrent  * torrent,
 
1270
                                           void        * user_data );
 
1271
/**
 
1272
 * Register to be notified whenever a torrent changes from
 
1273
 * having incomplete metadata to having complete metadata.
 
1274
 * This happens when a magnet link finishes downloading
 
1275
 * metadata from its peers.
 
1276
 */
 
1277
void tr_torrentSetMetadataCallback (
 
1278
         tr_torrent                * tor,
 
1279
         tr_torrent_metadata_func     func,
 
1280
         void                      * user_data );
 
1281
 
1161
1282
/**
1162
1283
 * Register to be notified whenever a torrent's ratio limit
1163
1284
 * has been hit. This will be called when the torrent's
1190
1311
 
1191
1312
tr_bool tr_torrentCanManualUpdate( const tr_torrent * torrent );
1192
1313
 
1193
 
/***********************************************************************
1194
 
* tr_torrentPeers
1195
 
***********************************************************************/
 
1314
/***
 
1315
****  tr_peer_stat
 
1316
***/
1196
1317
 
1197
1318
typedef struct tr_peer_stat
1198
1319
{
1226
1347
void           tr_torrentPeersFree( tr_peer_stat * peerStats,
1227
1348
                                    int            peerCount );
1228
1349
 
 
1350
/***
 
1351
****  tr_tracker_stat
 
1352
***/
 
1353
 
 
1354
typedef enum
 
1355
{
 
1356
    /* we won't (announce,scrape) this torrent to this tracker because
 
1357
     * the torrent is stopped, or because of an error, or whatever */
 
1358
    TR_TRACKER_INACTIVE,
 
1359
 
 
1360
    /* we will (announce,scrape) this torrent to this tracker, and are
 
1361
     * waiting for enough time to pass to satisfy the tracker's interval */
 
1362
    TR_TRACKER_WAITING,
 
1363
 
 
1364
    /* it's time to (announce,scrape) this torrent, and we're waiting on a
 
1365
     * a free slot to open up in the announce manager */
 
1366
    TR_TRACKER_QUEUED,
 
1367
 
 
1368
    /* we're (announcing,scraping) this torrent right now */
 
1369
    TR_TRACKER_ACTIVE
 
1370
}
 
1371
tr_tracker_state;
 
1372
 
 
1373
typedef struct
 
1374
{
 
1375
    /* how many downloads this tracker knows of (-1 means it does not know) */
 
1376
    int downloadCount;
 
1377
 
 
1378
    /* whether or not we've ever sent this tracker an announcement */
 
1379
    tr_bool hasAnnounced;
 
1380
 
 
1381
    /* whether or not we've ever scraped to this tracker */
 
1382
    tr_bool hasScraped;
 
1383
 
 
1384
    /* ex: http://www.legaltorrents.com:7070 */
 
1385
    char host[1024];
 
1386
 
 
1387
    /* the full announce URL */
 
1388
    char announce[1024];
 
1389
 
 
1390
    /* Transmission uses one tracker per tier,
 
1391
     * and the others are kept as backups */
 
1392
    tr_bool isBackup;
 
1393
 
 
1394
    /* is the tracker announcing, waiting, queued, etc */
 
1395
    tr_tracker_state announceState;
 
1396
 
 
1397
    /* is the tracker scraping, waiting, queued, etc */
 
1398
    tr_tracker_state scrapeState;
 
1399
 
 
1400
    /* number of peers the tracker told us about last time.
 
1401
     * if "lastAnnounceSucceeded" is false, this field is undefined */
 
1402
    int lastAnnouncePeerCount;
 
1403
 
 
1404
    /* human-readable string with the result of the last announce.
 
1405
       if "hasAnnounced" is false, this field is undefined */ 
 
1406
    char lastAnnounceResult[128];
 
1407
 
 
1408
    /* when the last announce was sent to the tracker.
 
1409
     * if "hasAnnounced" is false, this field is undefined */
 
1410
    time_t lastAnnounceStartTime;
 
1411
   
 
1412
    /* whether or not the last announce was a success.
 
1413
       if "hasAnnounced" is false, this field is undefined */ 
 
1414
    tr_bool lastAnnounceSucceeded;
 
1415
 
 
1416
    /* when the last announce was completed.
 
1417
       if "hasAnnounced" is false, this field is undefined */
 
1418
    time_t lastAnnounceTime;
 
1419
 
 
1420
    /* human-readable string with the result of the last scrape.
 
1421
     * if "hasScraped" is false, this field is undefined */
 
1422
    char lastScrapeResult[128];
 
1423
 
 
1424
    /* when the last scrape was sent to the tracker.
 
1425
     * if "hasScraped" is false, this field is undefined */
 
1426
    time_t lastScrapeStartTime;
 
1427
 
 
1428
    /* whether or not the last scrape was a success.
 
1429
       if "hasAnnounced" is false, this field is undefined */ 
 
1430
    tr_bool lastScrapeSucceeded;
 
1431
 
 
1432
    /* when the last scrape was completed.
 
1433
       if "hasScraped" is false, this field is undefined */
 
1434
    time_t lastScrapeTime;
 
1435
 
 
1436
    /* number of leechers this tracker knows of (-1 means it does not know) */
 
1437
    int leecherCount;
 
1438
 
 
1439
    /* when the next periodic announce message will be sent out.
 
1440
       if announceState isn't TR_TRACKER_WAITING, this field is undefined */
 
1441
    time_t nextAnnounceTime;
 
1442
 
 
1443
    /* when the next periodic scrape message will be sent out.
 
1444
       if scrapeState isn't TR_TRACKER_WAITING, this field is undefined */
 
1445
    time_t nextScrapeTime;
 
1446
 
 
1447
    /* number of seeders this tracker knows of (-1 means it does not know) */
 
1448
    int seederCount;
 
1449
 
 
1450
    /* which tier this tracker is in */
 
1451
    int tier;
 
1452
}
 
1453
tr_tracker_stat;
 
1454
 
 
1455
tr_tracker_stat * tr_torrentTrackers( const tr_torrent * torrent,
 
1456
                                      int              * setmeTrackerCount );
 
1457
 
 
1458
void tr_torrentTrackersFree( tr_tracker_stat * trackerStats,
 
1459
                             int               trackerCount );
 
1460
 
 
1461
 
 
1462
    
 
1463
 
1229
1464
/**
1230
1465
 * @brief get the download speeds for each of this torrent's webseed sources.
1231
1466
 *
1333
1568
    uint8_t            hash[SHA_DIGEST_LENGTH];
1334
1569
    char               hashString[2 * SHA_DIGEST_LENGTH + 1];
1335
1570
 
 
1571
    /* hash, escaped as per rfc2396 for tracker announces */
 
1572
    char               hashEscaped[3 * SHA_DIGEST_LENGTH + 1];
 
1573
 
1336
1574
    /* Flags */
1337
1575
    tr_bool            isPrivate;
1338
1576
    tr_bool            isMultifile;
1339
1577
};
1340
1578
 
 
1579
static TR_INLINE tr_bool tr_torrentHasMetadata( const tr_torrent * tor )
 
1580
{
 
1581
    return tr_torrentInfo( tor )->fileCount > 0;
 
1582
}
 
1583
 
1341
1584
/**
1342
1585
 * What the torrent is doing right now.
1343
1586
 *
1361
1604
    TR_PEER_FROM_INCOMING  = 0,  /* connections made to the listening port */
1362
1605
    TR_PEER_FROM_TRACKER   = 1,  /* peers received from a tracker */
1363
1606
    TR_PEER_FROM_DHT       = 2,  /* peers learnt from the DHT */
1364
 
    TR_PEER_FROM_CACHE     = 3,  /* peers read from the peer cache */
 
1607
    TR_PEER_FROM_RESUME    = 3,  /* peers read from the .resume file */
1365
1608
    TR_PEER_FROM_PEX       = 4,  /* peers discovered via PEX */
 
1609
    TR_PEER_FROM_LTEP      = 5,  /* peer address provided in an LTEP handshake */
1366
1610
    TR_PEER_FROM__MAX
1367
1611
};
1368
1612
 
1369
1613
typedef enum
1370
1614
{
 
1615
    /* everything's fine */
1371
1616
    TR_STAT_OK               = 0,
 
1617
 
 
1618
    /* when we anounced to the tracker, we got a warning in the response */
1372
1619
    TR_STAT_TRACKER_WARNING  = 1,
 
1620
 
 
1621
    /* when we anounced to the tracker, we got an error in the response */
1373
1622
    TR_STAT_TRACKER_ERROR    = 2,
 
1623
 
 
1624
    /* local trouble, such as disk full or permissions error */
1374
1625
    TR_STAT_LOCAL_ERROR      = 3
1375
1626
}
1376
1627
tr_stat_errtype;
1388
1639
    /** What is this torrent doing right now? */
1389
1640
    tr_torrent_activity activity;
1390
1641
 
1391
 
    /** Our current announce URL, or NULL if none.
1392
 
        This URL may change during the session if the torrent's
1393
 
        metainfo has multiple trackers and the current one
1394
 
        becomes unreachable. */
1395
 
    char *  announceURL;
1396
 
 
1397
 
    /** Our current scrape URL, or NULL if none.
1398
 
        This URL may change during the session if the torrent's
1399
 
        metainfo has multiple trackers and the current one
1400
 
        becomes unreachable. */
1401
 
    char *  scrapeURL;
1402
 
 
1403
1642
    /** Defines what kind of text is in errorString.
1404
1643
        @see errorString */
1405
1644
    tr_stat_errtype error;
1419
1658
        Range is [0..1] */
1420
1659
    float    percentComplete;
1421
1660
 
 
1661
    /** How much of the metadata the torrent has.
 
1662
        For torrents added from a .torrent this will always be 1.
 
1663
        For magnet links, this number will from from 0 to 1 as the metadata is downloaded.
 
1664
        Range is [0..1] */
 
1665
    float    metadataPercentComplete;
 
1666
 
1422
1667
    /** How much has been downloaded of the files the user wants.  This differs
1423
1668
        from percentComplete if the user wants only some of the torrent's files.
1424
1669
        Range is [0..1]
1425
1670
        @see tr_stat.leftUntilDone */
1426
1671
    float    percentDone;
1427
1672
 
1428
 
    /** The percentage of the actual ratio to the seed ratio.  This will be
1429
 
        equal to 1 if the ratio is reached or the torrent is set to seed forever.
1430
 
        Range is [0..1] */
1431
 
    float    percentRatio;
 
1673
    /** The percentage of the actual ratio to the seed ratio.  This will be 
 
1674
        equal to 1 if the ratio is reached or the torrent is set to seed forever. 
 
1675
        Range is [0..1] */ 
 
1676
    float    percentRatio; 
1432
1677
 
1433
1678
    /** Speed all data being sent for this torrent. (KiB/s)
1434
1679
        This includes piece data, protocol messages, and TCP overhead */
1471
1716
    /** Number of webseeds that are sending data to us. */
1472
1717
    int    webseedsSendingToUs;
1473
1718
 
1474
 
    /** Number of seeders that the tracker says this torrent has */
1475
 
    int    seeders;
1476
 
 
1477
 
    /** Number of leechers that the tracker says this torrent has */
1478
 
    int    leechers;
1479
 
 
1480
 
    /** Number of downloaders that the tracker says this torrent has.
1481
 
        This is a new key introduced in BEP 21 and may not be supported by some trackers.
1482
 
        If the tracker doesn't support this key, the value here will be -1. */
1483
 
    int    downloaders;
1484
 
 
1485
 
    /** Number of finished downloads that the tracker says torrent has */
1486
 
    int    timesCompleted;
1487
 
 
1488
1719
    /** Byte count of all the piece data we'll have downloaded when we're done,
1489
1720
        whether or not we have it yet.  This may be less than tr_info.totalSize
1490
1721
        if only some of the torrent's files are wanted.
1521
1752
        are moved to `corrupt' or `haveValid'. */
1522
1753
    uint64_t    haveUnchecked;
1523
1754
 
1524
 
    /**
1525
 
     * This is a human-readable string with the last scrape's results.
1526
 
     * 1. If an http error occurred, the response code and description is given.
1527
 
     * 2. If the tracker gave an error or warning messae, that is given.
1528
 
     * 3. If everything went fine, "Success" is given.
1529
 
     */
1530
 
    char    scrapeResponse[128];
1531
 
 
1532
 
    /** This is a human-readable string with the last announce's results.
1533
 
        Its contents have the same form as scrapeResponse. */
1534
 
    char    announceResponse[128];
1535
 
 
1536
 
    /** Time the most recent scrape request was sent,
1537
 
        or zero if one hasn't been sent yet. */
1538
 
    time_t    lastScrapeTime;
1539
 
 
1540
 
    /** Time when the next scrape request will be sent,
1541
 
        or 0 if an error has occured that stops scraping,
1542
 
        or 1 if a scrape is currently in progress s.t.
1543
 
        we haven't set a timer for the next one yet. */
1544
 
    time_t    nextScrapeTime;
1545
 
 
1546
 
    /** Time the most recent announce request was sent,
1547
 
        or zero if one hasn't been sent yet. */
1548
 
    time_t    lastAnnounceTime;
1549
 
 
1550
 
    /** Time when the next reannounce request will be sent,
1551
 
        or 0 if the torrent is stopped,
1552
 
        or 1 if an announce is currently in progress s.t.
1553
 
        we haven't set a timer for the next one yet */
1554
 
    time_t    nextAnnounceTime;
1555
 
 
1556
 
    /** If the torrent is running, this is the time at which
1557
 
        the client can manually ask the torrent's tracker
1558
 
        for more peers,
1559
 
        or 0 if the torrent is stopped or doesn't allow manual,
1560
 
        or 1 if an announce is currently in progress s.t.
1561
 
        we haven't set a timer for the next one yet */
1562
 
    time_t    manualAnnounceTime;
1563
 
 
1564
 
    /** A very rough estimate in KiB/s of how quickly data is being
1565
 
        passed around between all the peers we're connected to.
1566
 
        Don't put too much weight in this number. */
1567
 
    float    swarmSpeed;
 
1755
    /** time when one or more of the torrent's trackers will
 
1756
        allow you to manually ask for more peers,
 
1757
        or 0 if you can't */
 
1758
    time_t manualAnnounceTime;
1568
1759
 
1569
1760
#define TR_RATIO_NA  -1
1570
1761
#define TR_RATIO_INF -2