Add explanation to peer semaphore
This commit is contained in:
parent
04d8b5f7c8
commit
648c4edf71
1 changed files with 3 additions and 1 deletions
|
|
@ -1277,7 +1277,9 @@ impl PeerHandler {
|
|||
trace!("we are unchoked");
|
||||
self.locked.write().i_am_choked = false;
|
||||
self.unchoke_notify.notify_waiters();
|
||||
// TODO: compute this better than hard coding.
|
||||
// 128 should be more than enough to maintain 100mbps
|
||||
// for a single peer that has 100ms ping
|
||||
// https://www.desmos.com/calculator/x3szur87ps
|
||||
self.requests_sem.add_permits(128);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue