diff options
Diffstat (limited to 'src/testbed/gnunet-service-testbed_connectionpool.c')
-rw-r--r-- | src/testbed/gnunet-service-testbed_connectionpool.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c index 6d9a27972..51909ae3e 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.c +++ b/src/testbed/gnunet-service-testbed_connectionpool.c | |||
@@ -126,12 +126,12 @@ struct PooledConnection | |||
126 | /** | 126 | /** |
127 | * The task to expire this connection from the connection pool | 127 | * The task to expire this connection from the connection pool |
128 | */ | 128 | */ |
129 | GNUNET_SCHEDULER_TaskIdentifier expire_task; | 129 | struct GNUNET_SCHEDULER_Task * expire_task; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * The task to notify a waiting #GST_ConnectionPool_GetHandle object | 132 | * The task to notify a waiting #GST_ConnectionPool_GetHandle object |
133 | */ | 133 | */ |
134 | GNUNET_SCHEDULER_TaskIdentifier notify_task; | 134 | struct GNUNET_SCHEDULER_Task * notify_task; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * Number of active requests using this pooled connection | 137 | * Number of active requests using this pooled connection |
@@ -286,10 +286,10 @@ destroy_pooled_connection (struct PooledConnection *entry) | |||
286 | GNUNET_CONTAINER_multihashmap32_remove (map, | 286 | GNUNET_CONTAINER_multihashmap32_remove (map, |
287 | entry->index, | 287 | entry->index, |
288 | entry)); | 288 | entry)); |
289 | if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) | 289 | if (NULL != entry->notify_task) |
290 | { | 290 | { |
291 | GNUNET_SCHEDULER_cancel (entry->notify_task); | 291 | GNUNET_SCHEDULER_cancel (entry->notify_task); |
292 | entry->notify_task = GNUNET_SCHEDULER_NO_TASK; | 292 | entry->notify_task = NULL; |
293 | } | 293 | } |
294 | LOG_DEBUG ("Cleaning up handles of a pooled connection\n"); | 294 | LOG_DEBUG ("Cleaning up handles of a pooled connection\n"); |
295 | if (NULL != entry->handle_transport) | 295 | if (NULL != entry->handle_transport) |
@@ -322,7 +322,7 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
322 | { | 322 | { |
323 | struct PooledConnection *entry = cls; | 323 | struct PooledConnection *entry = cls; |
324 | 324 | ||
325 | entry->expire_task = GNUNET_SCHEDULER_NO_TASK; | 325 | entry->expire_task = NULL; |
326 | destroy_pooled_connection (entry); | 326 | destroy_pooled_connection (entry); |
327 | } | 327 | } |
328 | 328 | ||
@@ -335,10 +335,10 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
335 | static void | 335 | static void |
336 | expire_task_cancel (struct PooledConnection *entry) | 336 | expire_task_cancel (struct PooledConnection *entry) |
337 | { | 337 | { |
338 | if (GNUNET_SCHEDULER_NO_TASK != entry->expire_task) | 338 | if (NULL != entry->expire_task) |
339 | { | 339 | { |
340 | GNUNET_SCHEDULER_cancel (entry->expire_task); | 340 | GNUNET_SCHEDULER_cancel (entry->expire_task); |
341 | entry->expire_task = GNUNET_SCHEDULER_NO_TASK; | 341 | entry->expire_task = NULL; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | 344 | ||
@@ -355,7 +355,7 @@ add_to_lru (struct PooledConnection *entry) | |||
355 | GNUNET_assert (!entry->in_lru); | 355 | GNUNET_assert (!entry->in_lru); |
356 | GNUNET_CONTAINER_DLL_insert_tail (head_lru, tail_lru, entry); | 356 | GNUNET_CONTAINER_DLL_insert_tail (head_lru, tail_lru, entry); |
357 | entry->in_lru = GNUNET_YES; | 357 | entry->in_lru = GNUNET_YES; |
358 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == entry->expire_task); | 358 | GNUNET_assert (NULL == entry->expire_task); |
359 | entry->expire_task = GNUNET_SCHEDULER_add_delayed (CACHE_EXPIRY, | 359 | entry->expire_task = GNUNET_SCHEDULER_add_delayed (CACHE_EXPIRY, |
360 | &expire, entry); | 360 | &expire, entry); |
361 | } | 361 | } |
@@ -415,8 +415,8 @@ connection_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
415 | struct GST_ConnectionPool_GetHandle *gh; | 415 | struct GST_ConnectionPool_GetHandle *gh; |
416 | struct GST_ConnectionPool_GetHandle *gh_next; | 416 | struct GST_ConnectionPool_GetHandle *gh_next; |
417 | 417 | ||
418 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != entry->notify_task); | 418 | GNUNET_assert (NULL != entry->notify_task); |
419 | entry->notify_task = GNUNET_SCHEDULER_NO_TASK; | 419 | entry->notify_task = NULL; |
420 | gh = search_waiting (entry, entry->head_waiting); | 420 | gh = search_waiting (entry, entry->head_waiting); |
421 | GNUNET_assert (NULL != gh); | 421 | GNUNET_assert (NULL != gh); |
422 | gh_next = NULL; | 422 | gh_next = NULL; |
@@ -524,7 +524,7 @@ opstart_get_handle_transport (void *cls) | |||
524 | } | 524 | } |
525 | if (0 == entry->demand) | 525 | if (0 == entry->demand) |
526 | return; | 526 | return; |
527 | if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) | 527 | if (NULL != entry->notify_task) |
528 | return; | 528 | return; |
529 | if (NULL != search_waiting (entry, entry->head_waiting)) | 529 | if (NULL != search_waiting (entry, entry->head_waiting)) |
530 | { | 530 | { |
@@ -597,7 +597,7 @@ core_startup_cb (void *cls, | |||
597 | sizeof (struct GNUNET_PeerIdentity)); | 597 | sizeof (struct GNUNET_PeerIdentity)); |
598 | if (0 == entry->demand) | 598 | if (0 == entry->demand) |
599 | return; | 599 | return; |
600 | if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) | 600 | if (NULL != entry->notify_task) |
601 | return; | 601 | return; |
602 | if (NULL != search_waiting (entry, entry->head_waiting)) | 602 | if (NULL != search_waiting (entry, entry->head_waiting)) |
603 | { | 603 | { |
@@ -832,7 +832,7 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
832 | GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh); | 832 | GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh); |
833 | if (NULL != handle) | 833 | if (NULL != handle) |
834 | { | 834 | { |
835 | if (GNUNET_SCHEDULER_NO_TASK == entry->notify_task) | 835 | if (NULL == entry->notify_task) |
836 | { | 836 | { |
837 | if (NULL != search_waiting (entry, entry->head_waiting)) | 837 | if (NULL != search_waiting (entry, entry->head_waiting)) |
838 | entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, entry); | 838 | entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, entry); |
@@ -888,10 +888,10 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh) | |||
888 | { | 888 | { |
889 | GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh); | 889 | GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh); |
890 | if ( (NULL == search_waiting (entry, entry->head_waiting)) | 890 | if ( (NULL == search_waiting (entry, entry->head_waiting)) |
891 | && (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) ) | 891 | && (NULL != entry->notify_task) ) |
892 | { | 892 | { |
893 | GNUNET_SCHEDULER_cancel (entry->notify_task); | 893 | GNUNET_SCHEDULER_cancel (entry->notify_task); |
894 | entry->notify_task = GNUNET_SCHEDULER_NO_TASK; | 894 | entry->notify_task = NULL; |
895 | } | 895 | } |
896 | } | 896 | } |
897 | if (gh->notify_waiting) | 897 | if (gh->notify_waiting) |