/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2023 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
"github.com/dustin/go-humanize"
"github.com/gorhill/cronexpr"
+ nncpYggdrasil "go.cypherpunks.ru/nncp/v8/yggdrasil"
)
-const YggdrasilPrefix = "yggdrasil:"
-
type Call struct {
Cron *cronexpr.Expression
Nice uint8
AutoTossNoExec bool
AutoTossNoTrns bool
AutoTossNoArea bool
+ AutoTossNoACK bool
}
func (ctx *Ctx) CallNode(
if addr == "" {
addr = UCSPITCPClient
}
- } else if strings.HasPrefix(addr, YggdrasilPrefix) {
- conn, err = NewYggdrasilConn(
- ctx.YggdrasilAliases,
- strings.TrimPrefix(addr, YggdrasilPrefix),
- )
+ } else if strings.HasPrefix(addr, "yggdrasilc://") {
+ conn, err = nncpYggdrasil.NewConn(ctx.YggdrasilAliases, addr)
} else {
conn, err = net.Dial("tcp", addr)
}
ctx.LogI("call-started", les, func(les LEs) string {
return fmt.Sprintf("Connection to %s (%s)", node.Name, addr)
})
- state.Wait()
+ isGood = state.Wait()
ctx.LogI("call-finished", append(
les,
LE{"Duration", int64(state.Duration.Seconds())},
humanize.IBytes(uint64(state.TxSpeed)),
)
})
- isGood = true
conn.Close()
break
} else {