diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-22 16:47:16 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-22 16:47:16 +0000 |
commit | 568ef6e60686cc58bbb6b193fe3789910aceff6e (patch) | |
tree | bd0b08780e7444e1a47827ef7eb34fccd1ef4c6d | |
parent | 3ba1e879fb3565a4ffdcba6866e8abdcbefe8876 (diff) | |
download | gnunet-568ef6e60686cc58bbb6b193fe3789910aceff6e.tar.gz gnunet-568ef6e60686cc58bbb6b193fe3789910aceff6e.zip |
invariant pr->pending_head <> NULL still getting violated
-rw-r--r-- | src/core/core_api.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index f687cd265..696948682 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -1520,13 +1520,21 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, | |||
1520 | 1520 | ||
1521 | /* Order entries by deadline, but SKIP 'HEAD' if | 1521 | /* Order entries by deadline, but SKIP 'HEAD' if |
1522 | we're in the 'ready_peer_*' DLL */ | 1522 | we're in the 'ready_peer_*' DLL */ |
1523 | pos = pr->pending_head; | 1523 | /* FIXME: again, pr->pending_head is NULL after a reconnect_later call */ |
1524 | if ( (pr->prev != NULL) || | 1524 | if (pr->pending_head != NULL) |
1525 | (pr->next != NULL) || | 1525 | { |
1526 | (pr == handle->ready_peer_head) ) | 1526 | pos = pr->pending_head; |
1527 | if ( (pr->prev != NULL) || | ||
1528 | (pr->next != NULL) || | ||
1529 | (pr == handle->ready_peer_head) ) | ||
1530 | { | ||
1531 | GNUNET_assert (pos != NULL); | ||
1532 | pos = pos->next; /* skip head */ | ||
1533 | } | ||
1534 | } | ||
1535 | else | ||
1527 | { | 1536 | { |
1528 | GNUNET_assert (pos != NULL); | 1537 | GNUNET_break(0); |
1529 | pos = pos->next; /* skip head */ | ||
1530 | } | 1538 | } |
1531 | 1539 | ||
1532 | /* insertion sort */ | 1540 | /* insertion sort */ |
@@ -1587,7 +1595,7 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | |||
1587 | (pr == h->ready_peer_head) ) | 1595 | (pr == h->ready_peer_head) ) |
1588 | { | 1596 | { |
1589 | /* the request that was 'approved' by core was | 1597 | /* the request that was 'approved' by core was |
1590 | cancelled before it could be transmitted; remove | 1598 | canceled before it could be transmitted; remove |
1591 | us from the 'ready' list */ | 1599 | us from the 'ready' list */ |
1592 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, | 1600 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, |
1593 | h->ready_peer_tail, | 1601 | h->ready_peer_tail, |