whiny christian fix
authorNathan S. Evans <evans@in.tum.de>
Wed, 20 Jan 2010 13:18:58 +0000 (13:18 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 20 Jan 2010 13:18:58 +0000 (13:18 +0000)
src/transport/Makefile.am
src/transport/plugin_transport_udp.c
src/transport/test_plugin_transport_udp.c
src/transport/test_transport_api.c

index 7d1f89a6e7501789c29e47f68ed66eb758e6051c..8d5ea59dd5a3b823e92846cdb76cd0bf7efa86b4 100644 (file)
@@ -78,19 +78,25 @@ libgnunet_plugin_transport_udp_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
 check_PROGRAMS = \
- test_transport_api \
+ test_transport_api_tcp \
+ test_transport_api_udp \
  test_plugin_transport \
  test_plugin_transport_udp
 # TODO: add tests for tcp, udp, http, nat, etc.
 
 TESTS = $(check_PROGRAMS)
 
-test_transport_api_SOURCES = \
+test_transport_api_tcp_SOURCES = \
  test_transport_api.c
-test_transport_api_LDADD = \
+test_transport_api_tcp_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/util/libgnunetutil.la  
 
+test_transport_api_udp_SOURCES = \
+ test_transport_api.c
+test_transport_api_udp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/util/libgnunetutil.la  
 
 test_plugin_transport_SOURCES = \
  test_plugin_transport.c
index d3c2bac85cb5af9224944acf400b73c5993b7c3e..d88f1d209138592a6c87a902cd35246df11bb839 100644 (file)
@@ -175,9 +175,7 @@ struct Plugin
 
 /**
  * Message used to ask a peer to validate receipt (to check an address
- * from a HELLO).  Followed by the address used.  Note that the
- * recipients response does not affirm that he has this address,
- * only that he got the challenge message.
+ * from a HELLO).
  */
 struct UDPPingMessage
 {
@@ -192,22 +190,16 @@ struct UDPPingMessage
    */
   uint32_t challenge GNUNET_PACKED;
 
-
-
 };
 
 
 /**
- * Message used to validate a HELLO.  The challenge is included in the
- * confirmation to make matching of replies to requests possible.  The
- * signature signs the original challenge number, our public key, the
- * sender's address (so that the sender can check that the address we
- * saw is plausible for him and possibly detect a MiM attack) and a
- * timestamp (to limit replay).<p>
+ * Message used to validate a HELLO.  The challenge number
+ * is sent along with whatever address the peer received
+ * the ping from.  Used to validate our address (or at
+ * least give us a better idea where we look like we're
+ * coming from).
  *
- * This message is followed by the address of the
- * client that we are observing (which is part of what
- * is being signed).
  */
 struct UDPPongMessage
 {
@@ -499,12 +491,10 @@ udp_plugin_select (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
       buf = GNUNET_malloc (buflen);
       fromlen = sizeof (addr);
-
 #if DEBUG_UDP
       GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, "udp", _
                        ("src_addr_len is %u\n"), fromlen);
 #endif
-
       memset (&addr, 0, fromlen);
       ret =
         GNUNET_NETWORK_socket_recvfrom (udp_sock, buf, buflen,
@@ -521,7 +511,6 @@ udp_plugin_select (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
           GNUNET_free (buf);
           return;
         }
-
       msg = (struct UDPMessage *) buf;
 
 #if DEBUG_UDP
index c8122e2e20110886656f9e67f5bde9313b5e3d0e..bb75126bbace23ea65099d5c686540d2042f7234 100644 (file)
@@ -244,8 +244,6 @@ setup_plugin_environment ()
   env.max_connections = max_connect_per_transport;
 }
 
-static int retx;
-
 /**
  * Runs the test.
  *
index a5afc5fe437c67fa6416c5c348245aa8312e64db..817077f5849be7cd8e1a0b9c44aeb2a2b6f439b1 100644 (file)
@@ -62,6 +62,10 @@ static struct GNUNET_SCHEDULER_Handle *sched;
 
 static int ok;
 
+static int is_tcp;
+
+static int is_udp;
+
 #if VERBOSE
 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
 #else
@@ -283,6 +287,16 @@ main (int argc, char *argv[])
 {
   int ret;
 
+  if (strstr(argv[0], "test_transport_api_tcp") == 0)
+    {
+      is_tcp = GNUNET_YES;
+    }
+  else if (strstr(argv[0], "test_transport_api_udp") == 0)
+    {
+      is_udp = GNUNET_NO;
+    }
+
+
   GNUNET_log_setup ("test-transport-api",
 #if VERBOSE
                     "DEBUG",