aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2019-07-10 18:28:33 +0200
committert3sserakt <t3ss@posteo.de>2019-07-10 18:28:33 +0200
commit49c5ab46eb8f1718446b90e81b89d2e709739c89 (patch)
tree418d6bba12a754b1ddd65f46021804e5cd58d87d
parent67d5962e8540589e7e712c122c313a92dd86b4e7 (diff)
downloadgnunet-49c5ab46eb8f1718446b90e81b89d2e709739c89.tar.gz
gnunet-49c5ab46eb8f1718446b90e81b89d2e709739c89.zip
fixed broken api calls in test; fixed broken protocol
-rw-r--r--src/cadet/gnunet-cadet-profiler.c7
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c23
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c2
-rw-r--r--src/cadet/test_cadet.c7
-rw-r--r--src/cadet/test_cadet_local_mq.c1
5 files changed, 28 insertions, 12 deletions
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index 920d8d830..2de17dc9e 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -912,19 +912,18 @@ select_random_peer (struct CadetPeer *peer)
912static void 912static void
913start_test (void *cls) 913start_test (void *cls)
914{ 914{
915 enum GNUNET_CADET_ChannelOption flags;
916 unsigned long i; 915 unsigned long i;
917 916
918 test_task = NULL; 917 test_task = NULL;
919 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Start profiler\n"); 918 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Start profiler\n");
920 919
921 flags = GNUNET_CADET_OPTION_DEFAULT; 920
922 for (i = 0; i < peers_pinging; i++) 921 for (i = 0; i < peers_pinging; i++)
923 { 922 {
924 peers[i].dest = select_random_peer (&peers[i]); 923 peers[i].dest = select_random_peer (&peers[i]);
925 peers[i].ch = GNUNET_CADET_channel_create (peers[i].cadet, NULL, 924 peers[i].ch = GNUNET_CADET_channel_create (peers[i].cadet, NULL,
926 &peers[i].dest->id, 925 &peers[i].dest->id,
927 GC_u2h (1), flags); 926 GC_u2h (1));
928 if (NULL == peers[i].ch) 927 if (NULL == peers[i].ch)
929 { 928 {
930 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Channel %lu failed\n", i); 929 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Channel %lu failed\n", i);
@@ -969,7 +968,7 @@ warmup (void)
969 i, get_index (peer)); 968 i, get_index (peer));
970 peers[i].warmup_ch = 969 peers[i].warmup_ch =
971 GNUNET_CADET_channel_create (peers[i].cadet, NULL, &peer->id, 970 GNUNET_CADET_channel_create (peers[i].cadet, NULL, &peer->id,
972 GC_u2h (1), GNUNET_CADET_OPTION_DEFAULT); 971 GC_u2h (1));
973 if (NULL == peers[i].warmup_ch) 972 if (NULL == peers[i].warmup_ch)
974 { 973 {
975 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Warmup %u failed\n", i); 974 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Warmup %u failed\n", i);
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 6e3f6ee5e..847a217c7 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -355,6 +355,21 @@ struct CadetChannel
355 unsigned int skip_ack_series; 355 unsigned int skip_ack_series;
356 356
357 /** 357 /**
358 * Is the tunnel bufferless (minimum latency)?
359 */
360 int nobuffer;
361
362 /**
363 * Is the tunnel reliable?
364 */
365 int reliable;
366
367 /**
368 * Is the tunnel out-of-order?
369 */
370 int out_of_order;
371
372 /**
358 * Is this channel a loopback channel, where the destination is us again? 373 * Is this channel a loopback channel, where the destination is us again?
359 */ 374 */
360 int is_loopback; 375 int is_loopback;
@@ -583,6 +598,8 @@ send_channel_open (void *cls)
583 GCCH_2s (ch)); 598 GCCH_2s (ch));
584 msgcc.header.size = htons (sizeof (msgcc)); 599 msgcc.header.size = htons (sizeof (msgcc));
585 msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN); 600 msgcc.header.type = htons (GNUNET_MESSAGE_TYPE_CADET_CHANNEL_OPEN);
601 //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.
602 msgcc.opt = GNUNET_MQ_PREF_RELIABLE >> 10;
586 msgcc.h_port = ch->h_port; 603 msgcc.h_port = ch->h_port;
587 msgcc.ctn = ch->ctn; 604 msgcc.ctn = ch->ctn;
588 ch->state = CADET_CHANNEL_OPEN_SENT; 605 ch->state = CADET_CHANNEL_OPEN_SENT;
@@ -646,6 +663,9 @@ GCCH_channel_local_new (struct CadetClient *owner,
646 663
647 ch = GNUNET_new (struct CadetChannel); 664 ch = GNUNET_new (struct CadetChannel);
648 ch->mid_recv.mid = htonl (1); /* The OPEN_ACK counts as message 0! */ 665 ch->mid_recv.mid = htonl (1); /* The OPEN_ACK counts as message 0! */
666 ch->nobuffer = GNUNET_NO ;
667 ch->reliable = GNUNET_YES;
668 ch->out_of_order = GNUNET_NO ;
649 ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */ 669 ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */
650 ch->owner = ccco; 670 ch->owner = ccco;
651 ch->port = *port; 671 ch->port = *port;
@@ -744,6 +764,9 @@ GCCH_channel_incoming_new (struct CadetTunnel *t,
744 ch->t = t; 764 ch->t = t;
745 ch->ctn = ctn; 765 ch->ctn = ctn;
746 ch->retry_time = CADET_INITIAL_RETRANSMIT_TIME; 766 ch->retry_time = CADET_INITIAL_RETRANSMIT_TIME;
767 ch->nobuffer = GNUNET_NO;
768 ch->reliable = GNUNET_YES;
769 ch->out_of_order = GNUNET_NO;
747 ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */ 770 ch->max_pending_messages = (ch->nobuffer) ? 1 : 4; /* FIXME: 4!? Do not hardcode! */
748 GNUNET_STATISTICS_update (stats, 771 GNUNET_STATISTICS_update (stats,
749 "# channels", 772 "# channels",
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 7b3a0b975..7214dad97 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -630,6 +630,8 @@ send_create (void *cls)
630 env = GNUNET_MQ_msg_extra (create_msg, 630 env = GNUNET_MQ_msg_extra (create_msg,
631 (2 + cc->off) * sizeof (struct GNUNET_PeerIdentity), 631 (2 + cc->off) * sizeof (struct GNUNET_PeerIdentity),
632 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE); 632 GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE);
633 //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.
634 create_msg->options = GNUNET_MQ_PREF_RELIABLE >> 10;
633 create_msg->cid = cc->cid; 635 create_msg->cid = cc->cid;
634 pids = (struct GNUNET_PeerIdentity *) &create_msg[1]; 636 pids = (struct GNUNET_PeerIdentity *) &create_msg[1];
635 pids[0] = my_full_id; 637 pids[0] = my_full_id;
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 72c18cf9c..e87e173be 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -532,7 +532,6 @@ reconnect_op (void *cls)
532 }; 532 };
533 long l = (long) cls; 533 long l = (long) cls;
534 struct CadetTestChannelWrapper *ch; 534 struct CadetTestChannelWrapper *ch;
535 enum GNUNET_CADET_ChannelOption flags;
536 535
537 reconnect_task = NULL; 536 reconnect_task = NULL;
538 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 537 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -543,13 +542,11 @@ reconnect_op (void *cls)
543 GNUNET_CADET_channel_destroy (outgoing_ch); 542 GNUNET_CADET_channel_destroy (outgoing_ch);
544 outgoing_ch = NULL; 543 outgoing_ch = NULL;
545 } 544 }
546 flags = GNUNET_CADET_OPTION_DEFAULT;
547 ch = GNUNET_new (struct CadetTestChannelWrapper); 545 ch = GNUNET_new (struct CadetTestChannelWrapper);
548 outgoing_ch = GNUNET_CADET_channel_create (h1, 546 outgoing_ch = GNUNET_CADET_channel_create (h1,
549 ch, 547 ch,
550 p_id[1], 548 p_id[1],
551 &port, 549 &port,
552 flags,
553 NULL, 550 NULL,
554 &disconnect_handler, 551 &disconnect_handler,
555 handlers); 552 handlers);
@@ -998,7 +995,6 @@ start_test (void *cls)
998 GNUNET_MQ_handler_end () 995 GNUNET_MQ_handler_end ()
999 }; 996 };
1000 struct CadetTestChannelWrapper *ch; 997 struct CadetTestChannelWrapper *ch;
1001 enum GNUNET_CADET_ChannelOption flags;
1002 998
1003 test_task = NULL; 999 test_task = NULL;
1004 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "start_test: %s\n", test_name); 1000 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "start_test: %s\n", test_name);
@@ -1008,11 +1004,9 @@ start_test (void *cls)
1008 disconnect_task = NULL; 1004 disconnect_task = NULL;
1009 } 1005 }
1010 1006
1011 flags = GNUNET_CADET_OPTION_DEFAULT;
1012 if (SPEED_REL == test) 1007 if (SPEED_REL == test)
1013 { 1008 {
1014 test = SPEED; 1009 test = SPEED;
1015 flags |= GNUNET_CADET_OPTION_RELIABLE;
1016 } 1010 }
1017 1011
1018 ch = GNUNET_new (struct CadetTestChannelWrapper); 1012 ch = GNUNET_new (struct CadetTestChannelWrapper);
@@ -1020,7 +1014,6 @@ start_test (void *cls)
1020 ch, 1014 ch,
1021 p_id[1], 1015 p_id[1],
1022 &port, 1016 &port,
1023 flags,
1024 NULL, 1017 NULL,
1025 &disconnect_handler, 1018 &disconnect_handler,
1026 handlers); 1019 handlers);
diff --git a/src/cadet/test_cadet_local_mq.c b/src/cadet/test_cadet_local_mq.c
index fc5561044..b2fed5bd6 100644
--- a/src/cadet/test_cadet_local_mq.c
+++ b/src/cadet/test_cadet_local_mq.c
@@ -243,7 +243,6 @@ do_connect (void *cls)
243 NULL, /* channel cls */ 243 NULL, /* channel cls */
244 &id, /* destination */ 244 &id, /* destination */
245 GC_u2h (TEST_MESSAGE_TYPE), /* port */ 245 GC_u2h (TEST_MESSAGE_TYPE), /* port */
246 GNUNET_CADET_OPTION_DEFAULT, /* opt */
247 NULL, /* window change */ 246 NULL, /* window change */
248 &disconnected, /* disconnect handler */ 247 &disconnected, /* disconnect handler */
249 handlers /* traffic handlers */ 248 handlers /* traffic handlers */