VERSION | 2 +- doc/cmds.texi | 5 +++-- doc/download.texi | 4 ++++ doc/install.texi | 2 +- doc/news.ru.texi | 14 ++++++++++++++ doc/news.texi | 14 ++++++++++++++ ports/nncp/Makefile | 4 ++-- src/cmd/nncp-stat/main.go | 21 +++++++++++++++++++-- src/pipe.go | 1 + src/sp.go | 5 +---- diff --git a/VERSION b/VERSION index 4f0e110e627bf92713cf3397658948b8ae56fa8763ad1cb2876eba9f03fee74c..9327269da8cbad913382812610dd1cf8cfd2aa0ae878501d41ba2d7e2829e6c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.3.0 +5.3.1 diff --git a/doc/cmds.texi b/doc/cmds.texi index 654f4669b2c1216a1f3346285dfc5fdc02c9ac4b5376bea83f8f52750ac31682..f0422182cf10fc5d10efd62ad88e94d26f0d272694093fec415f63909dcf2bb4 100644 --- a/doc/cmds.texi +++ b/doc/cmds.texi @@ -502,13 +502,14 @@ @node nncp-stat @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 0530f10d0c2d0468e5f76d3ef88ec67435e1db8551c79d1465c12fc56102bcd3..16435582b1472e61bb1ca51447b342e487ce980a92257f428c32e57ad018a49d 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -24,6 +24,10 @@ @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 6f261ac21d3ab5a7edc8680d45f8dae928a80732f4cd181062de6d83bba316ab..b070ad10fabaeaeccc6bca0707ebb544b3e8db166daf0f3002a7559dc3eec3c2 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 0af291b4c3ee23d313f0ea4872ad392ce622f55b0bcc3940debc061a11555020..a2d04e621f34928a86714b4153ed2023b6fb60d9c32a158843497a871a409901 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 842099d7f5f2bb032bef1c1835ac995a551e45f6ef6b42e96b90fe1239861cc5..0f9f87d32919148a5b6af69bb7955521f2d144d3cdd2515e878713ff5cd49cf8 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,20 @@ @unnumbered News 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 a0a185ac9ec3577f9bea8bfd578c883b94947b57f8541dd85ebee090b5d50440..2a2b0270620a832df12cc55e19a3954af11d7895021415338d588b57e473d71a 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 915562979b5ca18e021fba89eb9663252f08dd1a2761a45434c1b63f95dba9cf..c068cb118fafa9c445de40df6dffc4b76b3096340610e385ecd05ad262fe7796 100644 --- a/src/cmd/nncp-stat/main.go +++ b/src/cmd/nncp-stat/main.go @@ -32,12 +32,23 @@ 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 @@ node = nodeNameToNode[nodeName] 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 @@ txNums := make(map[uint8]int) 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 2dcba30b420328057e172f394bda18b612c198b1132880e569a020ba7909e16c..654eac6b0d195683bbae632519b57a3285b12e436f01f80b428d0613a2e44438 100644 --- a/src/pipe.go +++ b/src/pipe.go @@ -65,6 +65,7 @@ return c.w.SetWriteDeadline(t) } 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 f98ada6188a104fb75726a4253fb88ad442ed46db5f732d6e32dfba810ad68bd..cd4905033411adcf1671a2836c219bc44ee6915e19cc8e5d16705f6fceb20500 100644 --- a/src/sp.go +++ b/src/sp.go @@ -22,7 +22,6 @@ "bytes" "crypto/subtle" "errors" "io" - "net" "os" "path/filepath" "sort" @@ -606,7 +605,6 @@ state.wg.Add(1) go func() { state.pings <- struct{}{} state.wg.Done() - state.Ctx.LogD("HERE", SDS{}, "PING GOROUTINE QUIT") }() } } @@ -768,8 +766,7 @@ if err == io.EOF { 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 {