diff options
author | Julius Bünger <buenger@mytum.de> | 2018-09-26 21:38:31 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-09-26 21:38:52 +0200 |
commit | ccf16c9d0542a04a3fa175305a807d7c0a0a65db (patch) | |
tree | aea07807fc8911b57c22db22f211cb40da795fd6 /src | |
parent | 1d44c1e60ef16c747e02bff9ee5bd682e6f89569 (diff) | |
download | gnunet-ccf16c9d0542a04a3fa175305a807d7c0a0a65db.tar.gz gnunet-ccf16c9d0542a04a3fa175305a807d7c0a0a65db.zip |
Handle cancellation of stream on the service-side
Diffstat (limited to 'src')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 30 |
1 files changed, 30 insertions, 0 deletions
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, | |||
2782 | 2782 | ||
2783 | 2783 | ||
2784 | /** | 2784 | /** |
2785 | * @brief Handles the cancellation of the stream of biased peer ids | ||
2786 | * | ||
2787 | * @param cls The client context | ||
2788 | * @param msg unused | ||
2789 | */ | ||
2790 | static void | ||
2791 | handle_client_stream_cancel (void *cls, | ||
2792 | const struct GNUNET_MessageHeader *msg) | ||
2793 | { | ||
2794 | struct ClientContext *cli_ctx = cls; | ||
2795 | (void) msg; | ||
2796 | |||
2797 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2798 | "Client requested peers from biased stream.\n"); | ||
2799 | cli_ctx->stream_update = GNUNET_NO; | ||
2800 | |||
2801 | GNUNET_assert (NULL != cli_ctx); | ||
2802 | GNUNET_SERVICE_client_continue (cli_ctx->client); | ||
2803 | if (0 == cli_ctx->view_updates_left) | ||
2804 | { | ||
2805 | destroy_cli_ctx (cli_ctx); | ||
2806 | } | ||
2807 | } | ||
2808 | |||
2809 | |||
2810 | /** | ||
2785 | * Handle a CHECK_LIVE message from another peer. | 2811 | * Handle a CHECK_LIVE message from another peer. |
2786 | * | 2812 | * |
2787 | * This does nothing. But without calling #GNUNET_CADET_receive_done() | 2813 | * This does nothing. But without calling #GNUNET_CADET_receive_done() |
@@ -4112,6 +4138,10 @@ GNUNET_SERVICE_MAIN | |||
4112 | GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_REQUEST, | 4138 | GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_REQUEST, |
4113 | struct GNUNET_RPS_CS_DEBUG_StreamRequest, | 4139 | struct GNUNET_RPS_CS_DEBUG_StreamRequest, |
4114 | NULL), | 4140 | NULL), |
4141 | GNUNET_MQ_hd_fixed_size (client_stream_cancel, | ||
4142 | GNUNET_MESSAGE_TYPE_RPS_CS_DEBUG_STREAM_CANCEL, | ||
4143 | struct GNUNET_MessageHeader, | ||
4144 | NULL), | ||
4115 | GNUNET_MQ_handler_end()); | 4145 | GNUNET_MQ_handler_end()); |
4116 | 4146 | ||
4117 | /* end of gnunet-service-rps.c */ | 4147 | /* end of gnunet-service-rps.c */ |