]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cypherpunks.ru/nncp/call.go
Forbid any later GNU GPL versions autousage
[nncp.git] / src / cypherpunks.ru / nncp / call.go
index 853dbaec3df58d9b5b512818c2be6d1b78bd1a9c..3f150652bd915f5d1a65d58cf85b8ed9821de549 100644 (file)
@@ -4,8 +4,7 @@ Copyright (C) 2016-2019 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
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, version 3 of the License.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -43,7 +42,9 @@ func (ctx *Ctx) CallNode(
        xxOnly TRxTx,
        rxRate, txRate int,
        onlineDeadline, maxOnlineTime uint,
-       listOnly bool) (isGood bool) {
+       listOnly bool,
+       onlyPkts map[[32]byte]bool,
+) (isGood bool) {
        for _, addr := range addrs {
                sds := SDS{"node": node.Id, "addr": addr}
                ctx.LogD("call", sds, "dialing")
@@ -53,18 +54,19 @@ func (ctx *Ctx) CallNode(
                        continue
                }
                ctx.LogD("call", sds, "connected")
-               state, err := ctx.StartI(
-                       conn,
-                       node.Id,
-                       nice,
-                       xxOnly,
-                       rxRate,
-                       txRate,
-                       onlineDeadline,
-                       maxOnlineTime,
-                       listOnly,
-               )
-               if err == nil {
+               state := SPState{
+                       Ctx:            ctx,
+                       Node:           node,
+                       Nice:           nice,
+                       onlineDeadline: onlineDeadline,
+                       maxOnlineTime:  maxOnlineTime,
+                       xxOnly:         xxOnly,
+                       rxRate:         rxRate,
+                       txRate:         txRate,
+                       listOnly:       listOnly,
+                       onlyPkts:       onlyPkts,
+               }
+               if err = state.StartI(conn); err == nil {
                        ctx.LogI("call-start", sds, "connected")
                        state.Wait()
                        ctx.LogI("call-finish", SDS{