From 8fad7df6fb06c75b999d11605015e2471cc98006 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20B=C3=BCnger?= Date: Thu, 1 Sep 2016 17:30:00 +0000 Subject: [PATCH] -fix rps service: handler for check_live message --- src/rps/gnunet-service-rps.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 4858d0555..302e0d39b 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c @@ -1186,6 +1186,26 @@ handle_client_seed (void *cls, GNUNET_OK); } +/** + * Handle a CHECK_LIVE message from another peer. + * + * This does nothing. But without calling #GNUNET_CADET_receive_done() + * the channel is blocked for all other communication. + * + * @param cls Closure + * @param channel The channel the CHECK was received over + * @param channel_ctx The context associated with this channel + * @param msg The message header + */ +static int +handle_peer_check (void *cls, + struct GNUNET_CADET_Channel *channel, + void **channel_ctx, + const struct GNUNET_MessageHeader *msg) +{ + GNUNET_CADET_receive_done (channel); + return GNUNET_OK; +} /** * Handle a PUSH message from another peer. @@ -2240,11 +2260,13 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *c) { static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = { - {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH , + {&handle_peer_check , GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE, + sizeof (struct GNUNET_MessageHeader)}, + {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH, sizeof (struct GNUNET_MessageHeader)}, {&handle_peer_pull_request, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST, sizeof (struct GNUNET_MessageHeader)}, - {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, + {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY, 0}, {NULL, 0, 0} }; -- 2.25.1