From: Christian Grothoff Date: Tue, 24 Jan 2012 20:23:06 +0000 (+0000) Subject: -handle mesh errors more gracefully X-Git-Tag: initial-import-from-subversion-38251~15143 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6c76bdb2f02ad3b57a1e7381c26b30fd03ae0095;p=oweals%2Fgnunet.git -handle mesh errors more gracefully --- diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index 514554b80..9e37c0696 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c @@ -523,6 +523,20 @@ send_to_peer_notify_callback (void *cls, size_t size, void *buf) s->th = NULL; tnq = s->head; + if (NULL == tnq) + return 0; + if (0 == size) + { + s->th = GNUNET_MESH_notify_transmit_ready (tunnel, + GNUNET_NO /* corking */, + 0 /* priority */, + GNUNET_TIME_UNIT_FOREVER_REL, + NULL, + tnq->len, + &send_to_peer_notify_callback, + s); + return 0; + } GNUNET_assert (size >= tnq->len); memcpy (buf, tnq->payload, tnq->len); size = tnq->len;