aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-10-02 03:37:36 +0000
committerBart Polot <bart@net.in.tum.de>2015-10-02 03:37:36 +0000
commit7623d38d88761a1d0755ec8bd4c8571cdea4ef64 (patch)
treed280bd4e1c48b3ec0eff9b5fe1c9d85d5df127b6 /src/cadet
parente1363dfe350cd166cf6ecaef63f46db3737e958b (diff)
downloadgnunet-7623d38d88761a1d0755ec8bd4c8571cdea4ef64.tar.gz
gnunet-7623d38d88761a1d0755ec8bd4c8571cdea4ef64.zip
- never invalidate direct paths, show warning instead
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index b07f9911e..b82c788e9 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -2961,11 +2961,11 @@ GCC_new (const struct GNUNET_CADET_Hash *cid,
2961 unsigned int own_pos) 2961 unsigned int own_pos)
2962{ 2962{
2963 struct CadetConnection *c; 2963 struct CadetConnection *c;
2964 struct CadetPeerPath *p; 2964 struct CadetPeerPath *cpath;
2965 2965
2966 GCC_check_connections (); 2966 GCC_check_connections ();
2967 p = path_duplicate (path); 2967 cpath = path_duplicate (path);
2968 GNUNET_assert (NULL != p); 2968 GNUNET_assert (NULL != cpath);
2969 c = GNUNET_new (struct CadetConnection); 2969 c = GNUNET_new (struct CadetConnection);
2970 c->id = *cid; 2970 c->id = *cid;
2971 GNUNET_assert (GNUNET_OK == 2971 GNUNET_assert (GNUNET_OK ==
@@ -2978,10 +2978,10 @@ GCC_new (const struct GNUNET_CADET_Hash *cid,
2978 c->bck_fc.c = c; 2978 c->bck_fc.c = c;
2979 2979
2980 c->t = t; 2980 c->t = t;
2981 GNUNET_assert (own_pos <= p->length - 1); 2981 GNUNET_assert (own_pos <= cpath->length - 1);
2982 c->own_pos = own_pos; 2982 c->own_pos = own_pos;
2983 c->path = p; 2983 c->path = cpath;
2984 p->c = c; 2984 cpath->c = c;
2985 if (GNUNET_OK != register_neighbors (c)) 2985 if (GNUNET_OK != register_neighbors (c))
2986 { 2986 {
2987 if (0 == own_pos) 2987 if (0 == own_pos)
@@ -2990,7 +2990,13 @@ GCC_new (const struct GNUNET_CADET_Hash *cid,
2990 * info about the paths to reach the destination. We must invalidate 2990 * info about the paths to reach the destination. We must invalidate
2991 * the *original* path to avoid trying it again in the next minute. 2991 * the *original* path to avoid trying it again in the next minute.
2992 */ 2992 */
2993 path_invalidate (path); 2993 if (2 < path->length)
2994 path_invalidate (path);
2995 else
2996 {
2997 GNUNET_break (0);
2998 GCT_debug(t, GNUNET_ERROR_TYPE_WARNING);
2999 }
2994 c->t = NULL; 3000 c->t = NULL;
2995 } 3001 }
2996 path_destroy (c->path); 3002 path_destroy (c->path);