X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fnncp%2Fjobs.go;h=080ec4aabea25885fdceb83ac6d2b40634f221cd;hb=dd92823db3d72fb21a4c712a7fb052dce16443dd;hp=1f3afd1e4f93534347b1826b73e28a62c48c16e1;hpb=23cb8cf3f4539e314209ad9976c00696a9969161;p=nncp.git diff --git a/src/cypherpunks.ru/nncp/jobs.go b/src/cypherpunks.ru/nncp/jobs.go index 1f3afd1..080ec4a 100644 --- a/src/cypherpunks.ru/nncp/jobs.go +++ b/src/cypherpunks.ru/nncp/jobs.go @@ -1,11 +1,10 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2017 Sergey Matveev +Copyright (C) 2016-2019 Sergey Matveev 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 @@ -19,6 +18,7 @@ along with this program. If not, see . package nncp import ( + "io" "os" "path/filepath" "strconv" @@ -64,11 +64,11 @@ func (ctx *Ctx) Jobs(nodeId *NodeId, xx TRxTx) chan Job { continue } var pktEnc PktEnc - if _, err = xdr.Unmarshal(fd, &pktEnc); err != nil || pktEnc.Magic != MagicNNCPEv1 { + if _, err = xdr.Unmarshal(fd, &pktEnc); err != nil || pktEnc.Magic != MagicNNCPEv4 { fd.Close() continue } - fd.Seek(0, 0) + fd.Seek(0, io.SeekStart) ctx.LogD("jobs", SDS{ "xx": string(xx), "node": pktEnc.Sender,