Commit Graph

1067 Commits

Author SHA1 Message Date
Matt Joiner 69c674606f Bring the 'torrent' command up to speed with the client API, including profiling flags 2013-11-05 00:07:28 +11:00
Matt Joiner 495082a60a Set the event condition locker in client
Needed for WaitAll, albeit not actually triggered anywhere yet.
2013-11-05 00:06:40 +11:00
Matt Joiner d7fd5d628b Stop connection writer timer on exit from function 2013-11-05 00:06:08 +11:00
Matt Joiner 068236b6da Remove obsolete private type 'pieceState' 2013-11-05 00:05:44 +11:00
Matt Joiner b499ab3619 Begin on UDP trackers 2013-11-05 00:04:14 +11:00
Matt Joiner 36b36beb3b More explicit implementation for wantPiece method 2013-10-22 18:03:44 +11:00
Matt Joiner ec0ffa84a4 If no requests can be found for a connection, set it to uninterested 2013-10-22 18:03:27 +11:00
Matt Joiner 8f0b076f65 Set pieceByBytesPendingSlice capacity in advance to reduce memory pressure 2013-10-22 18:02:52 +11:00
Matt Joiner fe5f8317d4 Reconnect to the torrentfs -testPeer at regular intervals if it's missing for any loaded torrents 2013-10-22 18:01:56 +11:00
Matt Joiner 8df567e822 Fix keep-alive timer use in connection writer, and make connection a public type
I'm not sure if making this public is the right approach yet, but for now it's a good way to conditionally invoke methods on Client from external packages.
2013-10-22 18:00:35 +11:00
Matt Joiner d039436f55 Significant progress and improvements
Piece state is broken up into several dimensions.
Implement keep-alive in connection writer.
Lazily hash pieces, only as requested.
Replace client actor mechanism with a mutex.
Fix runConnection/connectionLoop/handshake misnomers.
Fix broken reading from partially complete pieces.
2013-10-21 01:07:01 +11:00
Matt Joiner 03b1af07cd Always finish off partially downloaded pieces 2013-10-15 19:42:30 +11:00
Matt Joiner 0a5043ba69 Implement prioritizing of torrent data regions based on FS activity 2013-10-15 01:39:12 +11:00
Matt Joiner 5c0ff3ff5f Torrent client publishes data ready information; torrentfs supports file reads 2013-10-13 23:16:21 +11:00
Matt Joiner 43418e9f65 Fix bugs in the new WriteSectionTo hashing implementation 2013-10-07 18:58:33 +11:00
Matt Joiner a44accadbe Create more efficient writer method for MMapSpan for use with hashing 2013-10-07 10:35:10 +11:00
Matt Joiner e1526b2863 Support browsing torrents in the filesystem 2013-10-07 06:00:35 +11:00
Matt Joiner 8e435ea9e2 Need executable permissions on torrent data directories 2013-10-06 21:12:44 +11:00
Matt Joiner 68e189d477 Start implementing torrentfs binary 2013-10-06 18:01:39 +11:00
Matt Joiner 5dbd675be6 Fix TestHaveEncode now that message length prefixes are actually included in Marshal output 2013-10-06 16:05:03 +11:00
Matt Joiner 4209216696 BEP20 2013-10-02 20:12:05 +10:00
Matt Joiner 39660d4e9d Implement writing of chunks as they arrive 2013-10-02 19:55:03 +10:00
Matt Joiner 381c6bef68 Failing WriteAt should return ErrShortWrite
See the implementation of io.Copy.
2013-10-02 19:54:23 +10:00
Matt Joiner 7bc8524d24 Mostly handle Piece messages, and kick off a piece check when all the chunks are done 2013-10-02 17:57:59 +10:00
Matt Joiner beb599698f Decoding of Piece messages, and checking entire message is consumed 2013-10-02 17:57:19 +10:00
Matt Joiner 28531a4fcc Fix request/chunk confusion, missing outgoing message prefix, protocol tests; improve request triggering 2013-10-01 18:43:18 +10:00
Matt Joiner 081a6805c5 Implementing bitfields and connection message handling 2013-09-30 21:51:08 +10:00
Matt Joiner abf5c92488 Implement peer connection writer, optimizer and handshake 2013-09-29 16:45:17 +10:00
Matt Joiner 28c7c6a5d7 Fix race conditions 2013-09-29 16:44:37 +10:00
Matt Joiner fe80bf2f2f BytesInfoHash wasn't actually initializing the info hash 2013-09-29 16:43:35 +10:00
Matt Joiner 978aa1f0c8 Don't rely on *os.File finalizer for close 2013-09-29 14:20:18 +10:00
Matt Joiner ac254e95f2 Prevent false-positive race conditions 2013-09-29 14:18:43 +10:00
Matt Joiner 7870d20573 Begin implementing the adding of peers, and initiating of connections 2013-09-29 08:11:24 +10:00
Matt Joiner ddd4382474 Handle actorTask messages 2013-09-29 04:05:09 +10:00
Matt Joiner 805897afb5 Can't send to torrentFinished while handling an event 2013-09-29 04:04:46 +10:00
Matt Joiner b4989a370f Fix crash due to torrent.MetaInfo being unset 2013-09-29 04:03:36 +10:00
Matt Joiner aefe754698 Create torrent data files with at least the required size
Truncate is required or use of mmap'd region beyond file length raises SIGBUS.
2013-09-29 04:03:04 +10:00
Matt Joiner 816c263760 Start implementing a basic client 2013-09-26 19:49:15 +10:00
Matt Joiner 0866ce3579 Add some basic protocol definitions, this will be improved in the future 2013-09-26 13:43:46 +10:00
Matt Joiner d7ed035ef1 Add torrent-verify, simple exe that logs matching pieces from a torrent file and torrent path 2013-09-26 13:43:08 +10:00
Matt Joiner 3d1fb69e36 Add torrent.Mmap and MmapSpan, types that abstract memory-mapped torrent data 2013-09-26 13:42:24 +10:00
Matt Joiner 2a9d48d09f Add cmds 'torrent-create' and 'torrent-metainfo-pprint' using nsf's libtorgo 2013-09-19 17:00:51 +10:00
nsf d42799be2c torrent: Fix documentation. 2012-07-11 02:44:22 +06:00
nsf cb1f612378 Promote DefaultName and TotalSize to methods. The need to be read-only. 2012-07-11 02:41:22 +06:00
nsf 346dd31fd9 torrent: Remove the ugly interface{} dependent API. Use a simpler one. 2012-07-11 02:30:05 +06:00
nsf f954b649c6 torrent: Fix bug with common part not being cut off. 2012-07-09 03:37:16 +06:00
nsf 0e3b555c7e Introduce the notion of Batch.
Fixes some of the API issues. Most notably there is a need to know ahead of the
building process what is the default name of the torrent metainfo in order to
give a name to the future .torrent file.
2012-07-08 07:01:14 +06:00
nsf 832248ad25 Clarify 'AddURL' -> 'AddWebSeedURL'. 2012-07-07 22:26:10 +06:00
nsf 8149db57e0 Omg, haven't tested before committing, what a shame. :D 2012-07-06 02:02:42 +06:00
nsf 20448260d4 Add more parameter checks and cleaning. 2012-07-06 01:14:34 +06:00