Verified Commit 346bb728 authored by Bernd Paysan's avatar Bernd Paysan
Browse files

Partial fix for the /renat problem

parent 6471915b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -207,7 +207,6 @@ false [IF]

\ more phony throw stuff, only for debugging engine

debugging-method [defined] record-locs and [IF] record-locs [THEN]
debugging-method drop false [IF]
:noname  ." Store backtrace..." cr defers store-backtrace
    dobacktrace ; is store-backtrace
+6 −4
Original line number Diff line number Diff line
@@ -86,10 +86,11 @@ event: :>disconnect ( addr -- ) .disconnect-me ;
    dht-connection ?dup-IF  >o o to connection rdrop  EXIT  THEN
    tick-adjust 64@ 64-0= IF  +get-time  THEN
    $8 $8 dhtnick $@ nick>pk dhtroot
    online? IF  +dht-beacon pk:connect  o to dht-connection  THEN ;
    online? IF  +dht-beacon pk:connect  o to dht-connection
    ELSE  2drop 2drop  THEN ;
: dht-disconnect ( -- )
    0 addr dht-connection !@ ?dup-IF
	>o o to connection disconnect-me o>  THEN ;
	>o o to connection disconnect-me 0 to connection o>  THEN ;

Variable announced
: subme ( -- )  announced @ IF
@@ -144,7 +145,8 @@ Forward insert-addr ( o -- )

: announce-me ( -- )
    \ Check for disconnected state
    dht-connect online? IF  replace-me -other  announced on  THEN ;
    dht-connect online? IF
	replace-me -other  announced on  THEN ;

: renat-all ( -- ) beacon( ." remove all beacons" cr )
    [IFDEF] renat-complete [: [THEN]
+2 −2
Original line number Diff line number Diff line
@@ -146,11 +146,11 @@ Variable lastn2oaddr
    THEN
    2dup routes# #key dup -1 = IF
	drop s" " 2over routes# #!
	last# to lastaddr#
	routes# #key  dup lastn2oaddr !
    ELSE
	nip nip
    THEN ;
    THEN
    last# to lastaddr# ;

: dns>string ( addr u port hint -- info net2o-addr u )
    >r SOCK_DGRAM >hints r> hints ai_family l!