diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-11-02 10:21:36 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-11-02 10:21:36 +0000 |
commit | 05b0060019d4d0fec5ebf6c2a2e225a81698026d (patch) | |
tree | a024b649f436b3629deaa88f441d8ae22e88426e /src/vpn | |
parent | 2ed57ce4ad8b7a3e5c404723c27695ed274ded9b (diff) | |
download | gnunet-05b0060019d4d0fec5ebf6c2a2e225a81698026d.tar.gz gnunet-05b0060019d4d0fec5ebf6c2a2e225a81698026d.zip |
cancel any pending request to a client that just disconnects
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 @@ | |||
29 | #include "gnunet_network_lib.h" | 29 | #include "gnunet_network_lib.h" |
30 | #include "gnunet_os_lib.h" | 30 | #include "gnunet_os_lib.h" |
31 | #include "gnunet-service-dns-p.h" | 31 | #include "gnunet-service-dns-p.h" |
32 | #include "gnunet_connection_lib.h" | ||
32 | #include "gnunet_protocols.h" | 33 | #include "gnunet_protocols.h" |
33 | #include "gnunet_applications.h" | 34 | #include "gnunet_applications.h" |
34 | #include "gnunet-vpn-packet.h" | 35 | #include "gnunet-vpn-packet.h" |
@@ -125,11 +126,21 @@ struct tunnel_state | |||
125 | struct GNUNET_MESH_TransmitHandle *th; | 126 | struct GNUNET_MESH_TransmitHandle *th; |
126 | }; | 127 | }; |
127 | 128 | ||
129 | static size_t send_answer (void *cls, size_t size, void *buf); | ||
130 | |||
128 | static void | 131 | static void |
129 | client_disconnect(void* cls, struct GNUNET_SERVER_Client *client) | 132 | client_disconnect(void* cls, struct GNUNET_SERVER_Client *client) |
130 | { | 133 | { |
131 | if (NULL == head) return; | 134 | if (NULL == head) return; |
132 | 135 | ||
136 | if (head->client == client) | ||
137 | { | ||
138 | GNUNET_CONNECTION_notify_transmit_ready_cancel(server_notify); | ||
139 | server_notify = GNUNET_SERVER_notify_transmit_ready (head->next->client, ntohs (head->next->pkt.hdr.size), | ||
140 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
141 | &send_answer, NULL); | ||
142 | } | ||
143 | |||
133 | struct answer_packet_list *element = head; | 144 | struct answer_packet_list *element = head; |
134 | while (element != NULL) | 145 | while (element != NULL) |
135 | { | 146 | { |