[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 09/13: fixed broken api calls in test; fixed broke
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 09/13: fixed broken api calls in test; fixed broken protocol |
Date: |
Sun, 21 Jul 2019 20:27:52 +0200 |
This is an automated email from the git hooks/post-receive script.
t3sserakt pushed a commit to branch master
in repository gnunet.
commit 49c5ab46eb8f1718446b90e81b89d2e709739c89
Author: t3sserakt <address@hidden>
AuthorDate: Wed Jul 10 18:28:33 2019 +0200
fixed broken api calls in test; fixed broken protocol
---
src/cadet/gnunet-cadet-profiler.c | 7 +++----
src/cadet/gnunet-service-cadet_channel.c | 23 +++++++++++++++++++++++
src/cadet/gnunet-service-cadet_connection.c | 2 ++
src/cadet/test_cadet.c | 7 -------
src/cadet/test_cadet_local_mq.c | 1 -
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)
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);
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
@@ -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",
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)
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;
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)
};
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);
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)
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 */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnunet] 02/13: Merge branch 'master' into cadet_option, (continued)
- [GNUnet-SVN] [gnunet] 02/13: Merge branch 'master' into cadet_option, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 01/13: removed GNUNET_CADET_ChannelOption, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 03/13: added per message GNUNET_MQ_PriorityPreferences, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 07/13: Merge branch 'cadet_option' of ssh://gnunet.org/gnunet into cadet_option, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 05/13: added per message GNUNET_MQ_PriorityPreferences, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 06/13: removed channel attributes, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 08/13: fixed chanel_get_info, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 10/13: simplify, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 12/13: removed last use of old api, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 04/13: removed GNUNET_CADET_ChannelOption, gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 09/13: fixed broken api calls in test; fixed broken protocol,
gnunet <=
- [GNUnet-SVN] [gnunet] 13/13: Merge branch 'cadet-new-options', gnunet, 2019/07/21
- [GNUnet-SVN] [gnunet] 11/13: remove duplication MQ options, make conversation build, gnunet, 2019/07/21