ames: only %clog on 5 unsent messages

This commit is contained in:
Ted Blackman 2019-11-22 08:43:08 -05:00
parent 4b4e5ba80c
commit 5110b3459b
2 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56b9a21703bcb6d3deb64c53fec2280e9bffe97531a79baaa815fe07d8f50ba1
size 9770883
oid sha256:faa5bfb03a5d84b6f9e9b218ee10167d36ce58db2d98d63b681e9e163b99cb3a
size 9778478

View File

@ -1630,8 +1630,32 @@
::
?. ?=(?(%dead %unborn) -.qos.peer-state)
peer-core
:: peer has stopped responding; notify client vanes
:: peer has stopped responding; check if our responses are backing up
::
:: Only look at response bones. Request bones are unregulated,
:: since requests tend to be much smaller than responses.
::
=/ pumps=(list message-pump-state)
%+ murn ~(tap by snd.peer-state)
|= [=bone =message-pump-state]
?: =(0 (end 0 1 bone))
~
`u=message-pump-state
:: clogged: are five or more response messages unsent to this peer?
::
=/ clogged=?
=| acc=@ud
|- ^- ?
?~ pumps
%.n
=. acc (add acc (sub [next current]:i.pumps))
?: (gte acc 5)
%.y
$(pumps t.pumps)
:: if clogged, notify client vanek
::
?. clogged
peer-core
%+ roll ~(tap in heeds.peer-state)
|=([d=^duct core=_peer-core] (emit:core d %give %clog her.channel))
:: +on-hear-shut-packet: handle receipt of ack or message fragment