From: Sergey Matveev Date: Wed, 25 Dec 2019 13:21:56 +0000 (+0300) Subject: Merge branch 'develop' X-Git-Tag: v5.3.1^0 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=64d786a18109efc34e89c440e5df5c71a1d4f375;hp=510478b83a2808262f7167fffe5296b489a2bf03;p=nncp.git Merge branch 'develop' --- diff --git a/VERSION b/VERSION index 03f488b..c7cb131 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.3.0 +5.3.1 diff --git a/doc/cmds.texi b/doc/cmds.texi index c4c6d01..9fff9e4 100644 --- a/doc/cmds.texi +++ b/doc/cmds.texi @@ -502,13 +502,14 @@ ones. If @option{-seen} option is specified, then delete only @section nncp-stat @example -$ nncp-stat [options] [-node NODE] +$ nncp-stat [options] [-pkt] [-node NODE] @end example Print current @ref{Spool, spool} statistics about unsent and unprocessed packets. For each node (unless @option{-node} specified) and each niceness level there will be printed how many packets (with the total -size) are in inbound (Rx) and outbound (Tx) queues. +size) are in inbound (Rx) and outbound (Tx) queues. @option{-pkt} option +show information about each packet. @node nncp-toss @section nncp-toss diff --git a/doc/download.texi b/doc/download.texi index fd6c17d..01f7d89 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -24,6 +24,10 @@ Tarballs include all necessary required libraries: @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Date @tab Size @tab Tarball @tab SHA256 checksum +@item @ref{Release 5.3.0, 5.3.0} @tab 2019-12-22 @tab 1112 KiB +@tab @url{download/nncp-5.3.0.tar.xz, link} @url{download/nncp-5.3.0.tar.xz.sig, sign} +@tab @code{9F093115 506D00E7 2E41ACD6 3F283172 8430E1C2 8BA4A941 FFA3C65D 89AD4ED0} + @item @ref{Release 5.2.1, 5.2.1} @tab 2019-12-15 @tab 1109 KiB @tab @url{download/nncp-5.2.1.tar.xz, link} @url{download/nncp-5.2.1.tar.xz.sig, sign} @tab @code{983D1A8A 4398C281 76356AE1 C5541124 B0755555 D115063B D1388F85 9C4A6B3E} diff --git a/doc/install.texi b/doc/install.texi index 5db01d0..413de36 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -1,7 +1,7 @@ @node Installation @unnumbered Installation -@set VERSION 5.3.0 +@set VERSION 5.3.1 Possibly NNCP package already exists for your distribution: diff --git a/doc/news.ru.texi b/doc/news.ru.texi index ba34716..7361408 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,20 @@ @node Новости @section Новости +@node Релиз 5.3.1 +@subsection Релиз 5.3.1 +@itemize + +@item +Исправлена работоспособность @option{onlinedeadline} с адресами вызова +использующими внешние команды (@verb{#"|somecmd"#}). + +@item +@command{nncp-stat} имеет опцию @option{-pkt} показывающую информацию по +каждому пакету в spool. + +@end itemize + @node Релиз 5.3.0 @subsection Релиз 5.3.0 @itemize diff --git a/doc/news.texi b/doc/news.texi index 9d9e877..697ced8 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,20 @@ See also this page @ref{Новости, on russian}. +@node Release 5.3.1 +@section Release 5.3.1 +@itemize + +@item +Fixed @option{onlinedeadline} workability with call addresses that use +external commands (@verb{#"|somecmd"#}). + +@item +@command{nncp-stat} has @option{-pkt} option displaying information +about each packet in the spool. + +@end itemize + @node Release 5.3.0 @section Release 5.3.0 @itemize diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index 3b5109b..00943d5 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -1,7 +1,7 @@ -# $FreeBSD: head/net/nncp/Makefile 517819 2019-11-17 11:51:56Z dmgk $ +# $FreeBSD: $ PORTNAME= nncp -DISTVERSION= 5.3.0 +DISTVERSION= 5.3.1 CATEGORIES= net MASTER_SITES= http://www.nncpgo.org/download/ diff --git a/src/cmd/nncp-stat/main.go b/src/cmd/nncp-stat/main.go index 22eaca0..09cc63b 100644 --- a/src/cmd/nncp-stat/main.go +++ b/src/cmd/nncp-stat/main.go @@ -32,12 +32,23 @@ import ( func usage() { fmt.Fprintf(os.Stderr, nncp.UsageHeader()) fmt.Fprintf(os.Stderr, "nncp-stat -- show queued Rx/Tx stats\n\n") - fmt.Fprintf(os.Stderr, "Usage: %s [options]\nOptions:\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "Usage: %s [options] [-pkt] [-node NODE]\nOptions:\n", os.Args[0]) flag.PrintDefaults() } +func jobPrint(xx nncp.TRxTx, job nncp.Job) { + fmt.Printf( + "\t%s %s %s (nice: %s)\n", + string(xx), + nncp.ToBase32(job.HshValue[:]), + humanize.IBytes(uint64(job.Size)), + nncp.NicenessFmt(job.PktEnc.Nice), + ) +} + func main() { var ( + showPkt = flag.Bool("pkt", false, "Show packets listing") cfgPath = flag.String("cfg", nncp.DefaultCfgPath, "Path to configuration file") nodeRaw = flag.String("node", "", "Process only that node") spoolPath = flag.String("spool", "", "Override path to spool") @@ -84,10 +95,14 @@ func main() { if nodeOnly != nil && *node.Id != *nodeOnly.Id { continue } + fmt.Println(node.Name) rxNums := make(map[uint8]int) rxBytes := make(map[uint8]int64) for job := range ctx.Jobs(node.Id, nncp.TRx) { job.Fd.Close() + if *showPkt { + jobPrint(nncp.TRx, job) + } rxNums[job.PktEnc.Nice] = rxNums[job.PktEnc.Nice] + 1 rxBytes[job.PktEnc.Nice] = rxBytes[job.PktEnc.Nice] + job.Size } @@ -95,10 +110,12 @@ func main() { txBytes := make(map[uint8]int64) for job := range ctx.Jobs(node.Id, nncp.TTx) { job.Fd.Close() + if *showPkt { + jobPrint(nncp.TRx, job) + } txNums[job.PktEnc.Nice] = txNums[job.PktEnc.Nice] + 1 txBytes[job.PktEnc.Nice] = txBytes[job.PktEnc.Nice] + job.Size } - fmt.Println(node.Name) var nice uint8 for nice = 1; nice > 0; nice++ { rxNum, rxExists := rxNums[nice] diff --git a/src/pipe.go b/src/pipe.go index a250cee..1b50573 100644 --- a/src/pipe.go +++ b/src/pipe.go @@ -65,6 +65,7 @@ func (c PipeConn) SetWriteDeadline(t time.Time) error { } func (c PipeConn) Close() (err error) { + c.r.Close() err = c.w.Close() go c.cmd.Wait() time.AfterFunc(time.Duration(10*time.Second), func() { c.cmd.Process.Kill() }) diff --git a/src/sp.go b/src/sp.go index 1297c41..aca6f18 100644 --- a/src/sp.go +++ b/src/sp.go @@ -22,7 +22,6 @@ import ( "crypto/subtle" "errors" "io" - "net" "os" "path/filepath" "sort" @@ -606,7 +605,6 @@ func (state *SPState) StartWorkers( go func() { state.pings <- struct{}{} state.wg.Done() - state.Ctx.LogD("HERE", SDS{}, "PING GOROUTINE QUIT") }() } } @@ -768,8 +766,7 @@ func (state *SPState) StartWorkers( break } unmarshalErr := err.(*xdr.UnmarshalError) - netErr, ok := unmarshalErr.Err.(net.Error) - if ok && netErr.Timeout() { + if os.IsTimeout(unmarshalErr.Err) { continue } if unmarshalErr.ErrorCode == xdr.ErrIO {