diff options
Diffstat (limited to 'src/arm/mockup-service.c')
-rw-r--r-- | src/arm/mockup-service.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/arm/mockup-service.c b/src/arm/mockup-service.c index 6f90956db..d9896997b 100644 --- a/src/arm/mockup-service.c +++ b/src/arm/mockup-service.c | |||
@@ -29,30 +29,6 @@ | |||
29 | #include "gnunet_time_lib.h" | 29 | #include "gnunet_time_lib.h" |
30 | 30 | ||
31 | 31 | ||
32 | static size_t | ||
33 | transmit_shutdown_ack (void *cls, size_t size, void *buf) | ||
34 | { | ||
35 | struct GNUNET_SERVER_Client *client = cls; | ||
36 | struct GNUNET_MessageHeader *msg; | ||
37 | |||
38 | if (size < sizeof (struct GNUNET_MessageHeader)) | ||
39 | { | ||
40 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
41 | _("Failed to transmit shutdown ACK.\n")); | ||
42 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | ||
43 | return 0; /* client disconnected */ | ||
44 | } | ||
45 | |||
46 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Transmitting shutdown ACK.\n")); | ||
47 | |||
48 | msg = (struct GNUNET_MessageHeader *) buf; | ||
49 | msg->type = htons (GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN); | ||
50 | msg->size = htons (sizeof (struct GNUNET_MessageHeader)); | ||
51 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
52 | GNUNET_SERVER_client_drop (client); | ||
53 | return sizeof (struct GNUNET_MessageHeader); | ||
54 | } | ||
55 | |||
56 | /** | 32 | /** |
57 | * Handler for SHUTDOWN message. | 33 | * Handler for SHUTDOWN message. |
58 | * | 34 | * |
@@ -64,14 +40,8 @@ static void | |||
64 | handle_shutdown (void *cls, struct GNUNET_SERVER_Client *client, | 40 | handle_shutdown (void *cls, struct GNUNET_SERVER_Client *client, |
65 | const struct GNUNET_MessageHeader *message) | 41 | const struct GNUNET_MessageHeader *message) |
66 | { | 42 | { |
67 | GNUNET_SERVER_client_keep (client); | ||
68 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 43 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
69 | _("Initiating shutdown as requested by client.\n")); | 44 | _("Initiating shutdown as requested by client.\n")); |
70 | |||
71 | GNUNET_SERVER_notify_transmit_ready (client, | ||
72 | sizeof (struct GNUNET_MessageHeader), | ||
73 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
74 | &transmit_shutdown_ack, client); | ||
75 | GNUNET_SERVER_client_persist_ (client); | 45 | GNUNET_SERVER_client_persist_ (client); |
76 | GNUNET_SCHEDULER_shutdown (); | 46 | GNUNET_SCHEDULER_shutdown (); |
77 | } | 47 | } |