aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2017-12-29 15:40:13 +0100
committerJulius Bünger <buenger@mytum.de>2017-12-29 15:40:13 +0100
commit9b6545e5fffced93341002c8ff7580a417867bcd (patch)
treefce06e56fd8ae8d86a3596ee8992948af7e9d3df
parenta8b68db5ecda35da151e05ce7f475675d276996e (diff)
rps: move handlers struct
-rw-r--r--src/rps/gnunet-service-rps.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 2f0b2c5791..ec70075cf9 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -3967,26 +3967,6 @@ run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *c,
struct GNUNET_SERVICE_Handle *service)
{
- struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
- GNUNET_MQ_hd_fixed_size (peer_check,
- GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE,
- struct GNUNET_MessageHeader,
- NULL),
- GNUNET_MQ_hd_fixed_size (peer_push,
- GNUNET_MESSAGE_TYPE_RPS_PP_PUSH,
- struct GNUNET_MessageHeader,
- NULL),
- GNUNET_MQ_hd_fixed_size (peer_pull_request,
- GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST,
- struct GNUNET_MessageHeader,
- NULL),
- GNUNET_MQ_hd_var_size (peer_pull_reply,
- GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY,
- struct GNUNET_RPS_P2P_PullReplyMessage,
- NULL),
- GNUNET_MQ_handler_end ()
- };
-
int size;
int out_size;
char* fn_valid_peers;
@@ -4076,6 +4056,27 @@ run (void *cls,
/* Initialise cadet */
+ /* There exists a copy-paste-clone in get_channel() */
+ struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
+ GNUNET_MQ_hd_fixed_size (peer_check,
+ GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE,
+ struct GNUNET_MessageHeader,
+ NULL),
+ GNUNET_MQ_hd_fixed_size (peer_push,
+ GNUNET_MESSAGE_TYPE_RPS_PP_PUSH,
+ struct GNUNET_MessageHeader,
+ NULL),
+ GNUNET_MQ_hd_fixed_size (peer_pull_request,
+ GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST,
+ struct GNUNET_MessageHeader,
+ NULL),
+ GNUNET_MQ_hd_var_size (peer_pull_reply,
+ GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY,
+ struct GNUNET_RPS_P2P_PullReplyMessage,
+ NULL),
+ GNUNET_MQ_handler_end ()
+ };
+
cadet_handle = GNUNET_CADET_connect (cfg);
GNUNET_assert (NULL != cadet_handle);
GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_RPS,
@@ -4092,7 +4093,7 @@ run (void *cls,
peerinfo_handle = GNUNET_PEERINFO_connect (cfg);
Peers_initialise (fn_valid_peers, cadet_handle, cleanup_destroyed_channel,
- cadet_handlers, &own_identity);
+ &own_identity);
GNUNET_free (fn_valid_peers);
/* Initialise sampler */