- if (ntohs (msg->size) ==
- sizeof (struct GNUNET_ARM_ResultMessage))
- {
- rmsg = (const struct GNUNET_ARM_ResultMessage*) msg;
- shutdown_ctx->confirmed = (enum GNUNET_ARM_ProcessStatus) ntohl (rmsg->status);
- if (shutdown_ctx->confirmed != GNUNET_ARM_PROCESS_SHUTDOWN)
- {
- /* ARM is not shutting down, well, report the error and be done with it... */
- shutdown_ctx->cont (shutdown_ctx->cont_cls, shutdown_ctx->confirmed);
- GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
- GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
- GNUNET_free (shutdown_ctx);
- return;
- }
- }
- GNUNET_CLIENT_receive (shutdown_ctx->sock, &service_shutdown_handler,
- shutdown_ctx, GNUNET_TIME_UNIT_FOREVER_REL);
+ if (NULL != shutdown_ctx->cont)
+ /* shutdown is now complete, as we waited for the network disconnect... */
+ shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_ARM_PROCESS_DOWN);
+ GNUNET_SCHEDULER_cancel (shutdown_ctx->cancel_task);
+ GNUNET_CLIENT_disconnect (shutdown_ctx->sock);
+ GNUNET_free (shutdown_ctx);