Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Commit f9000e4

Browse files
committed
updates %ames initialization logic to be more safe and robust
1 parent 97a26e5 commit f9000e4

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

sys/vane/ames.hoon

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,14 @@
554554
%- need %- need
555555
%- (sloy-light ski)
556556
[[151 %noun] %j our %saxo da+now /(scot %p who)]
557+
:: +turf-scry: for network domains
558+
::
559+
++ turf-scry
560+
~/ %turf
561+
;; (list turf)
562+
%- need %- need
563+
%- (sloy-light ski)
564+
[[151 %noun] %j our %turf da+now ~]
557565
::
558566
++ vein :: vein:am
559567
~/ %vein
@@ -1300,7 +1308,14 @@
13001308
:_ fox [hen [%pass wire %j %pubs p.bon]]~
13011309
::
13021310
%bock
1303-
:_ fox [hen %give %turf tuf.fox]~
1311+
:: ignore %turf if we haven't yet learned a unix duct
1312+
::
1313+
:: Only happens during first boot.
1314+
::
1315+
?~ gad.fox
1316+
[~ fox]
1317+
:_ fox
1318+
[gad.fox %give %turf tuf.fox]~
13041319
::
13051320
%brew
13061321
:_ fox [hen [%pass / %j %turf ~]]~
@@ -1323,16 +1338,26 @@
13231338
:_ fox [hen %pass wire i.q.q.bon %west p.bon t.q.q.bon r.bon]~
13241339
::
13251340
%ouzo
1341+
:: drop packet if we haven't yet learned a unix duct
1342+
::
1343+
:: Only happens during first boot.
1344+
::
1345+
?~ gad.fox
1346+
[~ fox]
13261347
:: ~& [%send now p.bon `@p`(mug (shaf %flap q.bon))]
1327-
~| [%ames-bad-duct duct=gad.fox lane=p.bon]
1328-
?> ?=(^ gad.fox)
13291348
:_ fox
13301349
[[gad.fox [%give %send p.bon q.bon]] ~]
13311350
::
13321351
%pito
13331352
:_ fox(tim `p.bon)
13341353
%- flop
13351354
^- (list move)
1355+
:: XX should this be the unix duct (gad.fox)?
1356+
::
1357+
:: It seems far more important that the duct be always
1358+
:: predictable than that it be the unix duct, which
1359+
:: may change, or be unset during first boot.
1360+
::
13361361
:- [gad.fox %pass /ames %b %wait p.bon]
13371362
?~ tim.fox ~
13381363
[gad.fox %pass /ames %b %rest u.tim.fox]~
@@ -1385,10 +1410,6 @@
13851410
::
13861411
%mack ?~ +>.sih $(sih [%g %nice ~]) :: XX using old code
13871412
$(sih [%g %mean `[%mack +>+.sih]])
1388-
::
1389-
%turf
1390-
=. tuf.fox turf.sih
1391-
[~ +>.$]
13921413
::
13931414
%pubs
13941415
?. ?=([%pubs @ ~] tea)
@@ -1431,6 +1452,12 @@
14311452
::
14321453
%wake
14331454
(~(wake am [our now fox ski]) hen)
1455+
::
1456+
%turf
1457+
?: =(tuf.fox turf.sih)
1458+
[~ fox]
1459+
=. tuf.fox turf.sih
1460+
[[%bock ~]~ fox]
14341461
::
14351462
?(%mean %nice) :: XX obsolete
14361463
?: ?=([%ye ~] tea)
@@ -1469,8 +1496,10 @@
14691496
^- [p=(list boon) q=fort]
14701497
?- -.kyz
14711498
%barn
1472-
:_ fox(gad hen)
1473-
[%bock ~]~
1499+
=: gad.fox hen
1500+
tuf.fox ~(turf-scry am [our now fox ski])
1501+
==
1502+
[[%bock ~]~ fox]
14741503
::
14751504
%bonk
14761505
:_ fox

0 commit comments

Comments
 (0)