ames: clog at 100kB instead of 5 messages

This commit is contained in:
Ted Blackman 2022-06-04 17:18:21 -05:00
parent cdd2b79026
commit 953273004a

View File

@ -2182,7 +2182,7 @@
?: =(0 (end 0 bone))
~
`u=message-pump-state
:: clogged: are five or more response messages unsent to this peer?
:: clogged: are outgoing messages to this peer using too much memory?
::
=/ clogged=?
=| acc=@ud
@ -2192,14 +2192,15 @@
=. acc
%+ add acc
%+ add
:: in-flight messages
::
(sub [next current]:i.pumps)
:: queued messages
::
~(wyt in unsent-messages.i.pumps)
=- (roll - add)
(turn ~(tap to unsent-messages.i.pumps) |=(b=@ (met 3 b)))
?~ unsent-fragments.i.pumps
0
(met 3 fragment.i.unsent-fragments.i.pumps)
:: 100.000 chosen so roughly 10.000 peers could be
:: clogged without killing the loom
::
?: (gte acc 5)
?: (gte acc 100.000)
%.y
$(pumps t.pumps)
:: if clogged, notify client vanek