mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 07:26:51 +03:00
Merge pull request #5827 from urbit/ted/ames-clog-less
ames: %clog less
This commit is contained in:
commit
ad190807c7
@ -2571,27 +2571,40 @@
|
|||||||
?: =(0 (end 0 bone))
|
?: =(0 (end 0 bone))
|
||||||
~
|
~
|
||||||
`u=message-pump-state
|
`u=message-pump-state
|
||||||
:: clogged: are five or more response messages unsent to this peer?
|
|
||||||
::
|
::
|
||||||
=/ clogged=?
|
=/ clogged=?
|
||||||
=| acc=@ud
|
|^ &(nuf-messages nuf-memory)
|
||||||
|- ^- ?
|
:: +nuf-messages: are there enough messages to mark as clogged?
|
||||||
?~ pumps
|
|
||||||
%.n
|
|
||||||
=. acc
|
|
||||||
%+ add acc
|
|
||||||
%+ add
|
|
||||||
:: in-flight messages
|
|
||||||
::
|
|
||||||
(sub [next current]:i.pumps)
|
|
||||||
:: queued messages
|
|
||||||
::
|
|
||||||
~(wyt in unsent-messages.i.pumps)
|
|
||||||
::
|
::
|
||||||
?: (gte acc 5)
|
++ nuf-messages
|
||||||
%.y
|
=| num=@ud
|
||||||
$(pumps t.pumps)
|
|- ^- ?
|
||||||
:: if clogged, notify client vanek
|
?~ pumps |
|
||||||
|
=. num
|
||||||
|
;: add num
|
||||||
|
(sub [next current]:i.pumps)
|
||||||
|
~(wyt in unsent-messages.i.pumps)
|
||||||
|
==
|
||||||
|
?: (gte num 5)
|
||||||
|
&
|
||||||
|
$(pumps t.pumps)
|
||||||
|
:: +nuf-memory: is enough memory used to mark as clogged?
|
||||||
|
::
|
||||||
|
++ nuf-memory
|
||||||
|
=| mem=@ud
|
||||||
|
|- ^- ?
|
||||||
|
?~ pumps |
|
||||||
|
=. mem
|
||||||
|
%+ add
|
||||||
|
%- ~(rep in unsent-messages.i.pumps)
|
||||||
|
|=([a=@ b=_mem] (add b (met 3 a)))
|
||||||
|
?~ unsent-fragments.i.pumps 0
|
||||||
|
(met 3 fragment.i.unsent-fragments.i.pumps)
|
||||||
|
?: (gte mem 100.000)
|
||||||
|
&
|
||||||
|
$(pumps t.pumps)
|
||||||
|
--
|
||||||
|
:: if clogged, notify client vane
|
||||||
::
|
::
|
||||||
?. clogged
|
?. clogged
|
||||||
peer-core
|
peer-core
|
||||||
|
Loading…
Reference in New Issue
Block a user