diff options
author | Julius Bünger <buenger@mytum.de> | 2016-09-01 17:30:00 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2016-09-01 17:30:00 +0000 |
commit | 8fad7df6fb06c75b999d11605015e2471cc98006 (patch) | |
tree | fcd3084cdc24eb7d9da4a6ffd63b7f627df33397 /src/rps | |
parent | f082aaf7f59380121e94f23f60b0b06a29b99374 (diff) | |
download | gnunet-8fad7df6fb06c75b999d11605015e2471cc98006.tar.gz gnunet-8fad7df6fb06c75b999d11605015e2471cc98006.zip |
-fix rps service: handler for check_live message
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 26 |
1 files 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, | |||
1186 | GNUNET_OK); | 1186 | GNUNET_OK); |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | /** | ||
1190 | * Handle a CHECK_LIVE message from another peer. | ||
1191 | * | ||
1192 | * This does nothing. But without calling #GNUNET_CADET_receive_done() | ||
1193 | * the channel is blocked for all other communication. | ||
1194 | * | ||
1195 | * @param cls Closure | ||
1196 | * @param channel The channel the CHECK was received over | ||
1197 | * @param channel_ctx The context associated with this channel | ||
1198 | * @param msg The message header | ||
1199 | */ | ||
1200 | static int | ||
1201 | handle_peer_check (void *cls, | ||
1202 | struct GNUNET_CADET_Channel *channel, | ||
1203 | void **channel_ctx, | ||
1204 | const struct GNUNET_MessageHeader *msg) | ||
1205 | { | ||
1206 | GNUNET_CADET_receive_done (channel); | ||
1207 | return GNUNET_OK; | ||
1208 | } | ||
1189 | 1209 | ||
1190 | /** | 1210 | /** |
1191 | * Handle a PUSH message from another peer. | 1211 | * Handle a PUSH message from another peer. |
@@ -2240,11 +2260,13 @@ run (void *cls, | |||
2240 | const struct GNUNET_CONFIGURATION_Handle *c) | 2260 | const struct GNUNET_CONFIGURATION_Handle *c) |
2241 | { | 2261 | { |
2242 | static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = { | 2262 | static const struct GNUNET_CADET_MessageHandler cadet_handlers[] = { |
2243 | {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH , | 2263 | {&handle_peer_check , GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE, |
2264 | sizeof (struct GNUNET_MessageHeader)}, | ||
2265 | {&handle_peer_push , GNUNET_MESSAGE_TYPE_RPS_PP_PUSH, | ||
2244 | sizeof (struct GNUNET_MessageHeader)}, | 2266 | sizeof (struct GNUNET_MessageHeader)}, |
2245 | {&handle_peer_pull_request, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST, | 2267 | {&handle_peer_pull_request, GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST, |
2246 | sizeof (struct GNUNET_MessageHeader)}, | 2268 | sizeof (struct GNUNET_MessageHeader)}, |
2247 | {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, | 2269 | {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY, 0}, |
2248 | {NULL, 0, 0} | 2270 | {NULL, 0, 0} |
2249 | }; | 2271 | }; |
2250 | 2272 | ||