Browse Source
chore(p2p/host): fix typos (#2683)
* readme
* scope
* natmgr
* svc
---------
Co-authored-by: Sukun <sukunrt@gmail.com>
pull/2690/head
Vehorny
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
p2p/host/resource-manager/README.md
-
p2p/host/resource-manager/scope_test.go
|
|
@ -161,7 +161,7 @@ belong to some service in the system. Hence, this suggests that apart |
|
|
|
from global limits, we can constrain stream usage at finer |
|
|
|
granularity, at the protocol and service level. |
|
|
|
|
|
|
|
Once again, we disinguish between inbound and outbound streams. |
|
|
|
Once again, we distinguish between inbound and outbound streams. |
|
|
|
Inbound streams are initiated by remote peers and consume resources in |
|
|
|
response to network events; controlling inbound stream usage is again |
|
|
|
paramount for protecting the system from overload or attack. |
|
|
|
|
|
@ -74,7 +74,7 @@ func TestCheckMemory(t *testing.T) { |
|
|
|
limit = 1024 |
|
|
|
} |
|
|
|
currentMem = (currentMem % limit) // We can't have reserved more than our limit
|
|
|
|
res = (res >> 14) // We won't resonably ever have a reservation > 2^50
|
|
|
|
res = (res >> 14) // We won't reasonably ever have a reservation > 2^50
|
|
|
|
rc := resources{limit: &BaseLimit{ |
|
|
|
Memory: int64(limit), |
|
|
|
StreamsInbound: 1, |
|
|
@ -88,7 +88,7 @@ func TestCheckMemory(t *testing.T) { |
|
|
|
rc.memory = int64(currentMem) |
|
|
|
|
|
|
|
priShift = (priShift % 9) |
|
|
|
// Check different priorties at 2^0, 2^1,...2^8. This lets our math be correct in the check below (and avoid overflows).
|
|
|
|
// Check different priorities at 2^0, 2^1,...2^8. This lets our math be correct in the check below (and avoid overflows).
|
|
|
|
pri := uint8((1 << priShift) - 1) |
|
|
|
|
|
|
|
err := rc.checkMemory(int64(res), pri) |
|
|
|