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)
downloadgnunet-9b6545e5fffced93341002c8ff7580a417867bcd.tar.gz
gnunet-9b6545e5fffced93341002c8ff7580a417867bcd.zip
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 2f0b2c579..ec70075cf 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -3967,26 +3967,6 @@ run (void *cls,
3967 const struct GNUNET_CONFIGURATION_Handle *c, 3967 const struct GNUNET_CONFIGURATION_Handle *c,
3968 struct GNUNET_SERVICE_Handle *service) 3968 struct GNUNET_SERVICE_Handle *service)
3969{ 3969{
3970 struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
3971 GNUNET_MQ_hd_fixed_size (peer_check,
3972 GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE,
3973 struct GNUNET_MessageHeader,
3974 NULL),
3975 GNUNET_MQ_hd_fixed_size (peer_push,
3976 GNUNET_MESSAGE_TYPE_RPS_PP_PUSH,
3977 struct GNUNET_MessageHeader,
3978 NULL),
3979 GNUNET_MQ_hd_fixed_size (peer_pull_request,
3980 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST,
3981 struct GNUNET_MessageHeader,
3982 NULL),
3983 GNUNET_MQ_hd_var_size (peer_pull_reply,
3984 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY,
3985 struct GNUNET_RPS_P2P_PullReplyMessage,
3986 NULL),
3987 GNUNET_MQ_handler_end ()
3988 };
3989
3990 int size; 3970 int size;
3991 int out_size; 3971 int out_size;
3992 char* fn_valid_peers; 3972 char* fn_valid_peers;
@@ -4076,6 +4056,27 @@ run (void *cls,
4076 4056
4077 4057
4078 /* Initialise cadet */ 4058 /* Initialise cadet */
4059 /* There exists a copy-paste-clone in get_channel() */
4060 struct GNUNET_MQ_MessageHandler cadet_handlers[] = {
4061 GNUNET_MQ_hd_fixed_size (peer_check,
4062 GNUNET_MESSAGE_TYPE_RPS_PP_CHECK_LIVE,
4063 struct GNUNET_MessageHeader,
4064 NULL),
4065 GNUNET_MQ_hd_fixed_size (peer_push,
4066 GNUNET_MESSAGE_TYPE_RPS_PP_PUSH,
4067 struct GNUNET_MessageHeader,
4068 NULL),
4069 GNUNET_MQ_hd_fixed_size (peer_pull_request,
4070 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REQUEST,
4071 struct GNUNET_MessageHeader,
4072 NULL),
4073 GNUNET_MQ_hd_var_size (peer_pull_reply,
4074 GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY,
4075 struct GNUNET_RPS_P2P_PullReplyMessage,
4076 NULL),
4077 GNUNET_MQ_handler_end ()
4078 };
4079
4079 cadet_handle = GNUNET_CADET_connect (cfg); 4080 cadet_handle = GNUNET_CADET_connect (cfg);
4080 GNUNET_assert (NULL != cadet_handle); 4081 GNUNET_assert (NULL != cadet_handle);
4081 GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_RPS, 4082 GNUNET_CRYPTO_hash (GNUNET_APPLICATION_PORT_RPS,
@@ -4092,7 +4093,7 @@ run (void *cls,
4092 4093
4093 peerinfo_handle = GNUNET_PEERINFO_connect (cfg); 4094 peerinfo_handle = GNUNET_PEERINFO_connect (cfg);
4094 Peers_initialise (fn_valid_peers, cadet_handle, cleanup_destroyed_channel, 4095 Peers_initialise (fn_valid_peers, cadet_handle, cleanup_destroyed_channel,
4095 cadet_handlers, &own_identity); 4096 &own_identity);
4096 GNUNET_free (fn_valid_peers); 4097 GNUNET_free (fn_valid_peers);
4097 4098
4098 /* Initialise sampler */ 4099 /* Initialise sampler */