[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 05/05: Handle cancellation of stream on the servic
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 05/05: Handle cancellation of stream on the service-side |
Date: |
Wed, 26 Sep 2018 21:39:16 +0200 |
This is an automated email from the git hooks/post-receive script.
julius-buenger pushed a commit to branch master
in repository gnunet.
commit ccf16c9d0542a04a3fa175305a807d7c0a0a65db
Author: Julius Bünger <address@hidden>
AuthorDate: Wed Sep 26 21:38:31 2018 +0200
Handle cancellation of stream on the service-side
---
src/rps/gnunet-service-rps.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 64cb5ac98..f20f49492 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -2782,6 +2782,32 @@ handle_client_stream_request (void *cls,
/**
+ * @brief Handles the cancellation of the stream of biased peer ids
+ *
+ * @param cls The client context
+ * @param msg unused
+ */
+static void
+handle_client_stream_cancel (void *cls,
+ const struct GNUNET_MessageHeader *msg)
+{
+ struct ClientContext *cli_ctx = cls;
+ (void) msg;
+
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Client requested peers from biased stream.\n");
+ cli_ctx->stream_update = GNUNET_NO;
+
+ GNUNET_assert (NULL != cli_ctx);
+ GNUNET_SERVICE_client_continue (cli_ctx->client);
+ if (0 == cli_ctx->view_updates_left)
+ {
+ destroy_cli_ctx (cli_ctx);
+ }
+}
+
+
+/**
* Handle a CHECK_LIVE message from another peer.
*
* This does nothing. But without calling #GNUNET_CADET_receive_done()
@@ -4112,6 +4138,10 @@ GNUNET_SERVICE_MAIN
GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_REQUEST,
struct GNUNET_RPS_CS_DEBUG_StreamRequest,
NULL),
+ GNUNET_MQ_hd_fixed_size (client_stream_cancel,
+ GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_CANCEL,
+ struct GNUNET_MessageHeader,
+ NULL),
GNUNET_MQ_handler_end());
/* end of gnunet-service-rps.c */
--
To stop receiving notification emails like this one, please contact
address@hidden