diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-20 15:28:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-20 15:28:33 +0000 |
commit | 2d2584e78b01b66e45fe10952ecebb6e9ef9d451 (patch) | |
tree | 5b1570e018ac62c68dd92534b340cee827ea726a /src/core | |
parent | 0469599af8e76018141e33e75f5b9fcf1eabfbee (diff) | |
download | gnunet-2d2584e78b01b66e45fe10952ecebb6e9ef9d451.tar.gz gnunet-2d2584e78b01b66e45fe10952ecebb6e9ef9d451.zip |
possible fix
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_api.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 802ba56d4..abb7fbc63 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -468,8 +468,11 @@ reconnect_later (struct GNUNET_CORE_Handle *h) | |||
468 | { | 468 | { |
469 | GNUNET_CONTAINER_DLL_remove (h->pending_head, | 469 | GNUNET_CONTAINER_DLL_remove (h->pending_head, |
470 | h->pending_tail, | 470 | h->pending_tail, |
471 | cm); | 471 | cm); |
472 | cm->cont (cm->cont_cls, NULL); | 472 | if (cm->th != NULL) |
473 | cm->th->cm = NULL; | ||
474 | if (cm->cont != NULL) | ||
475 | cm->cont (cm->cont_cls, NULL); | ||
473 | GNUNET_free (cm); | 476 | GNUNET_free (cm); |
474 | } | 477 | } |
475 | if (h->client != NULL) | 478 | if (h->client != NULL) |
@@ -517,22 +520,6 @@ transmission_timeout (void *cls, | |||
517 | 520 | ||
518 | 521 | ||
519 | /** | 522 | /** |
520 | * Control message was sent, mark it as such. | ||
521 | * | ||
522 | * @param cls the 'struct GNUNET_CORE_TransmitHandle*' | ||
523 | * @param tc scheduler context | ||
524 | */ | ||
525 | static void | ||
526 | mark_control_message_sent (void *cls, | ||
527 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
528 | { | ||
529 | struct GNUNET_CORE_TransmitHandle *th = cls; | ||
530 | |||
531 | th->cm = NULL; | ||
532 | } | ||
533 | |||
534 | |||
535 | /** | ||
536 | * Send a control message to the peer asking for transmission | 523 | * Send a control message to the peer asking for transmission |
537 | * of the message in the given peer record. | 524 | * of the message in the given peer record. |
538 | * | 525 | * |
@@ -563,8 +550,6 @@ request_next_transmission (struct PeerRecord *pr) | |||
563 | pr); | 550 | pr); |
564 | cm = GNUNET_malloc (sizeof (struct ControlMessage) + | 551 | cm = GNUNET_malloc (sizeof (struct ControlMessage) + |
565 | sizeof (struct SendMessageRequest)); | 552 | sizeof (struct SendMessageRequest)); |
566 | cm->cont = &mark_control_message_sent; | ||
567 | cm->cont_cls = th; | ||
568 | th->cm = cm; | 553 | th->cm = cm; |
569 | cm->th = th; | 554 | cm->th = th; |
570 | smr = (struct SendMessageRequest*) &cm[1]; | 555 | smr = (struct SendMessageRequest*) &cm[1]; |
@@ -1415,7 +1400,8 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) | |||
1415 | cm); | 1400 | cm); |
1416 | if (cm->th != NULL) | 1401 | if (cm->th != NULL) |
1417 | cm->th->cm = NULL; | 1402 | cm->th->cm = NULL; |
1418 | cm->cont (cm->cont_cls, NULL); | 1403 | if (cm->cont != NULL) |
1404 | cm->cont (cm->cont_cls, NULL); | ||
1419 | GNUNET_free (cm); | 1405 | GNUNET_free (cm); |
1420 | } | 1406 | } |
1421 | GNUNET_CONTAINER_multihashmap_iterate (handle->peers, | 1407 | GNUNET_CONTAINER_multihashmap_iterate (handle->peers, |