]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/toss.go
Group freq-related configuration options in single structure
[nncp.git] / src / toss.go
index 0ce446ac807b39df6e6a067a2745b0631101ede2..5652c68d15de8b46e33d9487a125164ea89d7e46 100644 (file)
@@ -32,7 +32,7 @@ import (
        "strconv"
        "strings"
 
-       "github.com/davecgh/go-xdr/xdr2"
+       xdr "github.com/davecgh/go-xdr/xdr2"
        "github.com/dustin/go-humanize"
        "github.com/klauspost/compress/zstd"
        "golang.org/x/crypto/blake2b"
@@ -280,8 +280,8 @@ func (ctx *Ctx) Toss(
                        dst := string(dstRaw)
                        sds["dst"] = dst
                        sender := ctx.Neigh[*job.PktEnc.Sender]
-                       freq := sender.Freq
-                       if freq == nil {
+                       freqPath := sender.FreqPath
+                       if freqPath == nil {
                                ctx.LogE("rx", sds, "freqing is not allowed")
                                isBad = true
                                goto Closing
@@ -291,7 +291,7 @@ func (ctx *Ctx) Toss(
                                        err = ctx.TxFile(
                                                sender,
                                                pkt.Nice,
-                                               filepath.Join(*freq, src),
+                                               filepath.Join(*freqPath, src),
                                                dst,
                                                sender.FreqMinSize,
                                        )
@@ -299,7 +299,7 @@ func (ctx *Ctx) Toss(
                                        err = ctx.TxFileChunked(
                                                sender,
                                                pkt.Nice,
-                                               filepath.Join(*freq, src),
+                                               filepath.Join(*freqPath, src),
                                                dst,
                                                sender.FreqMinSize,
                                                sender.FreqChunked,