From 05b0060019d4d0fec5ebf6c2a2e225a81698026d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philipp=20T=C3=B6lke?= Date: Wed, 2 Nov 2011 10:21:36 +0000 Subject: [PATCH] cancel any pending request to a client that just disconnects --- src/vpn/gnunet-service-dns.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) { -- 2.25.1