diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-10-15 00:55:48 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-10-15 00:55:48 +0000 |
commit | 4fe86c4025743f94b7a476fb9f190ae78ef04848 (patch) | |
tree | bb82275373553beb842b6c292f54b59fcd6e048e /src/cadet | |
parent | f6bee073dc77a8953e1523564e781197256b21cf (diff) | |
download | gnunet-4fe86c4025743f94b7a476fb9f190ae78ef04848.tar.gz gnunet-4fe86c4025743f94b7a476fb9f190ae78ef04848.zip |
- fix assertion during single-connection timeout, update docs
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.c | 13 | ||||
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.h | 4 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 812b3d380..94f16b0db 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c | |||
@@ -1404,6 +1404,7 @@ connection_get_first_message (struct CadetPeer *peer, struct CadetConnection *c) | |||
1404 | * @param peer Neighboring peer. | 1404 | * @param peer Neighboring peer. |
1405 | * @param c Connection. | 1405 | * @param c Connection. |
1406 | * @param destroyed[in/out] Was the connection destroyed (prev/as a result)?. | 1406 | * @param destroyed[in/out] Was the connection destroyed (prev/as a result)?. |
1407 | * Can NOT be NULL. | ||
1407 | * | 1408 | * |
1408 | * @return First message for this connection. | 1409 | * @return First message for this connection. |
1409 | */ | 1410 | */ |
@@ -1417,10 +1418,10 @@ GCP_connection_pop (struct CadetPeer *peer, | |||
1417 | struct GNUNET_MessageHeader *msg; | 1418 | struct GNUNET_MessageHeader *msg; |
1418 | int dest; | 1419 | int dest; |
1419 | 1420 | ||
1421 | GNUNET_assert (NULL != destroyed); | ||
1420 | LOG (GNUNET_ERROR_TYPE_DEBUG, "connection_pop on connection %p\n", c); | 1422 | LOG (GNUNET_ERROR_TYPE_DEBUG, "connection_pop on connection %p\n", c); |
1421 | for (q = peer->queue_head; NULL != q; q = next) | 1423 | for (q = peer->queue_head; NULL != q; q = next) |
1422 | { | 1424 | { |
1423 | GNUNET_break (NULL == destroyed || GNUNET_NO == *destroyed); | ||
1424 | next = q->next; | 1425 | next = q->next; |
1425 | if (q->c != c) | 1426 | if (q->c != c) |
1426 | continue; | 1427 | continue; |
@@ -1436,16 +1437,22 @@ GCP_connection_pop (struct CadetPeer *peer, | |||
1436 | case GNUNET_MESSAGE_TYPE_CADET_ACK: | 1437 | case GNUNET_MESSAGE_TYPE_CADET_ACK: |
1437 | case GNUNET_MESSAGE_TYPE_CADET_POLL: | 1438 | case GNUNET_MESSAGE_TYPE_CADET_POLL: |
1438 | dest = GCP_queue_destroy (q, GNUNET_YES, GNUNET_NO, 0); | 1439 | dest = GCP_queue_destroy (q, GNUNET_YES, GNUNET_NO, 0); |
1439 | if (NULL != destroyed && GNUNET_YES == dest) | 1440 | if (GNUNET_YES == dest) |
1441 | { | ||
1442 | GNUNET_break (GNUNET_NO == *destroyed); | ||
1440 | *destroyed = GNUNET_YES; | 1443 | *destroyed = GNUNET_YES; |
1444 | } | ||
1441 | continue; | 1445 | continue; |
1442 | 1446 | ||
1443 | case GNUNET_MESSAGE_TYPE_CADET_KX: | 1447 | case GNUNET_MESSAGE_TYPE_CADET_KX: |
1444 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED: | 1448 | case GNUNET_MESSAGE_TYPE_CADET_ENCRYPTED: |
1445 | msg = (struct GNUNET_MessageHeader *) q->cls; | 1449 | msg = (struct GNUNET_MessageHeader *) q->cls; |
1446 | dest = GCP_queue_destroy (q, GNUNET_NO, GNUNET_NO, 0); | 1450 | dest = GCP_queue_destroy (q, GNUNET_NO, GNUNET_NO, 0); |
1447 | if (NULL != destroyed && GNUNET_YES == dest) | 1451 | if (GNUNET_YES == dest) |
1452 | { | ||
1453 | GNUNET_break (GNUNET_NO == *destroyed); | ||
1448 | *destroyed = GNUNET_YES; | 1454 | *destroyed = GNUNET_YES; |
1455 | } | ||
1449 | return msg; | 1456 | return msg; |
1450 | 1457 | ||
1451 | default: | 1458 | default: |
diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h index ea64665d4..20ff5d9c6 100644 --- a/src/cadet/gnunet-service-cadet_peer.h +++ b/src/cadet/gnunet-service-cadet_peer.h | |||
@@ -182,7 +182,9 @@ GCP_queue_cancel (struct CadetPeer *peer, struct CadetConnection *c); | |||
182 | * | 182 | * |
183 | * @param peer Neighboring peer. | 183 | * @param peer Neighboring peer. |
184 | * @param c Connection. | 184 | * @param c Connection. |
185 | * @param destroyed[out] Was the connection destroyed as a result?. | 185 | * @param destroyed[in/out] Was the connection destroyed as a result?. |
186 | * Can NOT be NULL. | ||
187 | * | ||
186 | * | 188 | * |
187 | * @return First message for this connection. | 189 | * @return First message for this connection. |
188 | */ | 190 | */ |