aboutsummaryrefslogtreecommitdiff
path: root/src/arm/arm_monitor_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/arm_monitor_api.c')
-rw-r--r--src/arm/arm_monitor_api.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c
index 676543f26..c03f5df0f 100644
--- a/src/arm/arm_monitor_api.c
+++ b/src/arm/arm_monitor_api.c
@@ -57,7 +57,7 @@ struct GNUNET_ARM_MonitorHandle
57 /** 57 /**
58 * ID of the reconnect task (if any). 58 * ID of the reconnect task (if any).
59 */ 59 */
60 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 60 struct GNUNET_SCHEDULER_Task * reconnect_task;
61 61
62 /** 62 /**
63 * Current delay we use for re-trying to connect to core. 63 * Current delay we use for re-trying to connect to core.
@@ -82,7 +82,7 @@ struct GNUNET_ARM_MonitorHandle
82 /** 82 /**
83 * ID of a task to run if we fail to get a reply to the init message in time. 83 * ID of a task to run if we fail to get a reply to the init message in time.
84 */ 84 */
85 GNUNET_SCHEDULER_TaskIdentifier init_timeout_task_id; 85 struct GNUNET_SCHEDULER_Task * init_timeout_task_id;
86}; 86};
87 87
88static void 88static void
@@ -102,7 +102,7 @@ reconnect_arm_monitor_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext
102{ 102{
103 struct GNUNET_ARM_MonitorHandle *h = cls; 103 struct GNUNET_ARM_MonitorHandle *h = cls;
104 104
105 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 105 h->reconnect_task = NULL;
106 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n"); 106 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n");
107 reconnect_arm_monitor (h); 107 reconnect_arm_monitor (h);
108} 108}
@@ -129,13 +129,13 @@ reconnect_arm_monitor_later (struct GNUNET_ARM_MonitorHandle *h)
129 h->monitor = NULL; 129 h->monitor = NULL;
130 } 130 }
131 131
132 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 132 if (NULL != h->init_timeout_task_id)
133 { 133 {
134 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 134 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
135 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 135 h->init_timeout_task_id = NULL;
136 } 136 }
137 137
138 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 138 GNUNET_assert (NULL == h->reconnect_task);
139 h->reconnect_task = 139 h->reconnect_task =
140 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_monitor_task, h); 140 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_monitor_task, h);
141 141
@@ -156,7 +156,7 @@ init_timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
156 LOG (GNUNET_ERROR_TYPE_DEBUG, 156 LOG (GNUNET_ERROR_TYPE_DEBUG,
157 "Init message timed out\n"); 157 "Init message timed out\n");
158 158
159 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 159 h->init_timeout_task_id = NULL;
160 reconnect_arm_monitor_later (h); 160 reconnect_arm_monitor_later (h);
161} 161}
162 162
@@ -176,8 +176,8 @@ transmit_monitoring_init_message (void *cls, size_t size, void *buf)
176 struct GNUNET_MessageHeader *msg; 176 struct GNUNET_MessageHeader *msg;
177 uint16_t msize; 177 uint16_t msize;
178 178
179 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 179 GNUNET_assert (NULL == h->reconnect_task);
180 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->init_timeout_task_id); 180 GNUNET_assert (NULL == h->init_timeout_task_id);
181 h->cth = NULL; 181 h->cth = NULL;
182 if (NULL == buf) 182 if (NULL == buf)
183 { 183 {
@@ -254,8 +254,8 @@ GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
254 h = GNUNET_new (struct GNUNET_ARM_MonitorHandle); 254 h = GNUNET_new (struct GNUNET_ARM_MonitorHandle);
255 h->cfg = GNUNET_CONFIGURATION_dup (cfg); 255 h->cfg = GNUNET_CONFIGURATION_dup (cfg);
256 h->currently_down = GNUNET_YES; 256 h->currently_down = GNUNET_YES;
257 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 257 h->reconnect_task = NULL;
258 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 258 h->init_timeout_task_id = NULL;
259 h->service_status = cont; 259 h->service_status = cont;
260 h->cls = cont_cls; 260 h->cls = cont_cls;
261 if (GNUNET_OK != reconnect_arm_monitor (h)) 261 if (GNUNET_OK != reconnect_arm_monitor (h))
@@ -281,20 +281,20 @@ GNUNET_ARM_monitor_disconnect_and_free (struct GNUNET_ARM_MonitorHandle *h)
281 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); 281 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
282 h->cth = NULL; 282 h->cth = NULL;
283 } 283 }
284 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 284 if (NULL != h->init_timeout_task_id)
285 { 285 {
286 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 286 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
287 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 287 h->init_timeout_task_id = NULL;
288 } 288 }
289 if (NULL != h->monitor) 289 if (NULL != h->monitor)
290 { 290 {
291 GNUNET_CLIENT_disconnect (h->monitor); 291 GNUNET_CLIENT_disconnect (h->monitor);
292 h->monitor = NULL; 292 h->monitor = NULL;
293 } 293 }
294 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 294 if (NULL != h->reconnect_task)
295 { 295 {
296 GNUNET_SCHEDULER_cancel (h->reconnect_task); 296 GNUNET_SCHEDULER_cancel (h->reconnect_task);
297 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 297 h->reconnect_task = NULL;
298 } 298 }
299 GNUNET_CONFIGURATION_destroy (h->cfg); 299 GNUNET_CONFIGURATION_destroy (h->cfg);
300 GNUNET_free (h); 300 GNUNET_free (h);
@@ -335,10 +335,10 @@ monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
335 reconnect_arm_monitor_later (h); 335 reconnect_arm_monitor_later (h);
336 return; 336 return;
337 } 337 }
338 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 338 if (NULL != h->init_timeout_task_id)
339 { 339 {
340 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 340 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
341 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 341 h->init_timeout_task_id = NULL;
342 } 342 }
343 res = (const struct GNUNET_ARM_StatusMessage *) msg; 343 res = (const struct GNUNET_ARM_StatusMessage *) msg;
344 LOG (GNUNET_ERROR_TYPE_DEBUG, 344 LOG (GNUNET_ERROR_TYPE_DEBUG,