assuan: Fix exponential decay for first second.
authorWerner Koch <wk@gnupg.org>
Wed, 15 Nov 2017 14:30:21 +0000 (15:30 +0100)
committerWerner Koch <wk@gnupg.org>
Wed, 15 Nov 2017 14:31:52 +0000 (15:31 +0100)
commit0cfdd3b57d592fb6baa7dafe8fde124e8a6c7798
treec0313699f3ddb6ab4269d3864edae8a8070c5bda
parent8704304699bcbc1c10d0315ec7d25a1ae05c9905
assuan: Fix exponential decay for first second.

* common/asshelp.c (wait_for_sock): Round SECSLEFT.
* dirmngr/dirmngr.c (main): Take care of --debug-wait also in dameon
mode.
* common/sysutils.c (gnupg_usleep) [HAVE_NANOSLEEP]: Fix nanosleep use.
--

Without the rounding we saw in verbose mose

 [...]to come up ... (5s)
 [...]to come up ... (4s)

immediately without the expected one second delay.  Waiting for the
next seconds did not work if nanosleep was used due to improper passed
parameters in gnupg_usleep.

Adding --debug-wait for dirmngr in daemon mode is required to test
this change.

GnuPG-bug-id: 3490
Fixes-commit: 149041b0b917f4298239fe18b5ebd5ead71584a6
Signed-off-by: Werner Koch <wk@gnupg.org>
common/asshelp.c
common/sysutils.c
dirmngr/dirmngr.c