2
0
mirror of synced 2025-02-24 14:48:27 +00:00

21 Commits

Author SHA1 Message Date
Matt Joiner
dd083a4e11 Track completion known to implementation state
Addresses #193
2017-10-12 16:09:32 +11:00
Matt Joiner
018afed5a7 storage: Remove incorrect comment 2017-09-23 15:27:26 +10:00
Matt Joiner
cee24fe21b storage: Add TODO about handling Close errors 2017-09-12 18:31:56 +10:00
mlmhl
d8c7f37d2b make pieceCompletion configurable 2017-05-22 10:23:37 +08:00
Chris Walker
9d96cd659f fix Spec.Storage and allow per-torrent dir
`TorrentSpec.Storage` was not honored when calling `Client.AddTorrentSpec`
and the configured `cfg.DefaultStorage` was always used. Now if you construct
your `TorrentSpec` you can specify any `StorageImpl`

Also, the most common use case for custom storage being per-torrent paths for
FileStorage, this adds a `pathMaker` function to the File implementation that
allows customization, along with the default (always use base path) and my use
case (which seemed common enough from the Gitter chat) which is infohash based
subdirectories.

All Public methods have not changed signature, but 1 private method did, hence
the test update.
2017-03-16 14:40:21 +00:00
Matt Joiner
5c5a26afed Add bolt piece completion DB
This means it can be persistent without needing cgo. Fixes issues #115 and #124.
2016-10-25 19:07:26 +11:00
Matt Joiner
69ffbe6a48 storage: Move sqlite3 import to appropriate file 2016-09-16 11:19:26 +10:00
Matt Joiner
d4e30f84f2 Rename some of the unexported file storage types 2016-09-12 17:26:39 +10:00
Matt Joiner
b5ed171ac5 Create zero-length files in the file storage when the torrent storage is opened
Fixes #111.
2016-09-12 17:01:00 +10:00
Matt Joiner
1e919dd6b1 Rework storage interfaces to make them simpler to implement
This allows lots of behaviour to be baked into the new Client, Torrent and Piece wrappers, rather than duplicating (badly) them in all the backend implementations.
2016-09-02 15:10:57 +10:00
Matt Joiner
2a1cef7c9e Remove the InfoEx type, and don't generate its infohash on the fly
Fixes #106.
2016-08-26 20:29:05 +10:00
Matt Joiner
f055abe2fc Fix issue #96
In the native file-based storage, mark pieces incomplete if the necessary file data is missing, or there's a read error on a piece.
2016-07-10 23:03:59 +10:00
Matt Joiner
11a53fa732 Fix issue #95: Closing torrent storage also closed client storage for some storage types 2016-07-09 00:36:32 +10:00
Matt Joiner
dbb3c25b1a storage: Move pieceCompletion interface into correct file 2016-07-06 13:38:16 +10:00
Matt Joiner
cee200a5a2 Add piece completion storage
Toward fixing https://github.com/anacrolix/torrent/issues/50.
2016-06-20 17:51:05 +10:00
Matt Joiner
02ea8b1081 Rename storage.I->Client 2016-05-16 21:50:43 +10:00
Matt Joiner
0aabd37e6e Add some comments to file storage 2016-05-09 15:46:48 +10:00
Seth Hoenig
9f4bf70e17 refactor struct identifiers to follow conventional go names 2016-04-18 23:11:11 -05:00
Matt Joiner
a5b54f21a1 Make opening a torrent in storage an explicit method
This is storage types where opening can fail, like mmap
2016-03-28 22:40:29 +11:00
Matt Joiner
775cf53809 Get mmap storage working 2016-03-28 21:57:04 +11:00
Matt Joiner
b97b50aca9 New storage interface 2016-03-28 20:38:30 +11:00