diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-31 20:11:04 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-01-31 20:11:04 +0000 |
commit | 4785f9c53cad18c14a20e9341b86b97f1021a574 (patch) | |
tree | d4d48de7f8789825d9f795bb720fea1805520dd6 /src | |
parent | 2d8f5e4d85f96c131948c061d2375efe9e783f87 (diff) | |
download | gnunet-4785f9c53cad18c14a20e9341b86b97f1021a574.tar.gz gnunet-4785f9c53cad18c14a20e9341b86b97f1021a574.zip |
- call peer connect notifiy callback only after calling the cache callback
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/gnunet-service-testbed_hc.c | 9 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_oc.c | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/testbed/gnunet-service-testbed_hc.c b/src/testbed/gnunet-service-testbed_hc.c index 6a75bbc79..575032e56 100644 --- a/src/testbed/gnunet-service-testbed_hc.c +++ b/src/testbed/gnunet-service-testbed_hc.c | |||
@@ -399,6 +399,11 @@ call_cgh_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
399 | GNUNET_CONTAINER_DLL_insert_tail (entry->cgh_qhead, entry->cgh_qtail, cgh); | 399 | GNUNET_CONTAINER_DLL_insert_tail (entry->cgh_qhead, entry->cgh_qtail, cgh); |
400 | if (NULL != cgh2) | 400 | if (NULL != cgh2) |
401 | entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); | 401 | entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); |
402 | if (NULL != cgh->nctxt) | ||
403 | {/* Register the peer connect notify callback */ | ||
404 | GNUNET_CONTAINER_DLL_insert_tail (entry->nctxt_qhead, entry->nctxt_qtail, | ||
405 | cgh->nctxt); | ||
406 | } | ||
402 | LOG_DEBUG ("Calling notify for handle type %u\n", cgh->type); | 407 | LOG_DEBUG ("Calling notify for handle type %u\n", cgh->type); |
403 | cgh->cb (cgh->cb_cls, entry->core_handle, | 408 | cgh->cb (cgh->cb_cls, entry->core_handle, |
404 | entry->transport_handle_, entry->peer_identity); | 409 | entry->transport_handle_, entry->peer_identity); |
@@ -658,7 +663,6 @@ cache_get_handle (unsigned int peer_id, | |||
658 | GNUNET_assert (NULL == cgh->nctxt); | 663 | GNUNET_assert (NULL == cgh->nctxt); |
659 | cgh->nctxt = ctxt; | 664 | cgh->nctxt = ctxt; |
660 | ctxt->cgh = cgh; | 665 | ctxt->cgh = cgh; |
661 | GNUNET_CONTAINER_DLL_insert_tail (entry->nctxt_qhead, entry->nctxt_qtail, ctxt); | ||
662 | } | 666 | } |
663 | if (NULL != handle) | 667 | if (NULL != handle) |
664 | { | 668 | { |
@@ -780,7 +784,8 @@ GST_cache_get_handle_done (struct GSTCacheGetHandle *cgh) | |||
780 | if (NULL != cgh->nctxt) | 784 | if (NULL != cgh->nctxt) |
781 | { | 785 | { |
782 | GNUNET_assert (cgh == cgh->nctxt->cgh); | 786 | GNUNET_assert (cgh == cgh->nctxt->cgh); |
783 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); | 787 | if (GNUNET_YES == cgh->notify_called) |
788 | GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); | ||
784 | GNUNET_free (cgh->nctxt); | 789 | GNUNET_free (cgh->nctxt); |
785 | } | 790 | } |
786 | GNUNET_free (cgh); | 791 | GNUNET_free (cgh); |
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index ddc31e5e2..b7650e932 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -546,9 +546,6 @@ overlay_connect_notify (void *cls, | |||
546 | GNUNET_SCHEDULER_cancel (occ->tcc.task); | 546 | GNUNET_SCHEDULER_cancel (occ->tcc.task); |
547 | occ->tcc.task = GNUNET_SCHEDULER_NO_TASK; | 547 | occ->tcc.task = GNUNET_SCHEDULER_NO_TASK; |
548 | } | 548 | } |
549 | GST_cache_get_handle_done (occ->cgh_ch); | ||
550 | occ->peer->reference_cnt--; | ||
551 | occ->cgh_ch = NULL; | ||
552 | GNUNET_free_non_null (occ->emsg); | 549 | GNUNET_free_non_null (occ->emsg); |
553 | occ->emsg = NULL; | 550 | occ->emsg = NULL; |
554 | send_overlay_connect_success_msg (occ); | 551 | send_overlay_connect_success_msg (occ); |