From: Sergey Matveev Date: Wed, 29 Nov 2017 20:30:25 +0000 (+0300) Subject: Suffix is a better term X-Git-Tag: 1.0^2~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a4cf79125f07d867c9448d28b1a5cbe4932ff79c;p=nncp.git Suffix is a better term --- diff --git a/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go b/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go index 163feb4..e79f9e1 100644 --- a/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go +++ b/src/cypherpunks.ru/nncp/cmd/nncp-bundle/main.go @@ -279,7 +279,7 @@ func main() { ctx.LogD("nncp-bundle", sds, "Packet already exists") continue } - if _, err = os.Stat(dstPath + nncp.SeenPostfix); err == nil || !os.IsNotExist(err) { + if _, err = os.Stat(dstPath + nncp.SeenSuffix); err == nil || !os.IsNotExist(err) { ctx.LogD("nncp-bundle", sds, "Packet already exists") continue } diff --git a/src/cypherpunks.ru/nncp/cmd/nncp-xfer/main.go b/src/cypherpunks.ru/nncp/cmd/nncp-xfer/main.go index f500cc9..ffd1c0c 100644 --- a/src/cypherpunks.ru/nncp/cmd/nncp-xfer/main.go +++ b/src/cypherpunks.ru/nncp/cmd/nncp-xfer/main.go @@ -286,7 +286,7 @@ Tx: job.Fd.Close() continue } - if _, err = os.Stat(filepath.Join(dstPath, pktName+nncp.SeenPostfix)); err == nil || !os.IsNotExist(err) { + if _, err = os.Stat(filepath.Join(dstPath, pktName+nncp.SeenSuffix)); err == nil || !os.IsNotExist(err) { ctx.LogD("nncp-xfer", sds, "already exists") job.Fd.Close() continue diff --git a/src/cypherpunks.ru/nncp/toss.go b/src/cypherpunks.ru/nncp/toss.go index a1fa8f3..7777ecd 100644 --- a/src/cypherpunks.ru/nncp/toss.go +++ b/src/cypherpunks.ru/nncp/toss.go @@ -39,7 +39,7 @@ import ( ) const ( - SeenPostfix = ".seen" + SeenSuffix = ".seen" ) func newNotification(fromTo *FromToYAML, subject string) io.Reader { @@ -128,7 +128,7 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun, doSeen bool) bool { ctx.LogI("rx", sds, "") if !dryRun { if doSeen { - if fd, err := os.Create(job.Fd.Name() + SeenPostfix); err == nil { + if fd, err := os.Create(job.Fd.Name() + SeenSuffix); err == nil { fd.Close() } } @@ -199,7 +199,7 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun, doSeen bool) bool { ctx.LogI("rx", sds, "") if !dryRun { if doSeen { - if fd, err := os.Create(job.Fd.Name() + SeenPostfix); err == nil { + if fd, err := os.Create(job.Fd.Name() + SeenSuffix); err == nil { fd.Close() } } @@ -273,7 +273,7 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun, doSeen bool) bool { ctx.LogI("rx", sds, "") if !dryRun { if doSeen { - if fd, err := os.Create(job.Fd.Name() + SeenPostfix); err == nil { + if fd, err := os.Create(job.Fd.Name() + SeenSuffix); err == nil { fd.Close() } } @@ -317,7 +317,7 @@ func (ctx *Ctx) Toss(nodeId *NodeId, nice uint8, dryRun, doSeen bool) bool { ctx.LogI("rx", sds, "") if !dryRun { if doSeen { - if fd, err := os.Create(job.Fd.Name() + SeenPostfix); err == nil { + if fd, err := os.Create(job.Fd.Name() + SeenSuffix); err == nil { fd.Close() } }