aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r--src/cadet/cadet_api.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index ddd1755cc..43fe3535f 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -78,7 +78,7 @@ struct GNUNET_CADET_TransmitHandle
78 /** 78 /**
79 * Task triggering a timeout, can be NO_TASK if the timeout is FOREVER. 79 * Task triggering a timeout, can be NO_TASK if the timeout is FOREVER.
80 */ 80 */
81 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 81 struct GNUNET_SCHEDULER_Task * timeout_task;
82 82
83 /** 83 /**
84 * Size of 'data' -- or the desired size of 'notify' if 'data' is NULL. 84 * Size of 'data' -- or the desired size of 'notify' if 'data' is NULL.
@@ -210,7 +210,7 @@ struct GNUNET_CADET_Handle
210 /** 210 /**
211 * Task for trying to reconnect. 211 * Task for trying to reconnect.
212 */ 212 */
213 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 213 struct GNUNET_SCHEDULER_Task * reconnect_task;
214 214
215 /** 215 /**
216 * Callback for an info task (only one active at a time). 216 * Callback for an info task (only one active at a time).
@@ -496,7 +496,7 @@ destroy_channel (struct GNUNET_CADET_Channel *ch, int call_cleaner)
496 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th); 496 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
497 497
498 /* clean up request */ 498 /* clean up request */
499 if (GNUNET_SCHEDULER_NO_TASK != th->timeout_task) 499 if (NULL != th->timeout_task)
500 GNUNET_SCHEDULER_cancel (th->timeout_task); 500 GNUNET_SCHEDULER_cancel (th->timeout_task);
501 GNUNET_free (th); 501 GNUNET_free (th);
502 } 502 }
@@ -528,7 +528,7 @@ timeout_transmission (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
528 struct GNUNET_CADET_TransmitHandle *th = cls; 528 struct GNUNET_CADET_TransmitHandle *th = cls;
529 struct GNUNET_CADET_Handle *cadet = th->channel->cadet; 529 struct GNUNET_CADET_Handle *cadet = th->channel->cadet;
530 530
531 th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 531 th->timeout_task = NULL;
532 th->channel->packet_size = 0; 532 th->channel->packet_size = 0;
533 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th); 533 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
534 if (GNUNET_YES == th_is_payload (th)) 534 if (GNUNET_YES == th_is_payload (th))
@@ -711,7 +711,7 @@ reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
711{ 711{
712 struct GNUNET_CADET_Handle *h = cls; 712 struct GNUNET_CADET_Handle *h = cls;
713 713
714 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 714 h->reconnect_task = NULL;
715 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 715 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
716 return; 716 return;
717 do_reconnect (h); 717 do_reconnect (h);
@@ -740,7 +740,7 @@ reconnect (struct GNUNET_CADET_Handle *h)
740 next = ch->next; 740 next = ch->next;
741 destroy_channel (ch, GNUNET_YES); 741 destroy_channel (ch, GNUNET_YES);
742 } 742 }
743 if (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task) 743 if (NULL == h->reconnect_task)
744 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time, 744 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
745 &reconnect_cbk, h); 745 &reconnect_cbk, h);
746} 746}
@@ -1382,7 +1382,7 @@ send_callback (void *cls, size_t size, void *buf)
1382 psize = th->size; 1382 psize = th->size;
1383 } 1383 }
1384 GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize); 1384 GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize);
1385 if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1385 if (th->timeout_task != NULL)
1386 GNUNET_SCHEDULER_cancel (th->timeout_task); 1386 GNUNET_SCHEDULER_cancel (th->timeout_task);
1387 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th); 1387 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
1388 GNUNET_free (th); 1388 GNUNET_free (th);
@@ -1487,7 +1487,7 @@ GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
1487 h->ports = ports; 1487 h->ports = ports;
1488 h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI; 1488 h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
1489 h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS; 1489 h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS;
1490 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1490 h->reconnect_task = NULL;
1491 1491
1492 if (NULL != ports && ports[0] != 0 && NULL == new_channel) 1492 if (NULL != ports && ports[0] != 0 && NULL == new_channel)
1493 { 1493 {
@@ -1576,10 +1576,10 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle)
1576 GNUNET_CLIENT_disconnect (handle->client); 1576 GNUNET_CLIENT_disconnect (handle->client);
1577 handle->client = NULL; 1577 handle->client = NULL;
1578 } 1578 }
1579 if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task) 1579 if (NULL != handle->reconnect_task)
1580 { 1580 {
1581 GNUNET_SCHEDULER_cancel(handle->reconnect_task); 1581 GNUNET_SCHEDULER_cancel(handle->reconnect_task);
1582 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1582 handle->reconnect_task = NULL;
1583 } 1583 }
1584 GNUNET_free (handle); 1584 GNUNET_free (handle);
1585} 1585}
@@ -1761,7 +1761,7 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t
1761 1761
1762 th->channel->packet_size = 0; 1762 th->channel->packet_size = 0;
1763 cadet = th->channel->cadet; 1763 cadet = th->channel->cadet;
1764 if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1764 if (th->timeout_task != NULL)
1765 GNUNET_SCHEDULER_cancel (th->timeout_task); 1765 GNUNET_SCHEDULER_cancel (th->timeout_task);
1766 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th); 1766 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
1767 GNUNET_free (th); 1767 GNUNET_free (th);