diff options
Diffstat (limited to 'src/vpn/gnunet-daemon-vpn-dns.c')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-dns.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-dns.c b/src/vpn/gnunet-daemon-vpn-dns.c index 7f762238c..77d900046 100644 --- a/src/vpn/gnunet-daemon-vpn-dns.c +++ b/src/vpn/gnunet-daemon-vpn-dns.c | |||
@@ -57,6 +57,7 @@ size_t | |||
57 | send_query (void *cls __attribute__ ((unused)), size_t size, void *buf) | 57 | send_query (void *cls __attribute__ ((unused)), size_t size, void *buf) |
58 | { | 58 | { |
59 | size_t len; | 59 | size_t len; |
60 | |||
60 | dns_transmit_handle = NULL; | 61 | dns_transmit_handle = NULL; |
61 | 62 | ||
62 | /* | 63 | /* |
@@ -100,17 +101,20 @@ send_query (void *cls __attribute__ ((unused)), size_t size, void *buf) | |||
100 | */ | 101 | */ |
101 | if (head != NULL) | 102 | if (head != NULL) |
102 | { | 103 | { |
103 | dns_transmit_handle = GNUNET_CLIENT_notify_transmit_ready (dns_connection, | 104 | dns_transmit_handle = |
104 | ntohs (head->pkt.hdr.size), | 105 | GNUNET_CLIENT_notify_transmit_ready (dns_connection, |
105 | GNUNET_TIME_UNIT_FOREVER_REL, | 106 | ntohs (head->pkt.hdr.size), |
106 | GNUNET_YES, &send_query, NULL); | 107 | GNUNET_TIME_UNIT_FOREVER_REL, |
108 | GNUNET_YES, &send_query, NULL); | ||
107 | } | 109 | } |
108 | else if (restart_hijack == 1) | 110 | else if (restart_hijack == 1) |
109 | { | 111 | { |
110 | dns_transmit_handle = GNUNET_CLIENT_notify_transmit_ready (dns_connection, | 112 | dns_transmit_handle = |
111 | sizeof (struct GNUNET_MessageHeader), | 113 | GNUNET_CLIENT_notify_transmit_ready (dns_connection, |
112 | GNUNET_TIME_UNIT_FOREVER_REL, | 114 | sizeof (struct |
113 | GNUNET_YES, &send_query, NULL); | 115 | GNUNET_MessageHeader), |
116 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
117 | GNUNET_YES, &send_query, NULL); | ||
114 | } | 118 | } |
115 | 119 | ||
116 | return len; | 120 | return len; |
@@ -144,16 +148,19 @@ connect_to_service_dns (void *cls | |||
144 | 148 | ||
145 | /* If a packet is already in the list, schedule to send it */ | 149 | /* If a packet is already in the list, schedule to send it */ |
146 | if (dns_transmit_handle == NULL && head != NULL) | 150 | if (dns_transmit_handle == NULL && head != NULL) |
147 | dns_transmit_handle = GNUNET_CLIENT_notify_transmit_ready (dns_connection, | 151 | dns_transmit_handle = |
148 | ntohs (head->pkt.hdr.size), | 152 | GNUNET_CLIENT_notify_transmit_ready (dns_connection, |
149 | GNUNET_TIME_UNIT_FOREVER_REL, | 153 | ntohs (head->pkt.hdr.size), |
150 | GNUNET_YES, &send_query, NULL); | 154 | GNUNET_TIME_UNIT_FOREVER_REL, |
155 | GNUNET_YES, &send_query, NULL); | ||
151 | else if (dns_transmit_handle == NULL && restart_hijack == 1) | 156 | else if (dns_transmit_handle == NULL && restart_hijack == 1) |
152 | { | 157 | { |
153 | dns_transmit_handle = GNUNET_CLIENT_notify_transmit_ready (dns_connection, | 158 | dns_transmit_handle = |
154 | sizeof (struct GNUNET_MessageHeader), | 159 | GNUNET_CLIENT_notify_transmit_ready (dns_connection, |
155 | GNUNET_TIME_UNIT_FOREVER_REL, | 160 | sizeof (struct |
156 | GNUNET_YES, &send_query, NULL); | 161 | GNUNET_MessageHeader), |
162 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
163 | GNUNET_YES, &send_query, NULL); | ||
157 | } | 164 | } |
158 | } | 165 | } |
159 | 166 | ||
@@ -170,7 +177,7 @@ dns_answer_handler (void *cls | |||
170 | if (msg == NULL) | 177 | if (msg == NULL) |
171 | { | 178 | { |
172 | if (dns_transmit_handle != NULL) | 179 | if (dns_transmit_handle != NULL) |
173 | GNUNET_CLIENT_notify_transmit_ready_cancel(dns_transmit_handle); | 180 | GNUNET_CLIENT_notify_transmit_ready_cancel (dns_transmit_handle); |
174 | dns_transmit_handle = NULL; | 181 | dns_transmit_handle = NULL; |
175 | GNUNET_CLIENT_disconnect (dns_connection, GNUNET_NO); | 182 | GNUNET_CLIENT_disconnect (dns_connection, GNUNET_NO); |
176 | dns_connection = NULL; | 183 | dns_connection = NULL; |