diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed_connectionpool.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_connectionpool.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c index 1067bc00e..0f65edf15 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.c +++ b/src/testbed/gnunet-service-testbed_connectionpool.c | |||
@@ -568,12 +568,12 @@ core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
568 | 568 | ||
569 | 569 | ||
570 | /** | 570 | /** |
571 | * Function called after GNUNET_CORE_connect has succeeded (or failed | 571 | * Function called after #GNUNET_CORE_connect() has succeeded (or failed |
572 | * for good). Note that the private key of the peer is intentionally | 572 | * for good). Note that the private key of the peer is intentionally |
573 | * not exposed here; if you need it, your process should try to read | 573 | * not exposed here; if you need it, your process should try to read |
574 | * the private key file directly (which should work if you are | 574 | * the private key file directly (which should work if you are |
575 | * authorized...). Implementations of this function must not call | 575 | * authorized...). Implementations of this function must not call |
576 | * GNUNET_CORE_disconnect (other than by scheduling a new task to | 576 | * #GNUNET_CORE_disconnect() (other than by scheduling a new task to |
577 | * do this later). | 577 | * do this later). |
578 | * | 578 | * |
579 | * @param cls the #PooledConnection object | 579 | * @param cls the #PooledConnection object |
@@ -816,7 +816,9 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
816 | } | 816 | } |
817 | else | 817 | else |
818 | { | 818 | { |
819 | GNUNET_CONTAINER_DLL_insert_tail (head_not_pooled, tail_not_pooled, entry); | 819 | GNUNET_CONTAINER_DLL_insert_tail (head_not_pooled, |
820 | tail_not_pooled, | ||
821 | entry); | ||
820 | } | 822 | } |
821 | entry->cfg = GNUNET_CONFIGURATION_dup (cfg); | 823 | entry->cfg = GNUNET_CONFIGURATION_dup (cfg); |
822 | } | 824 | } |
@@ -829,13 +831,16 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
829 | gh->connect_notify_cb = connect_notify_cb; | 831 | gh->connect_notify_cb = connect_notify_cb; |
830 | gh->connect_notify_cb_cls = connect_notify_cb_cls; | 832 | gh->connect_notify_cb_cls = connect_notify_cb_cls; |
831 | gh->service = service; | 833 | gh->service = service; |
832 | GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh); | 834 | GNUNET_CONTAINER_DLL_insert (entry->head_waiting, |
835 | entry->tail_waiting, | ||
836 | gh); | ||
833 | if (NULL != handle) | 837 | if (NULL != handle) |
834 | { | 838 | { |
835 | if (NULL == entry->notify_task) | 839 | if (NULL == entry->notify_task) |
836 | { | 840 | { |
837 | if (NULL != search_waiting (entry, entry->head_waiting)) | 841 | if (NULL != search_waiting (entry, entry->head_waiting)) |
838 | entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, entry); | 842 | entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, |
843 | entry); | ||
839 | } | 844 | } |
840 | return gh; | 845 | return gh; |
841 | } | 846 | } |
@@ -845,19 +850,22 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
845 | case GST_CONNECTIONPOOL_SERVICE_TRANSPORT: | 850 | case GST_CONNECTIONPOOL_SERVICE_TRANSPORT: |
846 | if (NULL != entry->op_transport) | 851 | if (NULL != entry->op_transport) |
847 | return gh; /* Operation pending */ | 852 | return gh; /* Operation pending */ |
848 | op = GNUNET_TESTBED_operation_create_ (entry, &opstart_get_handle_transport, | 853 | op = GNUNET_TESTBED_operation_create_ (entry, |
854 | &opstart_get_handle_transport, | ||
849 | &oprelease_get_handle_transport); | 855 | &oprelease_get_handle_transport); |
850 | entry->op_transport = op; | 856 | entry->op_transport = op; |
851 | break; | 857 | break; |
852 | case GST_CONNECTIONPOOL_SERVICE_CORE: | 858 | case GST_CONNECTIONPOOL_SERVICE_CORE: |
853 | if (NULL != entry->op_core) | 859 | if (NULL != entry->op_core) |
854 | return gh; /* Operation pending */ | 860 | return gh; /* Operation pending */ |
855 | op = GNUNET_TESTBED_operation_create_ (entry, &opstart_get_handle_core, | 861 | op = GNUNET_TESTBED_operation_create_ (entry, |
862 | &opstart_get_handle_core, | ||
856 | &oprelease_get_handle_core); | 863 | &oprelease_get_handle_core); |
857 | entry->op_core = op; | 864 | entry->op_core = op; |
858 | break; | 865 | break; |
859 | } | 866 | } |
860 | GNUNET_TESTBED_operation_queue_insert_ (GST_opq_openfds, op); | 867 | GNUNET_TESTBED_operation_queue_insert_ (GST_opq_openfds, |
868 | op); | ||
861 | GNUNET_TESTBED_operation_begin_wait_ (op); | 869 | GNUNET_TESTBED_operation_begin_wait_ (op); |
862 | return gh; | 870 | return gh; |
863 | } | 871 | } |