Merge pull request #1373 from urbit/dns-manual-redux

fixes dns notification bugs, adds manual fulfillment
This commit is contained in:
Jared Tobin 2019-07-23 18:02:34 -02:30 committed by GitHub
commit bc454c8035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 7 deletions

View File

@ -632,12 +632,7 @@
(json-octs u.r.httr parse-record:(provider authority))
?~(dat ~. id.u.dat)
::
=/ =address:dns
?>(?=(%direct -.target) +.target)
=/ =turf
(weld dom.authority /(crip +:(scow %p ship)))
;< ~ bind:m (poke-app:stdio collector-app [%dns-complete ship address turf])
;< now=@da bind:m get-time:stdio
;< now=@da bind:m get-time:stdio
=/ =bound
[now id target ?~(existing ~ [[wen cur] hit]:u.existing)]
(pure:m (some bound))
@ -764,6 +759,10 @@
?~ new
~& [%bind-failed in-poke-data]
(pure:m state)
=/ =turf
(weld dom.aut.nam /(crip +:(scow %p who)))
;< ~ bind:m
(poke-app:stdio collector-app [%dns-complete who +.tar turf])
=. bon.nam (~(put by bon.nam) who u.new)
=. nem.state (some nam)
::

View File

@ -124,9 +124,10 @@
=/ req=(unit address:dns) (~(get by requested.state) who)
:: ignore established bindings that don't match requested
::
?: ?& ?=(^ req)
?: ?| ?=(~ req)
!=(adr u.req)
==
~& %unknown-complete
this
=: requested.state (~(del by requested.state) who)
completed.state (~(put by completed.state) who [adr tuf])

View File

@ -0,0 +1,14 @@
:: :dns-collector: manually "complete" (fulfill) requests
::
:::: /hoon/complete/dns-collector/gen
::
/- *dns, *sole
/+ *generators
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[who=@p addr=@if =turf ~]
~
==
:- %dns-complete
^- [ship binding]
[who [%if addr] turf]