Commit Graph

3465 Commits

Author SHA1 Message Date
whr819987540 64c11ff7b5 add comment and debug info 2023-05-06 11:43:30 +08:00
whr819987540 ffd17b70a3 add encoding to .torrent default config 2023-05-04 17:29:53 +08:00
whr819987540 d8f10ed70a go mod tidy 2023-05-04 17:26:24 +08:00
whr819987540 90b694c4ae 返回某个torrent实际写入内存的字节数 2023-05-04 17:26:14 +08:00
whr819987540 30e909f905 实际写入chunk的位置 2023-05-04 17:25:29 +08:00
whr819987540 16ce9dc617 增加一个直接从Client返回ClientImpl的函数,用于读取MemoryClientImpl实际写入内存的字节数 2023-05-04 17:24:58 +08:00
whr819987540 c4fcfe712c BuildFromMemory从内存中直接生成.torrent 2023-05-04 17:22:46 +08:00
whr819987540 ee2821f72e 实现MemoryClientImpl 2023-05-04 17:20:39 +08:00
whr819987540 596be6e62b GeneratePiecesFromMemory 2023-05-04 16:38:41 +08:00
whr819987540 11405bf65b BuildFromMemory从内存中直接生成.torrent 2023-05-04 16:38:04 +08:00
whr819987540 81e4f2fa40 add comment 2023-04-27 16:03:48 +08:00
whr819987540 d02c7c9518 add comment 2023-04-27 16:03:14 +08:00
whr819987540 a7e27a4ff1 add comment 2023-04-27 16:02:23 +08:00
whr819987540 a6ca468094 add comment 2023-04-27 16:00:04 +08:00
whr819987540 2848a224f9 add debug info 2023-04-27 15:59:04 +08:00
whr819987540 31b19a2f19 add comment 2023-04-27 15:58:22 +08:00
whr819987540 5868ed4d31 add comment to BuildFromFilePath 2023-04-27 15:57:23 +08:00
whr819987540 874ac2c6b6 add test file for piece-length.go 2023-04-27 12:05:16 +08:00
whr819987540 16debff467 minimumPieceLength from 16KB to 64KB, add maximumPieceLength 2MB-, piecelength priority is over piece numbr priority 2023-04-27 12:04:53 +08:00
whr819987540 ff11917fa8 add comment to ChoosePieceLength 2023-04-27 10:38:37 +08:00
whr819987540 f7e8a6ad2d add comment for DownloadAll 2023-04-25 19:35:26 +08:00
whr 1fb2348a0e move cmd dir to new repo, torrent_main.git 2023-04-25 11:24:58 +08:00
whr 570704dcff add comment 2023-04-25 00:06:09 +08:00
whr 5f9483f571 add comment 2023-04-25 00:05:16 +08:00
whr 0a8b545d28 add comment and todo 2023-04-25 00:04:38 +08:00
whr 6f42096625 add go.mod for cmd/torrent 2023-04-24 21:34:30 +08:00
whr fd2f475ed0 go mod edit -replace=github.com/anacrolix/torrent=../torrent 2023-04-24 21:30:23 +08:00
Matt Joiner fdb0911e28
Don't log using torrent source as warning for context cancellation
This probably occurs because the info was obtained and we don't need to try the source anymore.
2023-04-04 19:13:14 +10:00
Matt Joiner 42d29d95a6
Import generics as g 2023-04-04 19:12:26 +10:00
Matt Joiner 069b92a98c
Add AddTorrentOpts.InfoBytes 2023-04-04 19:12:01 +10:00
Matt Joiner 8d3e86e3c0
Expose StringAddr 2023-04-03 15:10:54 +10:00
Matt Joiner e13fd755ee
bencode: Only use unsafe.String for go>=1.20 2023-04-03 15:10:38 +10:00
Matt Joiner 872b11bd57
bencode: Support parsing strings into bool 2023-03-20 10:50:22 +11:00
Matt Joiner c069849b40
Add Peer.Torrent
This was for accessing from callback events.
2023-03-01 14:17:29 +11:00
Matt Joiner 31bbd435f9
gorond 2023-03-01 12:34:35 +11:00
Matt Joiner d3b3d2d9bf
Finish moving all Peer types and methods into peer.go 2023-03-01 12:34:16 +11:00
Matt Joiner 2ae264b6cc
Expose UDP tracker error response type 2023-02-24 16:20:08 +11:00
Matt Joiner 63982c3c80
Don't reconnect before sending requests with current conn ID
The tracker udp://tracker.torrent.eu.org:451/announce gives `error response: "Connection ID missmatch.\x00"` every 2 minutes when under heavy use. I suspect that reconnect requests are sent just after the connection ID is confirmed as not stale, but before it used for a request, and the server rejects the request after processing the reconnect first.

It might also just be that that tracker server implementation is lazy and marks everything stale on regular boundaries.
2023-02-20 15:49:55 +11:00
Matt Joiner e8971ea0f1
Add unit test for relative availability after HaveNone
Could help with https://github.com/anacrolix/torrent/issues/813.
2023-02-19 13:24:25 +11:00
Matt Joiner 48b3e66c76
Add http and udp tracker server implementations 2023-02-19 12:08:23 +11:00
Matt Joiner e8b04c7181
gofumpt 2023-02-18 18:35:22 +11:00
dependabot[bot] 81201050bc
Bump golang.org/x/net from 0.5.0 to 0.7.0 (#819)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.5.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-18 16:06:17 +11:00
Matt Joiner 2cb7121a93
Limit peer request data allocation
This follows up from abb5cbc96e. We currently limit how many requests peers can send us, but didn't really check that peers didn't make us allocate huge amounts of space to buffer their requests. I'm sure there's some rough edges here.
2023-02-14 12:46:49 +11:00
dependabot[bot] ceb7b2443a
Bump github.com/pion/dtls/v2 from 2.1.5 to 2.2.4 (#814)
Bumps [github.com/pion/dtls/v2](https://github.com/pion/dtls) from 2.1.5 to 2.2.4.
- [Release notes](https://github.com/pion/dtls/releases)
- [Commits](https://github.com/pion/dtls/compare/v2.1.5...v2.2.4)

---
updated-dependencies:
- dependency-name: github.com/pion/dtls/v2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 08:15:15 +11:00
Matt Joiner abb5cbc96e
Check for chunks overflowing piece bounds on request read
Test for integer overflow in when checking read requests are within the bounds of the associated piece. Another fix is required to limit the amount of memory that can be allocated for such requests.
2023-02-13 23:27:15 +11:00
Colin Marc 60fd7581e7
Remove unecessary completion "set" (#812)
If the file has never been downloaded, complete will naturally be false. It's
not necessary to then set it false again unless it was actually claimed to be
true in the first place.

In my tests, using the boltdb completion thingy with fsync turned *on*, this
reduced the cold start for big buck bunny from multiple seconds to just a few
ms.
2023-02-13 14:26:03 +11:00
Spencer Comfort 5a185c45c0
Update codeql analysis to v2 (#806)
Updates the outdated codeql analysis actions to v2
2023-01-31 08:41:06 +11:00
Matt Joiner d47739db0c
Roaring bitmap tests now pass when run from downstream 2023-01-24 08:52:49 +11:00
Matt Joiner 8fe9fb78aa
Add span for udp packet handling 2023-01-08 17:22:02 +11:00
Matt Joiner 1eb923c947
Forward leechers and seeders announce handler results 2023-01-05 00:05:34 +11:00