Commit b7b47223 authored by bernd's avatar bernd

Move request stats last into ack packet, so that slurp has space to fit

parent a24204ad
......@@ -222,10 +222,9 @@ User cmdbuf#
: endcmdbuf ( -- addr' ) cmdbuf maxdata + ;
: maxstring ( -- n ) endcmdbuf cmdbuf$ + - ;
: cmdbuf+ ( n -- )
dup maxstring u>= !!stringfit!! cmdbuf# +! ;
dup maxstring u>= !!cmdfit!! cmdbuf# +! ;
: cmd, ( 64n -- ) cmdbuf$ + dup >r p!+ r> - cmdbuf+ ;
: flit, ( 64n -- ) cmdbuf$ + dup >r pf!+ r> - cmdbuf+ ;
: net2o, @ n>64 cmd, ;
......@@ -436,7 +435,7 @@ also net2o-base definitions
: slit, ( n -- ) slit n>zz cmd, ;
: nlit, ( n -- ) n>64 slit, ;
: ulit, ( u -- ) u>64 lit, ;
: float, ( r -- ) flit flit, ;
: float, ( r -- ) flit cmdbuf$ + dup >r pf!+ r> - cmdbuf+ ;
: flag, ( flag -- ) IF tru ELSE fals THEN ;
: (end-code) ( -- ) expect-reply? cmd cmdlock unlock ;
: end-code ( -- ) (end-code) previous ;
......
......@@ -387,7 +387,7 @@ cell 8 = [IF] 6 [ELSE] 5 [THEN] Constant cell>>
\ acknowledge toplevel
: net2o:ack-code ( ackflag -- ackflag' )
false { slurp? }
false dup { slurp? stats? }
net2o-code ack <req ['] end-cmd IS expect-reply?
dup ack-receive !@ xor >r
r@ ack-toggle# and IF
......@@ -396,11 +396,12 @@ cell 8 = [IF] 6 [ELSE] 5 [THEN] Constant cell>>
true net2o:do-resend
THEN
0 data-rmap @ .do-slurp !@
?dup-IF net2o:ackflush request-stats? IF send-timing THEN
true to slurp? THEN
?dup-IF net2o:ackflush
request-stats? to stats? true to slurp? THEN
THEN +expected slurp? or to slurp?
req> endwith cmdbuf# @ 4 = IF cmdbuf# off THEN
slurp? IF slurp THEN
stats? IF ack <req send-timing req> endwith THEN
end-code r> dup ack-toggle# and IF map-resend? THEN ;
: net2o:do-ack ( -- )
......
......@@ -28,6 +28,7 @@ s" unimplemented net2o function" throwcode !!function!!
s" too many commands" throwcode !!commands!!
s" float does not fit" throwcode !!floatfit!!
s" string does not fit" throwcode !!stringfit!!
s" cmd does not fit" throwcode !!cmdfit!!
s" ivs must be 64 bytes" throwcode !!ivs!!
s" net2o timed out" throwcode !!timeout!!
s" maximum nesting reached" throwcode !!maxnest!!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment