diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-11-27 05:08:55 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-11-27 05:08:55 +0000 |
commit | 4826fe4d5b69e0db9313e06a2a00179a998fb6e7 (patch) | |
tree | 5c3d9fb91b2c3f496a8d0a901bd035f393024ae8 /src | |
parent | 4da6aff43125e2550cb79c24847ec46238a8967d (diff) | |
download | gnunet-4826fe4d5b69e0db9313e06a2a00179a998fb6e7.tar.gz gnunet-4826fe4d5b69e0db9313e06a2a00179a998fb6e7.zip |
- fix consensus profiler test (multiple channels reusing same tunnel/session)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 4 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_peer.c | 5 | ||||
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 15 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 35502f8c7..e33a9e23b 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -2270,7 +2270,9 @@ GMC_get_id (const struct MeshConnection *c) | |||
2270 | const struct MeshPeerPath * | 2270 | const struct MeshPeerPath * |
2271 | GMC_get_path (const struct MeshConnection *c) | 2271 | GMC_get_path (const struct MeshConnection *c) |
2272 | { | 2272 | { |
2273 | return c->path; | 2273 | if (GNUNET_NO == c->destroy) |
2274 | return c->path; | ||
2275 | return NULL; | ||
2274 | } | 2276 | } |
2275 | 2277 | ||
2276 | 2278 | ||
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 1679e2e66..967bd1712 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -1336,6 +1336,11 @@ GMP_connect (struct MeshPeer *peer) | |||
1336 | return; | 1336 | return; |
1337 | } | 1337 | } |
1338 | } | 1338 | } |
1339 | else | ||
1340 | { | ||
1341 | LOG (GNUNET_ERROR_TYPE_DEBUG, "but is NULL!!\n"); | ||
1342 | GNUNET_break (0); | ||
1343 | } | ||
1339 | } | 1344 | } |
1340 | 1345 | ||
1341 | if (NULL != peer->search_h && GNUNET_YES == rerun_search) | 1346 | if (NULL != peer->search_h && GNUNET_YES == rerun_search) |
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 0d589acf4..eaf21dbf0 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -1642,6 +1642,12 @@ GMT_add_channel (struct MeshTunnel3 *t, struct MeshChannel *ch) | |||
1642 | aux->ch = ch; | 1642 | aux->ch = ch; |
1643 | LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head); | 1643 | LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head); |
1644 | GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux); | 1644 | GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux); |
1645 | |||
1646 | if (GNUNET_YES == t->destroy) | ||
1647 | { | ||
1648 | t->destroy = GNUNET_NO; | ||
1649 | LOG (GNUNET_ERROR_TYPE_DEBUG, " undo destroy!\n"); | ||
1650 | } | ||
1645 | } | 1651 | } |
1646 | 1652 | ||
1647 | 1653 | ||
@@ -2274,6 +2280,7 @@ GMT_get_path_cost (const struct MeshTunnel3 *t, | |||
2274 | const struct MeshPeerPath *path) | 2280 | const struct MeshPeerPath *path) |
2275 | { | 2281 | { |
2276 | struct MeshTConnection *iter; | 2282 | struct MeshTConnection *iter; |
2283 | const struct MeshPeerPath *aux; | ||
2277 | unsigned int overlap; | 2284 | unsigned int overlap; |
2278 | unsigned int i; | 2285 | unsigned int i; |
2279 | unsigned int j; | 2286 | unsigned int j; |
@@ -2288,9 +2295,13 @@ GMT_get_path_cost (const struct MeshTunnel3 *t, | |||
2288 | { | 2295 | { |
2289 | for (iter = t->connection_head; NULL != iter; iter = iter->next) | 2296 | for (iter = t->connection_head; NULL != iter; iter = iter->next) |
2290 | { | 2297 | { |
2291 | for (j = 0; j < GMC_get_path (iter->c)->length; j++) | 2298 | aux = GMC_get_path (iter->c); |
2299 | if (NULL == aux) | ||
2300 | continue; | ||
2301 | |||
2302 | for (j = 0; j < aux->length; j++) | ||
2292 | { | 2303 | { |
2293 | if (path->peers[i] == GMC_get_path (iter->c)->peers[j]) | 2304 | if (path->peers[i] == aux->peers[j]) |
2294 | { | 2305 | { |
2295 | overlap++; | 2306 | overlap++; |
2296 | break; | 2307 | break; |