ames: simplify pending-acks conditional

This commit is contained in:
yosoyubik 2023-05-26 10:09:44 +02:00
parent f6101569f5
commit 1e74e8d19a

View File

@ -3783,9 +3783,9 @@
::
?> ?=(%& -.meat.shut-packet.task)
=+ [num-fragments fragment-num fragment]=+.meat.shut-packet.task
?. &(=(num-fragments 1) =(fragment-num 0))
?: &(=(num-fragments 1) =(fragment-num 0))
(check-pending-acks fragment)
(hear [lane shut-packet ok]:task)
(check-pending-acks fragment-num num-fragments fragment)
::
++ ack-on-corked-bone
:: if we %hear a fragment on a corked bone, always ack
@ -3798,22 +3798,16 @@
|.("hear {<(received bone)>} on corked bone={<bone>}")
::
++ check-pending-acks
:: if this is a %cork %plea and are still waiting to
:: hear %acks for previous naxplanation we sent, no-op
:: if this is a %cork %plea and we are still waiting to
:: hear %acks for previous naxplanations we sent, no-op
::
|= [num=@ud frags=@ud frag=@uw]
|= frag=@uw
^+ sink
=/ message-blob=*
%+ assemble-fragments frags
(~(gas by *(map fragment-num fragment)) [num frag]~)
=/ cork-plea=?
?=(^ ;;((soft [%$ path %cork ~]) message-blob))
=/ pending-ack=?
=/ nax-bone=^bone (mix 0b10 bone)
=/ live-packets=@ud
~(wyt by live.packet-pump-state.state:(abed:mu nax-bone))
(gth live-packets 0)
?. &(cork-plea pending-ack)
=/ blob=* (cue (rep packet-size [frag]~))
=+ pump=(abed:mu (mix 0b10 bone))
?. ?& ?=(^ ;;((soft [%$ path %cork ~]) blob))
?=(^ live.packet-pump-state.state.pump)
==
(hear [lane shut-packet ok]:task)
%. sink
%+ pe-trace odd.veb