diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-02-24 14:44:04 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-02-24 14:44:04 +0000 |
commit | 126827b14598e8d82bc35d7396b87d0f5a6a5e8f (patch) | |
tree | 0249caba70b6850de0f8799cff1d509c84791882 /src/vpn/gnunet-daemon-vpn-dns.c | |
parent | 119990aed1a3f628196d98fc1da15a1ab3f4f3a9 (diff) | |
download | gnunet-126827b14598e8d82bc35d7396b87d0f5a6a5e8f.tar.gz gnunet-126827b14598e8d82bc35d7396b87d0f5a6a5e8f.zip |
fix SIGSEGV if dns was slow to start up
Diffstat (limited to 'src/vpn/gnunet-daemon-vpn-dns.c')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-dns.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-dns.c b/src/vpn/gnunet-daemon-vpn-dns.c index 7d0b38d8c..07e2d6059 100644 --- a/src/vpn/gnunet-daemon-vpn-dns.c +++ b/src/vpn/gnunet-daemon-vpn-dns.c | |||
@@ -117,9 +117,12 @@ connect_to_service_dns (void *cls, | |||
117 | GNUNET_assert (dns_connection == NULL); | 117 | GNUNET_assert (dns_connection == NULL); |
118 | dns_connection = GNUNET_CLIENT_connect ("dns", cfg); | 118 | dns_connection = GNUNET_CLIENT_connect ("dns", cfg); |
119 | /* This would most likely be a misconfiguration */ | 119 | /* This would most likely be a misconfiguration */ |
120 | GNUNET_assert(dns_connection != NULL); | 120 | GNUNET_assert(NULL != dns_connection); |
121 | GNUNET_CLIENT_receive(dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL); | 121 | GNUNET_CLIENT_receive(dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL); |
122 | 122 | ||
123 | /* We might not yet be connected. Yay, mps. */ | ||
124 | if (NULL == dns_connection) return; | ||
125 | |||
123 | /* If a packet is already in the list, schedule to send it */ | 126 | /* If a packet is already in the list, schedule to send it */ |
124 | if (head != NULL) | 127 | if (head != NULL) |
125 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, | 128 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, |