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, 12 insertions, 12 deletions
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c index 80d020111..f4eb73778 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.c +++ b/src/testbed/gnunet-service-testbed_connectionpool.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-testbed_connectionpool.c | 22 | * @file testbed/gnunet-service-testbed_connectionpool.c |
23 | * @brief connection pooling for connections to peers' services | 23 | * @brief connection pooling for connections to peers' services |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "gnunet-service-testbed.h" | 27 | #include "gnunet-service-testbed.h" |
@@ -268,7 +268,7 @@ destroy_pooled_connection (struct PooledConnection *entry) | |||
268 | if (entry->in_lru) | 268 | if (entry->in_lru) |
269 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); | 269 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); |
270 | if (entry->in_pool) | 270 | if (entry->in_pool) |
271 | GNUNET_assert (GNUNET_OK == | 271 | GNUNET_assert (GNUNET_OK == |
272 | GNUNET_CONTAINER_multihashmap32_remove (map, | 272 | GNUNET_CONTAINER_multihashmap32_remove (map, |
273 | entry->index, | 273 | entry->index, |
274 | entry)); | 274 | entry)); |
@@ -466,7 +466,7 @@ transport_peer_connect_notify_cb (void *cls, | |||
466 | const struct GNUNET_PeerIdentity *peer) | 466 | const struct GNUNET_PeerIdentity *peer) |
467 | { | 467 | { |
468 | struct PooledConnection *entry = cls; | 468 | struct PooledConnection *entry = cls; |
469 | 469 | ||
470 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_TRANSPORT); | 470 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_TRANSPORT); |
471 | } | 471 | } |
472 | 472 | ||
@@ -532,7 +532,7 @@ static void | |||
532 | core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | 532 | core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) |
533 | { | 533 | { |
534 | struct PooledConnection *entry = cls; | 534 | struct PooledConnection *entry = cls; |
535 | 535 | ||
536 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_CORE); | 536 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_CORE); |
537 | } | 537 | } |
538 | 538 | ||
@@ -550,7 +550,7 @@ core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
550 | * @param my_identity ID of this peer, NULL if we failed | 550 | * @param my_identity ID of this peer, NULL if we failed |
551 | */ | 551 | */ |
552 | static void | 552 | static void |
553 | core_startup_cb (void *cls, | 553 | core_startup_cb (void *cls, |
554 | const struct GNUNET_PeerIdentity *my_identity) | 554 | const struct GNUNET_PeerIdentity *my_identity) |
555 | { | 555 | { |
556 | struct PooledConnection *entry = cls; | 556 | struct PooledConnection *entry = cls; |
@@ -642,9 +642,9 @@ cleanup_iterator (void *cls, | |||
642 | void *value) | 642 | void *value) |
643 | { | 643 | { |
644 | struct PooledConnection *entry = value; | 644 | struct PooledConnection *entry = value; |
645 | 645 | ||
646 | GNUNET_assert (NULL != entry); | 646 | GNUNET_assert (NULL != entry); |
647 | GNUNET_assert (GNUNET_OK == | 647 | GNUNET_assert (GNUNET_OK == |
648 | GNUNET_CONTAINER_multihashmap32_remove (map, key, entry)); | 648 | GNUNET_CONTAINER_multihashmap32_remove (map, key, entry)); |
649 | if (entry->in_lru) | 649 | if (entry->in_lru) |
650 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); | 650 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); |
@@ -678,7 +678,7 @@ void | |||
678 | GST_connection_pool_destroy () | 678 | GST_connection_pool_destroy () |
679 | { | 679 | { |
680 | struct PooledConnection *entry; | 680 | struct PooledConnection *entry; |
681 | 681 | ||
682 | if (NULL != map) | 682 | if (NULL != map) |
683 | { | 683 | { |
684 | GNUNET_assert (GNUNET_SYSERR != | 684 | GNUNET_assert (GNUNET_SYSERR != |
@@ -776,7 +776,7 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
776 | { | 776 | { |
777 | entry = GNUNET_new (struct PooledConnection); | 777 | entry = GNUNET_new (struct PooledConnection); |
778 | entry->index = peer_id32; | 778 | entry->index = peer_id32; |
779 | if ((NULL != map) | 779 | if ((NULL != map) |
780 | && (GNUNET_CONTAINER_multihashmap32_size (map) < max_size)) | 780 | && (GNUNET_CONTAINER_multihashmap32_size (map) < max_size)) |
781 | { | 781 | { |
782 | GNUNET_assert (GNUNET_OK == | 782 | GNUNET_assert (GNUNET_OK == |
@@ -859,7 +859,7 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh) | |||
859 | GNUNET_CONTAINER_DLL_remove (entry->head_notify, entry->head_notify, gh); | 859 | GNUNET_CONTAINER_DLL_remove (entry->head_notify, entry->head_notify, gh); |
860 | GNUNET_free (gh); | 860 | GNUNET_free (gh); |
861 | gh = NULL; | 861 | gh = NULL; |
862 | GNUNET_assert (!entry->in_lru); | 862 | GNUNET_assert (!entry->in_lru); |
863 | if ( (!entry->in_pool) && (NULL != map) ) | 863 | if ( (!entry->in_pool) && (NULL != map) ) |
864 | { | 864 | { |
865 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (map, | 865 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (map, |
@@ -871,8 +871,8 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh) | |||
871 | destroy_pooled_connection (head_lru); | 871 | destroy_pooled_connection (head_lru); |
872 | GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry); | 872 | GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry); |
873 | GNUNET_assert (GNUNET_OK == | 873 | GNUNET_assert (GNUNET_OK == |
874 | GNUNET_CONTAINER_multihashmap32_put (map, | 874 | GNUNET_CONTAINER_multihashmap32_put (map, |
875 | entry->index, | 875 | entry->index, |
876 | entry, | 876 | entry, |
877 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 877 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
878 | entry->in_pool = GNUNET_YES; | 878 | entry->in_pool = GNUNET_YES; |