diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-12-12 18:34:20 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-12-12 18:34:20 +0000 |
commit | 87263f90e084d704fbc37021acf83c2da3e14d3f (patch) | |
tree | fbe09e9ec63a8bf0e3a5dd54ec869c80eb3f17d3 /src | |
parent | 99bb85aa82dd850fa54634937be7ed331b91696f (diff) | |
download | gnunet-87263f90e084d704fbc37021acf83c2da3e14d3f.tar.gz gnunet-87263f90e084d704fbc37021acf83c2da3e14d3f.zip |
- dont GNUNET_break on non-validable paths, DHT seems to routinely be aware of core connections faster than MESH
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 24 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 3 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index ff5f2fd3e..d6e8d054f 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -1149,9 +1149,9 @@ register_neighbors (struct MeshConnection *c) | |||
1149 | || GNUNET_NO == GMP_is_neighbor (prev_peer)) | 1149 | || GNUNET_NO == GMP_is_neighbor (prev_peer)) |
1150 | { | 1150 | { |
1151 | if (GMC_is_origin (c, GNUNET_YES)) | 1151 | if (GMC_is_origin (c, GNUNET_YES)) |
1152 | GNUNET_break (0); | 1152 | GNUNET_STATISTICS_update (stats, "# local bad paths", 1, GNUNET_NO); |
1153 | else | 1153 | GNUNET_STATISTICS_update (stats, "# bad paths", 1, GNUNET_NO); |
1154 | GNUNET_break_op (0); | 1154 | |
1155 | LOG (GNUNET_ERROR_TYPE_DEBUG, " register neighbors failed\n"); | 1155 | LOG (GNUNET_ERROR_TYPE_DEBUG, " register neighbors failed\n"); |
1156 | LOG (GNUNET_ERROR_TYPE_DEBUG, " prev: %s, %d\n", | 1156 | LOG (GNUNET_ERROR_TYPE_DEBUG, " prev: %s, %d\n", |
1157 | GMP_2s (prev_peer), GMP_is_neighbor (prev_peer)); | 1157 | GMP_2s (prev_peer), GMP_is_neighbor (prev_peer)); |
@@ -1178,11 +1178,12 @@ unregister_neighbors (struct MeshConnection *c) | |||
1178 | struct MeshPeer *peer; | 1178 | struct MeshPeer *peer; |
1179 | 1179 | ||
1180 | peer = get_next_hop (c); | 1180 | peer = get_next_hop (c); |
1181 | GMP_remove_connection (peer, c); | 1181 | if (GNUNET_OK != GMP_remove_connection (peer, c)) |
1182 | GNUNET_break (MESH_CONNECTION_NEW == c->state); | ||
1182 | 1183 | ||
1183 | peer = get_prev_hop (c); | 1184 | peer = get_prev_hop (c); |
1184 | GMP_remove_connection (peer, c); | 1185 | if (GNUNET_OK != GMP_remove_connection (peer, c)) |
1185 | 1186 | GNUNET_break (MESH_CONNECTION_NEW == c->state); | |
1186 | } | 1187 | } |
1187 | 1188 | ||
1188 | 1189 | ||
@@ -2220,17 +2221,18 @@ GMC_new (const struct GNUNET_HashCode *cid, | |||
2220 | c->own_pos = own_pos; | 2221 | c->own_pos = own_pos; |
2221 | c->path = p; | 2222 | c->path = p; |
2222 | 2223 | ||
2224 | if (GNUNET_OK != register_neighbors (c)) | ||
2225 | { | ||
2226 | GMC_destroy (c); | ||
2227 | return NULL; | ||
2228 | } | ||
2229 | |||
2223 | if (0 == own_pos) | 2230 | if (0 == own_pos) |
2224 | { | 2231 | { |
2225 | c->fwd_maintenance_task = | 2232 | c->fwd_maintenance_task = |
2226 | GNUNET_SCHEDULER_add_delayed (create_connection_time, | 2233 | GNUNET_SCHEDULER_add_delayed (create_connection_time, |
2227 | &connection_fwd_keepalive, c); | 2234 | &connection_fwd_keepalive, c); |
2228 | } | 2235 | } |
2229 | if (GNUNET_OK != register_neighbors (c)) | ||
2230 | { | ||
2231 | GMC_destroy (c); | ||
2232 | return NULL; | ||
2233 | } | ||
2234 | 2236 | ||
2235 | return c; | 2237 | return c; |
2236 | } | 2238 | } |
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index d347af130..40fe6d374 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -1608,8 +1608,7 @@ GMP_remove_connection (struct MeshPeer *peer, | |||
1608 | { | 1608 | { |
1609 | if (NULL == peer || NULL == peer->connections) | 1609 | if (NULL == peer || NULL == peer->connections) |
1610 | { | 1610 | { |
1611 | GNUNET_break (0); | 1611 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1612 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1613 | "Peer %s is not a neighbor!\n", | 1612 | "Peer %s is not a neighbor!\n", |
1614 | GMP_2s (peer)); | 1613 | GMP_2s (peer)); |
1615 | return GNUNET_SYSERR; | 1614 | return GNUNET_SYSERR; |