2
0
mirror of synced 2025-02-23 22:28:11 +00:00

151 Commits

Author SHA1 Message Date
Matt Joiner
87e64b3088
Propagate announce interval, particularly for UDP 2022-12-15 23:21:08 +11:00
Matt Joiner
cbea87aaf3
Add upstream announce gating 2022-12-13 16:41:08 +11:00
Matt Joiner
ab4599b6b8
Add some tracing 2022-12-13 15:28:34 +11:00
Matt Joiner
cfe166c745
Don't use AnnounceHandler by value
It needs to share mutex for upstream tracker single flight handling.
2022-12-12 11:23:33 +11:00
Matt Joiner
0a4de1821e
Fix error message for connection ID mismatch 2022-12-08 15:07:14 +11:00
Matt Joiner
5cedf602f2
Make UDP tracker connection ID unsigned
This is more appropriate for logging and its use as a byte blob elsewhere.
2022-12-08 15:06:59 +11:00
Matt Joiner
91bde5fdf0
Use ConnectionId type alias 2022-12-08 15:06:05 +11:00
Matt Joiner
acb09fcf79
Add get peers limits 2022-12-08 14:04:43 +11:00
Matt Joiner
1028161833
Use smaller parameter type 2022-12-08 14:04:42 +11:00
Matt Joiner
e5f00e9a82
Fix goroutine leak when augmenting peers from upstream 2022-12-08 13:39:58 +11:00
Matt Joiner
26c226f88f
Fix missing log argument 2022-12-07 10:45:13 +11:00
Matt Joiner
68dc90a7f7
Rework logging 2022-12-07 10:45:12 +11:00
Matt Joiner
c23269d1cc
Support upstream trackers 2022-12-07 10:45:12 +11:00
Matt Joiner
425a91c921
Support alternate remote host resolution 2022-12-07 10:45:12 +11:00
Matt Joiner
6b5c2fa1b0
Support HTTP tracker server 2022-12-07 10:45:12 +11:00
Matt Joiner
eb9c032f2b
Start a UDP server implementation 2022-12-07 10:45:12 +11:00
Matt Joiner
98d5a19d50
Support marshalling http tracker response peers 2022-12-07 10:44:26 +11:00
Matt Joiner
b81423c101
Rename tracker/http package 2022-12-07 10:44:12 +11:00
Matt Joiner
330d23be22
Some tidying in tracker/udp 2022-12-05 12:51:29 +11:00
Matt Joiner
bf5a22f345
Add announce --event flag 2022-12-05 12:50:55 +11:00
Matt Joiner
17058f76f7
Wrap error returned from tracker HTTP request director 2022-11-29 10:45:38 +11:00
Matt Joiner
3d49eec03a
Rename some HTTP identifiers to Http
I believe the Go convention on this is bad, and this names them inline with the style used elsewhere in anacrolix/torrent with Ip for example.

Unfortunately it's pretty widespread, so I've only changed the recent additions.
2022-11-29 10:45:38 +11:00
Marco Vidonis
916af6e38a
Modify HTTP request before sending (#787)
* set up custom request headers

* apply headers defined in torrent client config

* add error handling

* provide better name for method

* update error message

* only apply HTTPRequestDirector if not nil
2022-11-29 10:35:36 +11:00
Matt Joiner
3e0f34934d
gorond ./... 2022-11-15 23:31:27 +11:00
Craig Campbell
f120b93e1c
Add ability to set DialContext/ListenPacket for tracker announcements (#760)
This is useful if you want to use a custom dialer to proxy requests via
an external server since the HTTPProxy can only be used with tcp
trackers and not udp.
2022-07-07 15:51:58 +10:00
Matt Joiner
30a5d079be Quote http tracker error response body 2022-03-02 10:49:55 +11:00
Matt Joiner
fe43ce07c8 Quote UDP tracker response error bodies with %#q 2022-02-20 16:15:45 +11:00
Matt Joiner
a324fbfee3 Make use of the lazylog branch of anacrolix/log
This avoids significant allocations and overhead.
2022-01-31 17:22:36 +11:00
Matt Joiner
50fcd908ca tracker/udp.ConnClient: Make logging configurable
Should fix https://github.com/anacrolix/torrent/issues/701#issue-1088130173
2021-12-28 12:05:01 +11:00
Preston
b831060d6e
fix http tracker arg position (#700)
Co-authored-by: Bot Git <bot@example.com>
2021-12-23 12:34:16 +11:00
Matt Joiner
8764456d23 bencode: Enforce dict key ordering
Fix bencode dict key ordering in HTTP tracker test
2021-12-12 16:56:01 +11:00
Matt Joiner
aaec4dbd80 tracker/udp: Panic on read errors if ConnClient not closed
There's nothing exposed to handle this error currently, and if it occurs, it's better not to fail in silence. I'm currently debugging a situation where ConnClients stop working, this would be a condition we'd want to know about.
2021-11-23 08:35:45 +11:00
Matt Joiner
615669ecf8 Improve logging of UDP tracker packet dispatch error 2021-11-23 08:33:29 +11:00
Matt Joiner
aae32e2a31 Wrap UDP tracker response error 2021-11-23 08:32:25 +11:00
Matt Joiner
6cb65f4ecf Don't dial in UDP tracking
This could fix an issue where tracker addresses change, but we're already bound to a particular address and so fail to receive any more responses.
It should also make it easier to share UDP sockets between UDP tracker clients, although that's not currently implemented.
2021-11-22 18:11:09 +11:00
Matt Joiner
8555ab7f21 Doc comments 2021-11-22 18:10:47 +11:00
Matt Joiner
c6ee03f449 gofumpt 2021-11-08 14:47:01 +11:00
Matt Joiner
a9cbb644c5
Fix http announce of infohash containing ' ' bytes (#591)
Fixes https://github.com/anacrolix/torrent/issues/534.
2021-09-12 14:11:59 +10:00
Bora M. Alper
16176b762e
Add linter CI (#542)
* Add linter CI

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make gosec CI ignore SHA1 and upload sarif

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Fix formatting of source files

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make go vet ignore unkeyed composite literals and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Make staticcheck ignore unused methods and fix other warnings

Signed-off-by: Bora M. Alper <bora@boramalper.org>

* Use golangci-lint

Signed-off-by: Bora M. Alper <bora@boramalper.org>
2021-08-16 11:11:31 +10:00
Matt Joiner
83749028ec Trim UDP tracker client read allocations 2021-07-26 10:18:24 +10:00
Matt Joiner
4fb13a1868 Fix race in concurrent connects in UDP tracker 2021-06-27 11:57:28 +10:00
Matt Joiner
9c81516139 Check that udp conn ID age is non-zero 2021-06-25 15:00:39 +10:00
Matt Joiner
ff8557cf7e Add http tracker AllowKeepAlive 2021-06-25 15:00:09 +10:00
Matt Joiner
a570b83870 Update and expose default client identifiers 2021-06-25 11:29:59 +10:00
Matt Joiner
d4bf547801 Add udp tracker scrape support 2021-06-24 23:13:35 +10:00
Matt Joiner
65f507a792 Pull AnnounceOpt into tracker package 2021-06-24 23:13:35 +10:00
Matt Joiner
a3159e6b11 Cancel writer after request 2021-06-24 23:13:35 +10:00
Matt Joiner
4bcf71c729 Don't log dispatch errors 2021-06-24 23:13:35 +10:00
Matt Joiner
98a1423732 Extract protocol agnostic tracker Client 2021-06-24 23:13:35 +10:00
Matt Joiner
101a269873 Rewrite udp announce to use udp client 2021-06-24 23:13:35 +10:00