gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16220 - gnunet/src/vpn


From: gnunet
Subject: [GNUnet-SVN] r16220 - gnunet/src/vpn
Date: Wed, 27 Jul 2011 09:28:10 +0200

Author: toelke
Date: 2011-07-27 09:28:10 +0200 (Wed, 27 Jul 2011)
New Revision: 16220

Modified:
   gnunet/src/vpn/gnunet-service-dns.c
Log:
save the dns-tunnel

Modified: gnunet/src/vpn/gnunet-service-dns.c
===================================================================
--- gnunet/src/vpn/gnunet-service-dns.c 2011-07-27 07:28:09 UTC (rev 16219)
+++ gnunet/src/vpn/gnunet-service-dns.c 2011-07-27 07:28:10 UTC (rev 16220)
@@ -43,6 +43,11 @@
 struct GNUNET_MESH_Handle *mesh_handle;
 
 /**
+ * The tunnel to send queries
+ */
+static struct GNUNET_MESH_Tunnel* dns_tunnel;
+
+/**
  * The UDP-Socket through which DNS-Resolves will be sent if they are not to be
  * sent through gnunet. The port of this socket will not be hijacked.
  */
@@ -261,13 +266,14 @@
 
   struct tunnel_cls *cls_ = (struct tunnel_cls*)cls;
 
-  cls_->tunnel = GNUNET_MESH_peer_request_connect_by_type(mesh_handle,
-                                           GNUNET_TIME_UNIT_HOURS,
-                                           
GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER,
-                                           mesh_connect,
-                                           NULL,
-                                           cls_);
-
+  if (NULL == dns_tunnel)
+    dns_tunnel = GNUNET_MESH_peer_request_connect_by_type(mesh_handle,
+                                                          
GNUNET_TIME_UNIT_HOURS,
+                                                          
GNUNET_APPLICATION_TYPE_INTERNET_RESOLVER,
+                                                          mesh_connect,
+                                                          NULL,
+                                                          cls_);
+  cls_->tunnel = dns_tunnel;
   remote_pending[cls_->dns.s.id] = cls_;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]