Commit f5cf8637 authored by bernd's avatar bernd

Make sure all these new stacks are cleard upon entering a task

parent 38716bea
......@@ -47,8 +47,6 @@ User buf-state cell uallot drop
\ use a string stack to make sure that strings can only originate from
\ a string inside the command we are just executing
User string-stack
: >$ ( addr u -- $:string )
string-stack $[]# 1+ string-stack $[] cell- 2! ;
: $> ( $:string -- addr u )
......@@ -95,8 +93,6 @@ User string-stack
\ object stack
User object-stack
: o-pop ( o:o1 o:x -- o1 o:x ) object-stack gen-pop ;
: o-push ( o1 o:x -- o:o1 o:x ) object-stack gen-push ;
......@@ -109,13 +105,8 @@ User object-stack
\ token stack - only for decompiling
User t-stack
: t-push ( addr -- )
t-stack $[]# t-stack $[] ! ;
: t-pop ( -- addr )
t-stack $[]# 1- dup 0< !!object-empty!!
t-stack $[] @ t-stack $@len cell- t-stack $!len ;
: t-push ( addr -- ) t-stack gen-push ;
: t-pop ( -- addr ) t-stack gen-pop ;
\ float are stored big endian.
......@@ -408,7 +399,6 @@ Variable throwcount
init0buf swap mykey-salt# + 2 64s + ;
User neststart#
User nest-stack
: nest[ ( -- ) neststart# @ nest-stack gen-push
cmdbuf# @ neststart# ! ;
......@@ -464,7 +454,7 @@ dup set-current previous
: 3*64>n ( 64a 64b 64c -- na nb nc ) 64>n >r 64>n >r 64>n r> r> ;
[THEN]
\ commands to read and write files
\ commands to reply
also net2o-base definitions
$10 net2o: <req ( -- ) ; \ stub: push own id in reply
......
......@@ -127,7 +127,7 @@ net2o-base
+net2o: context ( -- ) \ make context active
o IF context! ELSE ." Can't " THEN ." establish a context!" F cr ;
: time-offset! ( -- ) ticks 64dup lit, >time-offset time-offset 64! context ;
: time-offset! ( -- ) ticks 64dup lit, >time-offset time-offset 64! ;
: reply-key, ( -- )
nest[ pkc keysize $, dest-pubkey @ IF
dest-pubkey $@ $, keypair
......@@ -138,12 +138,12 @@ net2o-base
+net2o: gen-reply ( -- ) \ generate a key request reply reply
own-crypt? knocked? or 0= ?EXIT
[: crypt( ." Reply key: " tmpkey@ .nnb F cr )
reply-key, cookie+request time-offset! ]tmpnest
reply-key, cookie+request time-offset! context ]tmpnest
push-cmd ;] IS expect-reply? ;
+net2o: gen-punch-reply ( -- ) o? \ generate a key request reply reply
knocked? 0= ?EXIT
[: crypt( ." Reply key: " tmpkey@ .nnb F cr )
reply-key, gen-punchload gen-punch time-offset! ]tmpnest
reply-key, gen-punchload gen-punch time-offset! context ]tmpnest
push-cmd ;] IS expect-reply? ;
\ !!TODO!! knock should use special default key
......
......@@ -565,9 +565,20 @@ Defer init-reply
alloc-io
User string-stack
User object-stack
User t-stack
User nest-stack
: stacks-off ( -- )
string-stack off
object-stack off
t-stack off
nest-stack off ;
: net2o-pass ( params xt n task ) pass
b-out op-vector @ debug-vector !
init-reply prep-socks alloc-io catch free-io
init-reply prep-socks alloc-io stacks-off catch free-io
?dup-IF DoError THEN ;
: net2o-task ( params xt n -- task )
stacksize4 NewTask4 dup >r net2o-pass r> ;
......
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