]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/call.go
On demand calling
[nncp.git] / src / call.go
index 727b95fd46d9fad3645af58d1f7ac73eadba26c7..1635b3042c77036b697421b601e821dc8dcaf176 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2021 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
@@ -31,8 +31,16 @@ type Call struct {
        RxRate         int
        TxRate         int
        Addr           *string
-       OnlineDeadline uint
+       OnlineDeadline time.Duration
        MaxOnlineTime  time.Duration
+       WhenTxExists   bool
+
+       AutoToss       bool
+       AutoTossDoSeen bool
+       AutoTossNoFile bool
+       AutoTossNoFreq bool
+       AutoTossNoExec bool
+       AutoTossNoTrns bool
 }
 
 func (ctx *Ctx) CallNode(
@@ -41,8 +49,7 @@ func (ctx *Ctx) CallNode(
        nice uint8,
        xxOnly TRxTx,
        rxRate, txRate int,
-       onlineDeadline uint,
-       maxOnlineTime time.Duration,
+       onlineDeadline, maxOnlineTime time.Duration,
        listOnly bool,
        onlyPkts map[[32]byte]bool,
 ) (isGood bool) {
@@ -85,11 +92,11 @@ func (ctx *Ctx) CallNode(
                                "txspeed":  state.TxSpeed,
                        }, "")
                        isGood = true
-                       conn.Close()
+                       conn.Close() // #nosec G104
                        break
                } else {
                        ctx.LogE("call-start", sds, err, "")
-                       conn.Close()
+                       conn.Close() // #nosec G104
                }
        }
        return