From dfe245814ce868073f26b6ad5f05a24b9d99c7b4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 2 Dec 2021 17:25:57 +0100 Subject: reduce lock contention in RSA secmod --- src/util/secmod_common.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/util/secmod_common.c') diff --git a/src/util/secmod_common.c b/src/util/secmod_common.c index 33b880d2c..0a83bfb6c 100644 --- a/src/util/secmod_common.c +++ b/src/util/secmod_common.c @@ -74,17 +74,15 @@ static volatile bool in_shutdown; enum GNUNET_GenericReturnValue -TES_transmit (int sock, - const struct GNUNET_MessageHeader *hdr) +TES_transmit_raw (int sock, + size_t end, + const void *pos) { ssize_t off = 0; - const void *pos = hdr; - uint16_t end = ntohs (hdr->size); GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Sending message of type %u and length %u\n", - (unsigned int) ntohs (hdr->type), - (unsigned int) ntohs (hdr->size)); + "Sending message of length %u\n", + (unsigned int) end); while (off < end) { ssize_t ret = send (sock, @@ -118,6 +116,20 @@ TES_transmit (int sock, } +enum GNUNET_GenericReturnValue +TES_transmit (int sock, + const struct GNUNET_MessageHeader *hdr) +{ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Sending message of type %u and length %u\n", + (unsigned int) ntohs (hdr->type), + (unsigned int) ntohs (hdr->size)); + return TES_transmit_raw (sock, + ntohs (hdr->size), + hdr); +} + + struct GNUNET_NETWORK_Handle * TES_open_socket (const char *unixpath) { -- cgit v1.2.3