aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-service-rps.c
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-08-24 13:35:13 +0200
committert3sserakt <t3ss@posteo.de>2023-08-24 13:35:13 +0200
commita362cd5a23ebb5c9650e577beb4f24edc55797cb (patch)
tree2975cf0d08e6e227cfa092a11a55f76548c5a3d9 /src/rps/gnunet-service-rps.c
parent86ae84f761725e12b6570d12785b970c88fe16d9 (diff)
downloadgnunet-a362cd5a23ebb5c9650e577beb4f24edc55797cb.tar.gz
gnunet-a362cd5a23ebb5c9650e577beb4f24edc55797cb.zip
NEWS: The old hello design replaced by the new hello design.
Diffstat (limited to 'src/rps/gnunet-service-rps.c')
-rw-r--r--src/rps/gnunet-service-rps.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index fc11591a0..76e33c87b 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -28,7 +28,7 @@
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_cadet_service.h" 29#include "gnunet_cadet_service.h"
30#include "gnunet_core_service.h" 30#include "gnunet_core_service.h"
31#include "gnunet_peerinfo_service.h" 31#include "gnunet_peerstore_service.h"
32#include "gnunet_nse_service.h" 32#include "gnunet_nse_service.h"
33#include "gnunet_statistics_service.h" 33#include "gnunet_statistics_service.h"
34#include "rps.h" 34#include "rps.h"
@@ -499,14 +499,15 @@ static float beta;
499static struct GNUNET_NSE_Handle *nse; 499static struct GNUNET_NSE_Handle *nse;
500 500
501/** 501/**
502 * Handler to PEERINFO. 502 * Handle to the PEERSTORE service.
503 */ 503 */
504static struct GNUNET_PEERINFO_Handle *peerinfo_handle; 504static struct GNUNET_PEERSTORE_Handle *peerstore;
505 505
506/** 506/**
507 * Handle for cancellation of iteration over peers. 507 * Our peerstore notification context. We use notification
508 * to instantly learn about new peers as they are discovered.
508 */ 509 */
509static struct GNUNET_PEERINFO_NotifyContext *peerinfo_notify_handle; 510static struct GNUNET_PEERSTORE_NotifyContext *peerstore_notify;
510 511
511 512
512#if ENABLE_MALICIOUS 513#if ENABLE_MALICIOUS
@@ -4697,13 +4698,13 @@ valid_peers_iterator (void *cls,
4697void 4698void
4698process_peerinfo_peers (void *cls, 4699process_peerinfo_peers (void *cls,
4699 const struct GNUNET_PeerIdentity *peer, 4700 const struct GNUNET_PeerIdentity *peer,
4700 const struct GNUNET_HELLO_Message *hello, 4701 const struct GNUNET_MessageHeader *hello,
4701 const char *err_msg) 4702 const char *emsg)
4702{ 4703{
4703 struct Sub *sub = cls; 4704 struct Sub *sub = cls;
4704 4705
4705 (void) hello; 4706 (void) hello;
4706 (void) err_msg; 4707 (void) emsg;
4707 4708
4708 if (NULL != peer) 4709 if (NULL != peer)
4709 { 4710 {
@@ -4743,9 +4744,9 @@ shutdown_task (void *cls)
4743 } 4744 }
4744 4745
4745 /* Disconnect from other services */ 4746 /* Disconnect from other services */
4746 GNUNET_PEERINFO_notify_cancel (peerinfo_notify_handle); 4747 GNUNET_PEERSTORE_hello_changed_notify_cancel (peerstore_notify);
4747 GNUNET_PEERINFO_disconnect (peerinfo_handle); 4748 GNUNET_PEERSTORE_disconnect (peerstore, GNUNET_YES);
4748 peerinfo_handle = NULL; 4749 peerstore = NULL;
4749 GNUNET_NSE_disconnect (nse); 4750 GNUNET_NSE_disconnect (nse);
4750 if (NULL != map_single_hop) 4751 if (NULL != map_single_hop)
4751 { 4752 {
@@ -4935,7 +4936,7 @@ run (void *cls,
4935 round_interval); 4936 round_interval);
4936 4937
4937 4938
4938 peerinfo_handle = GNUNET_PEERINFO_connect (cfg); 4939 peerstore = GNUNET_PEERSTORE_connect (cfg);
4939 4940
4940 /* connect to NSE */ 4941 /* connect to NSE */
4941 nse = GNUNET_NSE_connect (cfg, nse_callback, NULL); 4942 nse = GNUNET_NSE_connect (cfg, nse_callback, NULL);
@@ -4947,10 +4948,10 @@ run (void *cls,
4947 restore_valid_peers (msub); 4948 restore_valid_peers (msub);
4948 get_valid_peers (msub->valid_peers, valid_peers_iterator, msub); 4949 get_valid_peers (msub->valid_peers, valid_peers_iterator, msub);
4949 4950
4950 peerinfo_notify_handle = GNUNET_PEERINFO_notify (cfg, 4951 peerstore_notify = GNUNET_PEERSTORE_hello_changed_notify (peerstore,
4951 GNUNET_NO, 4952 GNUNET_NO,
4952 process_peerinfo_peers, 4953 process_peerinfo_peers,
4953 msub); 4954 msub);
4954 4955
4955 LOG (GNUNET_ERROR_TYPE_INFO, "Ready to receive requests from clients\n"); 4956 LOG (GNUNET_ERROR_TYPE_INFO, "Ready to receive requests from clients\n");
4956 4957