From: Philipp Tölke Date: Wed, 2 Nov 2011 10:21:36 +0000 (+0000) Subject: cancel any pending request to a client that just disconnects X-Git-Tag: initial-import-from-subversion-38251~16117 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=05b0060019d4d0fec5ebf6c2a2e225a81698026d;p=oweals%2Fgnunet.git cancel any pending request to a client that just disconnects --- diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 6f9d0f1ad..489235ed4 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c @@ -29,6 +29,7 @@ #include "gnunet_network_lib.h" #include "gnunet_os_lib.h" #include "gnunet-service-dns-p.h" +#include "gnunet_connection_lib.h" #include "gnunet_protocols.h" #include "gnunet_applications.h" #include "gnunet-vpn-packet.h" @@ -125,11 +126,21 @@ struct tunnel_state struct GNUNET_MESH_TransmitHandle *th; }; +static size_t send_answer (void *cls, size_t size, void *buf); + static void client_disconnect(void* cls, struct GNUNET_SERVER_Client *client) { if (NULL == head) return; + if (head->client == client) + { + GNUNET_CONNECTION_notify_transmit_ready_cancel(server_notify); + server_notify = GNUNET_SERVER_notify_transmit_ready (head->next->client, ntohs (head->next->pkt.hdr.size), + GNUNET_TIME_UNIT_FOREVER_REL, + &send_answer, NULL); + } + struct answer_packet_list *element = head; while (element != NULL) {