reduce retries and timeout

This commit is contained in:
Christian Grothoff 2021-08-07 19:02:54 +02:00
parent 8a60e6b62f
commit 1eba4f5e62
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 8 additions and 8 deletions

View File

@ -398,19 +398,19 @@ handle_mt_purge (struct TALER_CRYPTO_DenominationHelper *dh,
* Wait until the socket is ready to read. * Wait until the socket is ready to read.
* *
* @param dh helper to wait for * @param dh helper to wait for
* @return false on timeout (after 5s) * @return false on timeout (after 1s)
*/ */
static bool static bool
await_read_ready (struct TALER_CRYPTO_DenominationHelper *dh) await_read_ready (struct TALER_CRYPTO_DenominationHelper *dh)
{ {
/* wait for reply with 5s timeout */ /* wait for reply with 1s timeout */
struct pollfd pfd = { struct pollfd pfd = {
.fd = dh->sock, .fd = dh->sock,
.events = POLLIN .events = POLLIN
}; };
sigset_t sigmask; sigset_t sigmask;
struct timespec ts = { struct timespec ts = {
.tv_sec = 5 .tv_sec = 1
}; };
int ret; int ret;
@ -434,7 +434,7 @@ TALER_CRYPTO_helper_denom_poll (struct TALER_CRYPTO_DenominationHelper *dh)
{ {
char buf[UINT16_MAX]; char buf[UINT16_MAX];
ssize_t ret; ssize_t ret;
unsigned int retry_limit = 10; unsigned int retry_limit = 3;
const struct GNUNET_MessageHeader *hdr const struct GNUNET_MessageHeader *hdr
= (const struct GNUNET_MessageHeader *) buf; = (const struct GNUNET_MessageHeader *) buf;
int flag = MSG_DONTWAIT; int flag = MSG_DONTWAIT;

View File

@ -355,19 +355,19 @@ handle_mt_purge (struct TALER_CRYPTO_ExchangeSignHelper *esh,
* Wait until the socket is ready to read. * Wait until the socket is ready to read.
* *
* @param esh helper to wait for * @param esh helper to wait for
* @return false on timeout (after 5s) * @return false on timeout (after 1s)
*/ */
static bool static bool
await_read_ready (struct TALER_CRYPTO_ExchangeSignHelper *esh) await_read_ready (struct TALER_CRYPTO_ExchangeSignHelper *esh)
{ {
/* wait for reply with 5s timeout */ /* wait for reply with 1s timeout */
struct pollfd pfd = { struct pollfd pfd = {
.fd = esh->sock, .fd = esh->sock,
.events = POLLIN .events = POLLIN
}; };
sigset_t sigmask; sigset_t sigmask;
struct timespec ts = { struct timespec ts = {
.tv_sec = 5 .tv_sec = 1
}; };
int ret; int ret;
@ -391,7 +391,7 @@ TALER_CRYPTO_helper_esign_poll (struct TALER_CRYPTO_ExchangeSignHelper *esh)
{ {
char buf[UINT16_MAX]; char buf[UINT16_MAX];
ssize_t ret; ssize_t ret;
unsigned int retry_limit = 10; unsigned int retry_limit = 3;
const struct GNUNET_MessageHeader *hdr const struct GNUNET_MessageHeader *hdr
= (const struct GNUNET_MessageHeader *) buf; = (const struct GNUNET_MessageHeader *) buf;
int flag = MSG_DONTWAIT; int flag = MSG_DONTWAIT;