[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: -proper fix for endless loop on
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: -proper fix for endless loop on IPC permission trouble |
Date: |
Thu, 05 Aug 2021 20:48:37 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new bd7e4472 -proper fix for endless loop on IPC permission trouble
bd7e4472 is described below
commit bd7e44720b212defebb7df47f85d5f393b2cb108
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Aug 5 20:48:28 2021 +0200
-proper fix for endless loop on IPC permission trouble
---
src/util/crypto_helper_denom.c | 12 ++++++++++--
src/util/crypto_helper_esign.c | 10 +++++++++-
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/util/crypto_helper_denom.c b/src/util/crypto_helper_denom.c
index f55d2cd8..168699b4 100644
--- a/src/util/crypto_helper_denom.c
+++ b/src/util/crypto_helper_denom.c
@@ -434,6 +434,7 @@ TALER_CRYPTO_helper_denom_poll (struct
TALER_CRYPTO_DenominationHelper *dh)
{
char buf[UINT16_MAX];
ssize_t ret;
+ unsigned int retry_limit = 10;
const struct GNUNET_MessageHeader *hdr
= (const struct GNUNET_MessageHeader *) buf;
int flag = MSG_DONTWAIT;
@@ -462,11 +463,18 @@ TALER_CRYPTO_helper_denom_poll (struct
TALER_CRYPTO_DenominationHelper *dh)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Restarting connection to RSA helper, did not come up
properly\n");
do_disconnect (dh);
+ if (0 == retry_limit)
+ return; /* give up */
try_connect (dh);
if (-1 == dh->sock)
return; /* give up */
+ retry_limit--;
+ flag = MSG_DONTWAIT;
+ }
+ else
+ {
+ flag = 0; /* syscall must be non-blocking this time */
}
- flag = 0; /* syscall must be non-blocking this time */
continue; /* try again */
}
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
@@ -474,7 +482,7 @@ TALER_CRYPTO_helper_denom_poll (struct
TALER_CRYPTO_DenominationHelper *dh)
do_disconnect (dh);
return;
}
-
+ retry_limit = 10;
flag = MSG_DONTWAIT;
if ( (ret < sizeof (struct GNUNET_MessageHeader)) ||
(ret != ntohs (hdr->size)) )
diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c
index f98faae2..29891d75 100644
--- a/src/util/crypto_helper_esign.c
+++ b/src/util/crypto_helper_esign.c
@@ -391,6 +391,7 @@ TALER_CRYPTO_helper_esign_poll (struct
TALER_CRYPTO_ExchangeSignHelper *esh)
{
char buf[UINT16_MAX];
ssize_t ret;
+ unsigned int retry_limit = 10;
const struct GNUNET_MessageHeader *hdr
= (const struct GNUNET_MessageHeader *) buf;
int flag = MSG_DONTWAIT;
@@ -417,11 +418,18 @@ TALER_CRYPTO_helper_esign_poll (struct
TALER_CRYPTO_ExchangeSignHelper *esh)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Restarting connection to EdDSA helper, did not come up
properly\n");
do_disconnect (esh);
+ if (0 == retry_limit)
+ return; /* give up */
try_connect (esh);
if (-1 == esh->sock)
return; /* give up */
+ retry_limit--;
+ flag = MSG_DONTWAIT;
+ }
+ else
+ {
+ flag = 0; /* syscall must be non-blocking this time */
}
- flag = 0; /* syscall must be non-blocking this time */
continue; /* try again */
}
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: -proper fix for endless loop on IPC permission trouble,
gnunet <=