projects
/
btrtrc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6625b05
)
Do webseed request updates asynchronously
author
Matt Joiner <anacrolix@gmail.com>
Mon, 6 Dec 2021 08:24:04 +0000 (19:24 +1100)
committer
Matt Joiner <anacrolix@gmail.com>
Sun, 12 Dec 2021 05:56:01 +0000 (16:56 +1100)
Fixes a bug where received chunks are immediately requested while still being processed.
webseed-peer.go
patch
|
blob
|
history
diff --git
a/webseed-peer.go
b/webseed-peer.go
index cfce1e81d4b2768b9264340f28586c21b6ce2c7d..85e121194d28c22c6d3180a6d8a45cd79d7a1c80 100644
(file)
--- a/
webseed-peer.go
+++ b/
webseed-peer.go
@@
-124,7
+124,11
@@
func (ws *webseedPeer) drop() {}
func (ws *webseedPeer) handleUpdateRequests() {
// Because this is synchronous, webseed peers seem to get first dibs on newly prioritized
// pieces.
- ws.peer.maybeUpdateActualRequestState()
+ go func() {
+ ws.peer.t.cl.lock()
+ defer ws.peer.t.cl.unlock()
+ ws.peer.maybeUpdateActualRequestState()
+ }()
}
func (ws *webseedPeer) onClose() {