aboutsummaryrefslogtreecommitdiff
path: root/src/arm/arm_monitor_api.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-04-01 16:38:03 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-04-01 16:38:03 +0000
commit122dbcd5b6ac9e0b855cb01f873b62ad35ca39ae (patch)
treef91ef6c88f0215875662cf477b148b2a1da36e35 /src/arm/arm_monitor_api.c
parente4470b481f70375bdc0f7fe2fdce7e7c831b496b (diff)
downloadgnunet-122dbcd5b6ac9e0b855cb01f873b62ad35ca39ae.tar.gz
gnunet-122dbcd5b6ac9e0b855cb01f873b62ad35ca39ae.zip
- allow disconnecting from ARM from callbacks
Diffstat (limited to 'src/arm/arm_monitor_api.c')
-rw-r--r--src/arm/arm_monitor_api.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c
index 685f1c334..7fa53e732 100644
--- a/src/arm/arm_monitor_api.c
+++ b/src/arm/arm_monitor_api.c
@@ -268,7 +268,6 @@ GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
268 268
269/** 269/**
270 * Disconnect from the ARM service (if connected) and destroy the context. 270 * Disconnect from the ARM service (if connected) and destroy the context.
271 * Don't call inside a callback!
272 * 271 *
273 * @param h the handle that was being used 272 * @param h the handle that was being used
274 */ 273 */
@@ -345,15 +344,15 @@ monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
345 "Received response from ARM for service `%s': %u\n", 344 "Received response from ARM for service `%s': %u\n",
346 (const char *) &res[1], ntohs (msg->type)); 345 (const char *) &res[1], ntohs (msg->type));
347 status = (enum GNUNET_ARM_ServiceStatus) ntohl (res->status); 346 status = (enum GNUNET_ARM_ServiceStatus) ntohl (res->status);
348 if ((NULL != h->service_status)) 347 GNUNET_CLIENT_receive (h->monitor, &monitor_notify_handler, h,
348 GNUNET_TIME_UNIT_FOREVER_REL);
349 if (NULL != h->service_status)
349 h->service_status (h->cls, h, (const char *) &res[1], status); 350 h->service_status (h->cls, h, (const char *) &res[1], status);
350 break; 351 break;
351 default: 352 default:
352 reconnect_arm_monitor_later (h); 353 reconnect_arm_monitor_later (h);
353 return; 354 return;
354 } 355 }
355 GNUNET_CLIENT_receive (h->monitor, &monitor_notify_handler, h,
356 GNUNET_TIME_UNIT_FOREVER_REL);
357} 356}
358 357
359 358