From dcb4098ef4881f74d5eb3e2582bf1be9b7c8af9b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 28 Apr 2019 00:02:16 +0300 Subject: [PATCH] Workability of xxrate in calls section --- doc/news.ru.texi | 3 +++ doc/news.texi | 3 +++ src/cypherpunks.ru/nncp/cfg.go | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 480a565..832d30e 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -19,6 +19,9 @@ @item @command{nncp-call} может скачивать только чётко указанные пакеты. @item +Восстановлена работоспособность @option{xxrate} настройки в +@option{calls} секции конфигурационного файла. +@item Зависимые библиотеки обновлены. @item Небольшие исправления ошибок. diff --git a/doc/news.texi b/doc/news.texi index baf52c0..f087abe 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -20,6 +20,9 @@ without its transmission. @item @command{nncp-call} has ability to download only specified packets. @item +Workability of @option{xxrate} preference in @option{calls} +configuration file section. +@item Dependant libraries are updated. @item Minor bugfixes. diff --git a/src/cypherpunks.ru/nncp/cfg.go b/src/cypherpunks.ru/nncp/cfg.go index 9519f96..bcd547e 100644 --- a/src/cypherpunks.ru/nncp/cfg.go +++ b/src/cypherpunks.ru/nncp/cfg.go @@ -214,12 +214,12 @@ func NewNode(name string, yml NodeYAML) (*Node, error) { return nil, errors.New("xx field must be either \"rx\" or \"tx\"") } - rxRate := 0 - if callYml.RxRate != nil && *callYml.RxRate > 0 { + rxRate := defRxRate + if callYml.RxRate != nil { rxRate = *callYml.RxRate } - txRate := 0 - if callYml.TxRate != nil && *callYml.TxRate > 0 { + txRate := defTxRate + if callYml.TxRate != nil { txRate = *callYml.TxRate } -- 2.48.1