[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: TRANSPORT: Do not try to read again and
From: |
gnunet |
Subject: |
[gnunet] branch master updated: TRANSPORT: Do not try to read again and again from queues that are closed |
Date: |
Wed, 06 Dec 2023 19:08:45 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new a849a8a1b TRANSPORT: Do not try to read again and again from queues
that are closed
a849a8a1b is described below
commit a849a8a1bd832f4eb7b562f3a69a5a1efff461d3
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Dec 6 19:08:25 2023 +0100
TRANSPORT: Do not try to read again and again from queues that are closed
---
src/service/transport/gnunet-communicator-tcp.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/service/transport/gnunet-communicator-tcp.c
b/src/service/transport/gnunet-communicator-tcp.c
index 056fcf8e7..c4340cb9e 100644
--- a/src/service/transport/gnunet-communicator-tcp.c
+++ b/src/service/transport/gnunet-communicator-tcp.c
@@ -2133,8 +2133,15 @@ queue_read (void *cls)
GNUNET_SCHEDULER_add_read_net (left, queue->sock, &queue_read, queue);
return;
}
- if (0 != rcvd)
- reschedule_queue_timeout (queue);
+ if (0 == rcvd)
+ {
+ /* Orderly shutdown of connection */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Socket for queue %p seems to have been closed\n", queue);
+ queue_destroy (queue);
+ return;
+ }
+ reschedule_queue_timeout (queue);
queue->cread_off += rcvd;
while ((queue->pread_off < sizeof(queue->pread_buf)) &&
(queue->cread_off > 0))
@@ -3004,6 +3011,14 @@ proto_read_kx (void *cls)
GNUNET_SCHEDULER_add_read_net (left, pq->sock, &proto_read_kx, pq);
return;
}
+ if (0 == rcvd)
+ {
+ /* Orderly shutdown of connection */
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Socket for proto queue %p seems to have been closed\n",
queue);
+ free_proto_queue (pq);
+ return;
+ }
pq->ibuf_off += rcvd;
if (sizeof (struct TCPNATProbeMessage) == pq->ibuf_off)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: TRANSPORT: Do not try to read again and again from queues that are closed,
gnunet <=