M6 networkmanager: the bundle gives the resolver the check's name
The bundle calls this node's node-resolver uplink-names with the check address's host at its start, at a changed check-address, at its bus connection's return and when this node's holder of node-resolver runs, reading the holder from the assignments; no holder is recorded and no failure, a failed call stands failed in names.json until the next moment. Builds: design 08 sign-in-page §12, §13, §22
This commit is contained in:
@@ -290,6 +290,16 @@ func userEnvironment(bus string) ([]string, error) {
|
||||
// fileEvents fires at each file event of the kernel that makes a file in one of dirs (a burst is one), until stop
|
||||
// closes. A folder that is not there is not watched, and said.
|
||||
func fileEvents(dirs []string, stop <-chan struct{}) <-chan struct{} {
|
||||
return watchFiles(dirs, nil, stop)
|
||||
}
|
||||
|
||||
// fileMade fires at each file event of the kernel that makes name in dir, until stop closes.
|
||||
func fileMade(dir, name string, stop <-chan struct{}) <-chan struct{} {
|
||||
return watchFiles([]string{dir}, func(made string) bool { return made == name }, stop)
|
||||
}
|
||||
|
||||
// watchFiles fires at each file event that makes a file in dirs whose name match takes (any, when nil).
|
||||
func watchFiles(dirs []string, match func(string) bool, stop <-chan struct{}) <-chan struct{} {
|
||||
out := make(chan struct{}, 1)
|
||||
fd, err := unix.InotifyInit1(unix.IN_CLOEXEC | unix.IN_NONBLOCK)
|
||||
if err != nil {
|
||||
@@ -309,9 +319,17 @@ func fileEvents(dirs []string, stop <-chan struct{}) <-chan struct{} {
|
||||
go func() {
|
||||
defer f.Close()
|
||||
for {
|
||||
if _, err := readInotify(f); err != nil {
|
||||
names, err := readInotify(f)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
matched := match == nil
|
||||
for _, name := range names {
|
||||
matched = matched || match(name)
|
||||
}
|
||||
if !matched {
|
||||
continue
|
||||
}
|
||||
select {
|
||||
case out <- struct{}{}:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user