fixed broken api calls in test; fixed broken protocol cadet_option_agfu origin/cadet_option_agfu
authort3sserakt <t3ss@posteo.de>
Wed, 10 Jul 2019 16:28:33 +0000 (18:28 +0200)
committert3sserakt <t3ss@posteo.de>
Wed, 10 Jul 2019 16:28:33 +0000 (18:28 +0200)
src/cadet/gnunet-cadet-profiler.c
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_connection.c
src/cadet/test_cadet.c
src/cadet/test_cadet_local_mq.c

index 920d8d830da844e42dbbfd6d551c7bfff6e634a7..2de17dc9e61c7e57940827f597c4f91aa7bd3d31 100644 (file)
@@ -912,19 +912,18 @@ select_random_peer (struct CadetPeer *peer)
 static void
 start_test (void *cls)
 {
-  enum GNUNET_CADET_ChannelOption flags;
   unsigned long i;
 
   test_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Start profiler\n");
 
-  flags = GNUNET_CADET_OPTION_DEFAULT;
+
   for (i = 0; i < peers_pinging; i++)
   {
     peers[i].dest = select_random_peer (&peers[i]);
     peers[i].ch = GNUNET_CADET_channel_create (peers[i].cadet, NULL,
                                                &peers[i].dest->id,
-                                               GC_u2h (1), flags);
+                                               GC_u2h (1));
     if (NULL == peers[i].ch)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Channel %lu failed\n", i);
@@ -969,7 +968,7 @@ warmup (void)
                 i, get_index (peer));
     peers[i].warmup_ch =
       GNUNET_CADET_channel_create (peers[i].cadet, NULL, &peer->id,
-                                  GC_u2h (1), GNUNET_CADET_OPTION_DEFAULT);
+                                  GC_u2h (1));
     if (NULL == peers[i].warmup_ch)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Warmup %u failed\n", i);
index 6e3f6ee5e6d8569e501d55034e78854b5090d94c..847a217c75f06afb027c6d4347a787a3a9b4a10d 100644 (file)
@@ -354,6 +354,21 @@ struct CadetChannel
    */
   unsigned int skip_ack_series;
 
+  /**
+   * Is the tunnel bufferless (minimum latency)?
+   */
+  int nobuffer;
+
+  /**
+   * Is the tunnel reliable?
+   */
+  int reliable;
+
+  /**
+   * Is the tunnel out-of-order?
+   */
+  int out_of_order;
+  
   /**
    * Is this channel a loopback channel, where the destination is us again?
    */
@@ -583,6 +598,8 @@ send_channel_open (void *cls)
        GCCH_2s (ch));
   msgcc.header.size = htons (sizeof (msgcc));
   msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN);
+  //TODO This will be removed in a major release, because this will be a protocol breaking change. We shift here to be compatible with GNUNET_CADET_OPTION_RELIABLE that was removed, and to already use the newly introduced options.
+  msgcc.opt = GNUNET_MQ_PREF_RELIABLE >> 10;
   msgcc.h_port = ch->h_port;
   msgcc.ctn = ch->ctn;
   ch->state = CADET_CHANNEL_OPEN_SENT;
@@ -646,6 +663,9 @@ GCCH_channel_local_new (struct CadetClient *owner,
 
   ch = GNUNET_new (struct CadetChannel);
   ch->mid_recv.mid = htonl (1); /* The OPEN_ACK counts as message 0! */
+  ch->nobuffer = GNUNET_NO ;
+  ch->reliable = GNUNET_YES;
+  ch->out_of_order = GNUNET_NO ;
   ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */
   ch->owner = ccco;
   ch->port = *port;
@@ -744,6 +764,9 @@ GCCH_channel_incoming_new (struct CadetTunnel *t,
   ch->t = t;
   ch->ctn = ctn;
   ch->retry_time = CADET_INITIAL_RETRANSMIT_TIME;
+  ch->nobuffer = GNUNET_NO;
+  ch->reliable = GNUNET_YES;
+  ch->out_of_order = GNUNET_NO;
   ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */
   GNUNET_STATISTICS_update (stats,
                             "# channels",
index 7b3a0b975c5cbe9b8521a7cf3b1c62a21efc00ec..7214dad97915ed18a3b1ec270319423b7e1ef2ec 100644 (file)
@@ -630,6 +630,8 @@ send_create (void *cls)
   env = GNUNET_MQ_msg_extra (create_msg,
                              (2 + cc->off) * sizeof (struct GNUNET_PeerIdentity),
                              GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE);
+  //TODO This will be removed in a major release, because this will be a protocol breaking change. We shift here to be compatible with GNUNET_CADET_OPTION_RELIABLE that was removed, and to already use the newly introduced options.
+  create_msg->options = GNUNET_MQ_PREF_RELIABLE >> 10;
   create_msg->cid = cc->cid;
   pids = (struct GNUNET_PeerIdentity *) &create_msg[1];
   pids[0] = my_full_id;
index 72c18cf9ce6e2276db39533de0dfc0218bea668c..e87e173be9454d0b4b8ee1d39070c1cccd6848a1 100644 (file)
@@ -532,7 +532,6 @@ reconnect_op (void *cls)
   };
   long l = (long) cls;
   struct CadetTestChannelWrapper *ch;
-  enum GNUNET_CADET_ChannelOption flags;
 
   reconnect_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -543,13 +542,11 @@ reconnect_op (void *cls)
     GNUNET_CADET_channel_destroy (outgoing_ch);
     outgoing_ch = NULL;
   }
-  flags = GNUNET_CADET_OPTION_DEFAULT;
   ch = GNUNET_new (struct CadetTestChannelWrapper);
   outgoing_ch = GNUNET_CADET_channel_create (h1,
                                              ch,
                                              p_id[1],
                                              &port,
-                                             flags,
                                              NULL,
                                              &disconnect_handler,
                                              handlers);
@@ -998,7 +995,6 @@ start_test (void *cls)
     GNUNET_MQ_handler_end ()
   };
   struct CadetTestChannelWrapper *ch;
-  enum GNUNET_CADET_ChannelOption flags;
 
   test_task = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "start_test: %s\n", test_name);
@@ -1008,11 +1004,9 @@ start_test (void *cls)
     disconnect_task = NULL;
   }
 
-  flags = GNUNET_CADET_OPTION_DEFAULT;
   if (SPEED_REL == test)
   {
     test = SPEED;
-    flags |= GNUNET_CADET_OPTION_RELIABLE;
   }
 
   ch = GNUNET_new (struct CadetTestChannelWrapper);
@@ -1020,7 +1014,6 @@ start_test (void *cls)
                                              ch,
                                              p_id[1],
                                              &port,
-                                             flags,
                                              NULL,
                                              &disconnect_handler,
                                              handlers);
index fc55610446c07516d2e09c63c674fec2f868538a..b2fed5bd63ed866147d6833ddc1a7ebb009e9b44 100644 (file)
@@ -243,7 +243,6 @@ do_connect (void *cls)
                                     NULL,         /* channel cls */
                                     &id,          /* destination */
                                     GC_u2h (TEST_MESSAGE_TYPE), /* port */
-                                    GNUNET_CADET_OPTION_DEFAULT, /* opt */
                                     NULL,          /* window change */
                                     &disconnected, /* disconnect handler */
                                     handlers       /* traffic handlers */