From: xrs Date: Wed, 8 Jan 2020 17:52:39 +0000 (+0100) Subject: add check for being alice and minor fix X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6fbb0b5f62f1376e44d14a2a7e0b9e004b5f1dff;p=oweals%2Fgnunet.git add check for being alice and minor fix --- diff --git a/contrib/build-common b/contrib/build-common index d81bbfabc..1915a74bb 160000 --- a/contrib/build-common +++ b/contrib/build-common @@ -1 +1 @@ -Subproject commit d81bbfabc2538932f631d3946bd6a9b95182b4f2 +Subproject commit 1915a74bbb4cd2ae9bc541a382dfebc37064a2fd diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h index 52c63950d..91c716609 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h @@ -86,6 +86,7 @@ struct GNUNET_CADET_ConnectionCreateMessage /** * Infomation of known tunnel state to keep two peers synced. (xrs,t3ss) + * FIXME: find better var name. */ int tunnel_up; diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index 4b78b1812..de304aed7 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -622,7 +622,12 @@ send_create (void *cls) // check for tunnel state and define tunnel_up (xrs,t3ss) t = GCP_get_tunnel (cc->destination, GNUNET_YES); - create_msg->tunnel_up = GCT_get_estate(t) == CADET_TUNNEL_KEY_UNINITIALIZED ? GNUNET_NO : GNUNET_YES; + if (NULL != t) + { + create_msg->tunnel_up = (GCT_get_estate(t) == CADET_TUNNEL_KEY_UNINITIALIZED) && + (GCT_alice_or_betty (GCP_get_id(cc->destination)) == GNUNET_NO) + ? GNUNET_NO : GNUNET_YES; + } pids = (struct GNUNET_PeerIdentity *) &create_msg[1]; pids[0] = my_full_id; @@ -813,6 +818,7 @@ connection_create (struct CadetPeer *destination, cc = GNUNET_new (struct CadetConnection); cc->state = init_state; cc->ct = ct; + cc->destination = destination; /* xrs,t3ss,lurchi*/ cc->cid = *cid; cc->retry_delay = GNUNET_TIME_relative_multiply (INITIAL_CONNECTION_CREATE_RETRY_DELAY, off); diff --git a/src/cadet/test_cadet.conf b/src/cadet/test_cadet.conf index 30e496aff..d2327b171 100644 --- a/src/cadet/test_cadet.conf +++ b/src/cadet/test_cadet.conf @@ -27,7 +27,8 @@ QUOTA = 1 MB DATABASE = heap [transport] -PLUGINS = udp +#PLUGINS = udp +PLUGINS = tcp NEIGHBOUR_LIMIT = 50 #MANIPULATE_DELAY_IN = 10 ms #MANIPULATE_DELAY_OUT = 10 ms