aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r--src/core/core_api.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index d2a8b5651..1d287bbc6 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -130,12 +130,12 @@ struct PeerRecord
130 * ID of timeout task for the 'pending_head' handle 130 * ID of timeout task for the 'pending_head' handle
131 * which is the one with the smallest timeout. 131 * which is the one with the smallest timeout.
132 */ 132 */
133 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 133 struct GNUNET_SCHEDULER_Task * timeout_task;
134 134
135 /** 135 /**
136 * ID of task to run 'next_request_transmission'. 136 * ID of task to run 'next_request_transmission'.
137 */ 137 */
138 GNUNET_SCHEDULER_TaskIdentifier ntr_task; 138 struct GNUNET_SCHEDULER_Task * ntr_task;
139 139
140 /** 140 /**
141 * SendMessageRequest ID generator for this peer. 141 * SendMessageRequest ID generator for this peer.
@@ -289,7 +289,7 @@ struct GNUNET_CORE_Handle
289 /** 289 /**
290 * ID of reconnect task (if any). 290 * ID of reconnect task (if any).
291 */ 291 */
292 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 292 struct GNUNET_SCHEDULER_Task * reconnect_task;
293 293
294 /** 294 /**
295 * Current delay we use for re-trying to connect to core. 295 * Current delay we use for re-trying to connect to core.
@@ -344,7 +344,7 @@ reconnect_task (void *cls,
344{ 344{
345 struct GNUNET_CORE_Handle *h = cls; 345 struct GNUNET_CORE_Handle *h = cls;
346 346
347 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 347 h->reconnect_task = NULL;
348 LOG (GNUNET_ERROR_TYPE_DEBUG, 348 LOG (GNUNET_ERROR_TYPE_DEBUG,
349 "Connecting to CORE service after delay\n"); 349 "Connecting to CORE service after delay\n");
350 reconnect (h); 350 reconnect (h);
@@ -369,15 +369,15 @@ disconnect_and_free_peer_entry (void *cls,
369 struct GNUNET_CORE_TransmitHandle *th; 369 struct GNUNET_CORE_TransmitHandle *th;
370 struct PeerRecord *pr = value; 370 struct PeerRecord *pr = value;
371 371
372 if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task) 372 if (NULL != pr->timeout_task)
373 { 373 {
374 GNUNET_SCHEDULER_cancel (pr->timeout_task); 374 GNUNET_SCHEDULER_cancel (pr->timeout_task);
375 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 375 pr->timeout_task = NULL;
376 } 376 }
377 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 377 if (NULL != pr->ntr_task)
378 { 378 {
379 GNUNET_SCHEDULER_cancel (pr->ntr_task); 379 GNUNET_SCHEDULER_cancel (pr->ntr_task);
380 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 380 pr->ntr_task = NULL;
381 } 381 }
382 if ( (NULL != pr->prev) || 382 if ( (NULL != pr->prev) ||
383 (NULL != pr->next) || 383 (NULL != pr->next) ||
@@ -401,8 +401,8 @@ disconnect_and_free_peer_entry (void *cls,
401 GNUNET_assert (GNUNET_YES == 401 GNUNET_assert (GNUNET_YES ==
402 GNUNET_CONTAINER_multipeermap_remove (h->peers, key, pr)); 402 GNUNET_CONTAINER_multipeermap_remove (h->peers, key, pr));
403 GNUNET_assert (pr->ch == h); 403 GNUNET_assert (pr->ch == h);
404 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->timeout_task); 404 GNUNET_assert (NULL == pr->timeout_task);
405 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task); 405 GNUNET_assert (NULL == pr->ntr_task);
406 GNUNET_free (pr); 406 GNUNET_free (pr);
407 return GNUNET_YES; 407 return GNUNET_YES;
408} 408}
@@ -420,7 +420,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
420 struct ControlMessage *cm; 420 struct ControlMessage *cm;
421 struct PeerRecord *pr; 421 struct PeerRecord *pr;
422 422
423 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 423 GNUNET_assert (NULL == h->reconnect_task);
424 if (NULL != h->cth) 424 if (NULL != h->cth)
425 { 425 {
426 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); 426 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -432,7 +432,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
432 h->client = NULL; 432 h->client = NULL;
433 } 433 }
434 h->currently_down = GNUNET_YES; 434 h->currently_down = GNUNET_YES;
435 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 435 GNUNET_assert (h->reconnect_task == NULL);
436 h->reconnect_task = 436 h->reconnect_task =
437 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, 437 GNUNET_SCHEDULER_add_delayed (h->retry_backoff,
438 &reconnect_task, h); 438 &reconnect_task, h);
@@ -496,10 +496,10 @@ request_next_transmission (struct PeerRecord *pr)
496 struct SendMessageRequest *smr; 496 struct SendMessageRequest *smr;
497 struct GNUNET_CORE_TransmitHandle *th; 497 struct GNUNET_CORE_TransmitHandle *th;
498 498
499 if (pr->timeout_task != GNUNET_SCHEDULER_NO_TASK) 499 if (pr->timeout_task != NULL)
500 { 500 {
501 GNUNET_SCHEDULER_cancel (pr->timeout_task); 501 GNUNET_SCHEDULER_cancel (pr->timeout_task);
502 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 502 pr->timeout_task = NULL;
503 } 503 }
504 th = &pr->th; 504 th = &pr->th;
505 if (NULL == th->peer) 505 if (NULL == th->peer)
@@ -552,11 +552,11 @@ transmission_timeout (void *cls,
552 struct GNUNET_CORE_Handle *h = pr->ch; 552 struct GNUNET_CORE_Handle *h = pr->ch;
553 struct GNUNET_CORE_TransmitHandle *th; 553 struct GNUNET_CORE_TransmitHandle *th;
554 554
555 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 555 pr->timeout_task = NULL;
556 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 556 if (NULL != pr->ntr_task)
557 { 557 {
558 GNUNET_SCHEDULER_cancel (pr->ntr_task); 558 GNUNET_SCHEDULER_cancel (pr->ntr_task);
559 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 559 pr->ntr_task = NULL;
560 } 560 }
561 th = &pr->th; 561 th = &pr->th;
562 th->peer = NULL; 562 th->peer = NULL;
@@ -609,7 +609,7 @@ transmit_message (void *cls,
609 uint16_t msize; 609 uint16_t msize;
610 size_t ret; 610 size_t ret;
611 611
612 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 612 GNUNET_assert (h->reconnect_task == NULL);
613 h->cth = NULL; 613 h->cth = NULL;
614 if (NULL == buf) 614 if (NULL == buf)
615 { 615 {
@@ -657,10 +657,10 @@ transmit_message (void *cls,
657 h->ready_peer_tail, 657 h->ready_peer_tail,
658 pr); 658 pr);
659 th->peer = NULL; 659 th->peer = NULL;
660 if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task) 660 if (NULL != pr->timeout_task)
661 { 661 {
662 GNUNET_SCHEDULER_cancel (pr->timeout_task); 662 GNUNET_SCHEDULER_cancel (pr->timeout_task);
663 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 663 pr->timeout_task = NULL;
664 } 664 }
665 LOG (GNUNET_ERROR_TYPE_DEBUG, 665 LOG (GNUNET_ERROR_TYPE_DEBUG,
666 "Transmitting SEND request to `%s' with %u bytes.\n", 666 "Transmitting SEND request to `%s' with %u bytes.\n",
@@ -1083,7 +1083,7 @@ init_done_task (void *cls, int success)
1083 { 1083 {
1084 LOG (GNUNET_ERROR_TYPE_DEBUG, 1084 LOG (GNUNET_ERROR_TYPE_DEBUG,
1085 "Failed to exchange INIT with core, retrying\n"); 1085 "Failed to exchange INIT with core, retrying\n");
1086 if (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK) 1086 if (h->reconnect_task == NULL)
1087 reconnect_later (h); 1087 reconnect_later (h);
1088 return; 1088 return;
1089 } 1089 }
@@ -1259,10 +1259,10 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
1259 GNUNET_CONTAINER_multipeermap_iterate (handle->peers, 1259 GNUNET_CONTAINER_multipeermap_iterate (handle->peers,
1260 &disconnect_and_free_peer_entry, 1260 &disconnect_and_free_peer_entry,
1261 handle); 1261 handle);
1262 if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 1262 if (handle->reconnect_task != NULL)
1263 { 1263 {
1264 GNUNET_SCHEDULER_cancel (handle->reconnect_task); 1264 GNUNET_SCHEDULER_cancel (handle->reconnect_task);
1265 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1265 handle->reconnect_task = NULL;
1266 } 1266 }
1267 GNUNET_CONTAINER_multipeermap_destroy (handle->peers); 1267 GNUNET_CONTAINER_multipeermap_destroy (handle->peers);
1268 handle->peers = NULL; 1268 handle->peers = NULL;
@@ -1283,7 +1283,7 @@ run_request_next_transmission (void *cls,
1283{ 1283{
1284 struct PeerRecord *pr = cls; 1284 struct PeerRecord *pr = cls;
1285 1285
1286 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 1286 pr->ntr_task = NULL;
1287 request_next_transmission (pr); 1287 request_next_transmission (pr);
1288} 1288}
1289 1289
@@ -1361,7 +1361,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
1361 th->priority = priority; 1361 th->priority = priority;
1362 th->msize = notify_size; 1362 th->msize = notify_size;
1363 th->cork = cork; 1363 th->cork = cork;
1364 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task); 1364 GNUNET_assert (NULL == pr->ntr_task);
1365 pr->ntr_task = 1365 pr->ntr_task =
1366 GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr); 1366 GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr);
1367 LOG (GNUNET_ERROR_TYPE_DEBUG, 1367 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1409,10 +1409,10 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle *th)
1409 h->ready_peer_tail, 1409 h->ready_peer_tail,
1410 pr); 1410 pr);
1411 } 1411 }
1412 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 1412 if (NULL != pr->ntr_task)
1413 { 1413 {
1414 GNUNET_SCHEDULER_cancel (pr->ntr_task); 1414 GNUNET_SCHEDULER_cancel (pr->ntr_task);
1415 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 1415 pr->ntr_task = NULL;
1416 } 1416 }
1417} 1417}
1418 1418