gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] 04/04: first iteraton of TCP communicator done


From: gnunet
Subject: [GNUnet-SVN] [gnunet] 04/04: first iteraton of TCP communicator done
Date: Mon, 28 Jan 2019 18:08:05 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit d80214febe4e0e4cc64dddc74e990b3c5ca8a5df
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 28 13:55:42 2019 +0100

    first iteraton of TCP communicator done
---
 src/transport/.gitignore                |  1 +
 src/transport/gnunet-communicator-tcp.c | 18 +++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/transport/.gitignore b/src/transport/.gitignore
index e2f12c230..169604467 100644
--- a/src/transport/.gitignore
+++ b/src/transport/.gitignore
@@ -85,3 +85,4 @@ test_transport_testing_restart
 test_transport_testing_startstop
 gnunet-communicator-unix
 gnunet-service-tng
+gnunet-communicator-tcp
diff --git a/src/transport/gnunet-communicator-tcp.c 
b/src/transport/gnunet-communicator-tcp.c
index 884fbb0cb..2980ad532 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -24,7 +24,7 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - NAT service API change to handle address stops!
+ * - support DNS names in BINDTO option
  * - support NAT connection reversal method
  * - support other TCP-specific NAT traversal methods
  */
@@ -2180,28 +2180,32 @@ nat_address_cb (void *cls,
                socklen_t addrlen)
 {
   char *my_addr;
-  static struct GNUNET_TRANSPORT_AddressIdentifier *ai; // FIXME: store in 
*ctx of NAT!
+  struct GNUNET_TRANSPORT_AddressIdentifier *ai;
 
   if (GNUNET_YES == add_remove)
   {
-    // FIXME: do better job at stringification of @a addr?
+    enum GNUNET_NetworkType nt;
+
     GNUNET_asprintf (&my_addr,
                     "%s-%s",
                     COMMUNICATOR_ADDRESS_PREFIX,
                     GNUNET_a2s (addr,
                                 addrlen));
-    // FIXME: translate 'ac' to 'nt'?
+    nt = GNUNET_NT_scanner_get_type (is,
+                                    addr,
+                                    addrlen); 
     ai = GNUNET_TRANSPORT_communicator_address_add (ch,
                                                    my_addr,
-                                                   GNUNET_NT_LOOPBACK, // 
FIXME: wrong NT!
+                                                   nt,
                                                    
GNUNET_TIME_UNIT_FOREVER_REL);
     GNUNET_free (my_addr);
+    *app_ctx = ai;
   }
   else
   {
-    // FIXME: support removal! => improve NAT API!
+    ai = *app_ctx;
     GNUNET_TRANSPORT_communicator_address_remove (ai);
-    ai = NULL;
+    *app_ctx = NULL;
   }
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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