diff options
author | harsha <harsha@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-31 20:11:04 +0000 |
---|---|---|
committer | harsha <harsha@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-31 20:11:04 +0000 |
commit | 5e010a4de0b2e32f3d0e743dae7231eea571d366 (patch) | |
tree | d4d48de7f8789825d9f795bb720fea1805520dd6 /src/testbed | |
parent | 240880635697556ebedf22ae00e2ccf0cd5564cc (diff) |
- call peer connect notifiy callback only after calling the cache callback
git-svn-id: https://gnunet.org/svn/gnunet@25969 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/testbed')
-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 6a75bbc794..575032e560 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) GNUNET_CONTAINER_DLL_insert_tail (entry->cgh_qhead, entry->cgh_qtail, cgh); if (NULL != cgh2) entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); + if (NULL != cgh->nctxt) + {/* Register the peer connect notify callback */ + GNUNET_CONTAINER_DLL_insert_tail (entry->nctxt_qhead, entry->nctxt_qtail, + cgh->nctxt); + } LOG_DEBUG ("Calling notify for handle type %u\n", cgh->type); cgh->cb (cgh->cb_cls, entry->core_handle, entry->transport_handle_, entry->peer_identity); @@ -658,7 +663,6 @@ cache_get_handle (unsigned int peer_id, GNUNET_assert (NULL == cgh->nctxt); cgh->nctxt = ctxt; ctxt->cgh = cgh; - GNUNET_CONTAINER_DLL_insert_tail (entry->nctxt_qhead, entry->nctxt_qtail, ctxt); } if (NULL != handle) { @@ -780,7 +784,8 @@ GST_cache_get_handle_done (struct GSTCacheGetHandle *cgh) if (NULL != cgh->nctxt) { GNUNET_assert (cgh == cgh->nctxt->cgh); - GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); + if (GNUNET_YES == cgh->notify_called) + GNUNET_CONTAINER_DLL_remove (entry->nctxt_qhead, entry->nctxt_qtail, cgh->nctxt); GNUNET_free (cgh->nctxt); } GNUNET_free (cgh); diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index ddc31e5e28..b7650e932c 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, GNUNET_SCHEDULER_cancel (occ->tcc.task); occ->tcc.task = GNUNET_SCHEDULER_NO_TASK; } - GST_cache_get_handle_done (occ->cgh_ch); - occ->peer->reference_cnt--; - occ->cgh_ch = NULL; GNUNET_free_non_null (occ->emsg); occ->emsg = NULL; send_overlay_connect_success_msg (occ); |