Fix for bugs Martin detected yesterday

parent f56d607f
......@@ -190,7 +190,7 @@ Defer gen-table
: cmd@ ( -- u ) buf-state 2@ over + >r p@+ r> over - buf-state 2! 64>n ;
standard:field
-7 dup 1 and cell 4 = and - cells 0 +field net2o.name
-7 cells 0 +field net2o.name
drop
: >net2o-name ( addr -- addr' u )
......
......@@ -72,8 +72,6 @@ require dhtroot.fs
+flow-control +resend
connect( [: .time ." Connected, o=" o hex. cr ;] $err ) ;
0 Value dht-connection
Forward renat-all
event: :>renat ( -- ) renat-all ;
......@@ -139,8 +137,6 @@ Forward insert-addr ( o -- )
\ notification for address changes
true Value connected?
[IFDEF] android require android/net.fs [ELSE]
[IFDEF] PF_NETLINK require linux/net.fs [THEN]
[THEN]
......
......@@ -455,6 +455,8 @@ Variable secret-nicks#
Forward dht-nick?
Variable keysearchs#
hash: unknown-keys#
event: :>search-key ( $addr -- )
{ w^ key } key $@ dht-nick? key $free
1 keysearchs# +!@ drop ;
......@@ -464,9 +466,13 @@ event: :>search-key ( $addr -- )
: .key-id ( addr u -- ) last# >r key| 2dup key# #@ 0=
IF drop keysearchs# @ 1+ >r
<event 2dup $make elit, :>search-key ?query-task event|
BEGIN keysearchs# @ r@ - 0< WHILE <event query-task event| REPEAT
rdrop 2dup key# #@ 0= IF drop .unkey-id r> to last# EXIT THEN
2dup unknown-keys# #@ nip 0= dht-connection and IF
<event 2dup $make elit, :>search-key ?query-task event|
BEGIN keysearchs# @ r@ - 0< WHILE <event query-task event| REPEAT
rdrop 2dup key# #@ 0= IF drop
"<unknown>" 2over unknown-keys# #!
.unkey-id r> to last# EXIT THEN
ELSE rdrop .unkey-id r> to last# EXIT THEN
THEN
cell+ ..nick 2drop r> to last# ;
......
......@@ -1385,7 +1385,7 @@ also net2o-base scope: /chat
[: BEGIN bl $split 2>r dup WHILE s>unumber? WHILE
drop do-otrify 2r> REPEAT THEN
2drop 2r> 2drop
;] (send-avalanche) drop .chat
;] (send-avalanche) drop .chat save-msgs&
;] !wrapper ;
: /bye ( addr u -- )
......
......@@ -65,6 +65,11 @@ $12 Value max-data# \ 16MB data space
$0C Value max-code# \ 256k code space
$10 Value max-block# \ 64k maximum block size+alignment
\ values, status
true Value connected?
0 Value dht-connection
\ constants, and depending values
$2A Constant overhead \ constant overhead
......
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