[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37269 - gnunet/src/rps
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37269 - gnunet/src/rps |
Date: |
Tue, 14 Jun 2016 00:46:05 +0200 |
Author: ch3
Date: 2016-06-14 00:46:05 +0200 (Tue, 14 Jun 2016)
New Revision: 37269
Modified:
gnunet/src/rps/gnunet-service-rps.c
gnunet/src/rps/gnunet-service-rps_peers.c
gnunet/src/rps/gnunet-service-rps_peers.h
Log:
-rps: merge duplicate functions
Modified: gnunet/src/rps/gnunet-service-rps.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps.c 2016-06-13 21:44:38 UTC (rev 37268)
+++ gnunet/src/rps/gnunet-service-rps.c 2016-06-13 22:46:05 UTC (rev 37269)
@@ -466,7 +466,7 @@
if ( (GNUNET_NO == online) ||
(GNUNET_SYSERR == online) ) /* peer is not even known */
{
- (void) Peers_check_peer_live (peer);
+ (void) Peers_issue_peer_liveliness_check (peer);
(void) Peers_schedule_operation (peer, insert_in_view_op);
return GNUNET_NO;
}
@@ -704,11 +704,10 @@
if (0 < RPS_sampler_count_id (prot_sampler, peer))
{
/* Make sure we 'know' about this peer */
- (void) Peers_check_peer_live (peer);
+ (void) Peers_issue_peer_liveliness_check (peer);
/* Establish a channel towards that peer to indicate we are going to send
* messages to it */
- Peers_indicate_sending_intention (peer);
- //Peers_issue_peer_liveliness_check (peer);
+ //Peers_indicate_sending_intention (peer);
}
}
@@ -722,7 +721,7 @@
got_peer (const struct GNUNET_PeerIdentity *peer)
{
/* If we did not know this peer already, insert it into sampler and view */
- if (GNUNET_YES == Peers_check_peer_live (peer))
+ if (GNUNET_YES == Peers_issue_peer_liveliness_check (peer))
{
Peers_schedule_operation (peer, insert_in_sampler);
Peers_schedule_operation (peer, insert_in_view_op);
@@ -1417,7 +1416,7 @@
&peers[i]))
{
/* Make sure we 'know' about this peer */
- (void) Peers_check_peer_live (&peers[i]);
+ (void) Peers_insert_peer (&peers[i]);
if (GNUNET_YES == Peers_check_peer_valid (&peers[i]))
{
@@ -1426,7 +1425,7 @@
else
{
Peers_schedule_operation (&peers[i], insert_in_pull_map);
- Peers_issue_peer_liveliness_check (&peers[i]);
+ (void) Peers_issue_peer_liveliness_check (&peers[i]);
}
}
}
@@ -1636,8 +1635,7 @@
/* Set the flag of the attacked peer to valid to avoid problems */
if (GNUNET_NO == Peers_check_peer_known (&attacked_peer))
{
- Peers_check_peer_live (&attacked_peer);
- Peers_issue_peer_liveliness_check (&attacked_peer);
+ (void) Peers_issue_peer_liveliness_check (&attacked_peer);
}
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1727,7 +1725,7 @@
* Send as many pushes to the attacked peer as possible
* That is one push per round as it will ignore more.
*/
- Peers_check_peer_live (&attacked_peer);
+ (void) Peers_issue_peer_liveliness_check (&attacked_peer);
if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer))
send_push (&attacked_peer);
}
@@ -1739,7 +1737,7 @@
/* Send PUSH to attacked peers */
if (GNUNET_YES == Peers_check_peer_known (&attacked_peer))
{
- Peers_check_peer_live (&attacked_peer);
+ (void) Peers_issue_peer_liveliness_check (&attacked_peer);
if (GNUNET_YES == Peers_check_peer_valid (&attacked_peer))
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1747,12 +1745,8 @@
GNUNET_i2s (&attacked_peer));
send_push (&attacked_peer);
}
- else
- Peers_issue_peer_liveliness_check (&attacked_peer);
}
- else
- Peers_check_peer_live (&attacked_peer);
- Peers_issue_peer_liveliness_check (&attacked_peer);
+ (void) Peers_issue_peer_liveliness_check (&attacked_peer);
/* The maximum of pushes we're going to send this round */
num_pushes = GNUNET_MIN (GNUNET_MIN (push_limit - 1,
Modified: gnunet/src/rps/gnunet-service-rps_peers.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps_peers.c 2016-06-13 21:44:38 UTC (rev
37268)
+++ gnunet/src/rps/gnunet-service-rps_peers.c 2016-06-13 22:46:05 UTC (rev
37269)
@@ -1020,7 +1020,7 @@
* peer was #own_identity)
*/
int
-Peers_check_peer_live (const struct GNUNET_PeerIdentity *peer)
+Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
{
struct PeerContext *peer_ctx;
int ret;
@@ -1521,29 +1521,6 @@
}
/**
- * @brief Issue a check whether peer is live
- *
- * This tries to establish a channel to the given peer. Once the channel is
- * established successfully, we know the peer is live.
- *
- * @param peer the peer to check liveliness
- */
-void
-Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer)
-{
- struct PeerContext *peer_ctx;
-
- if (0 == GNUNET_CRYPTO_cmp_peer_identity (peer, own_identity))
- {
- return; /* We know that we are online */
- }
-
- peer_ctx = create_or_get_peer_ctx (peer);
- // TODO if LIVE/ONLINE
- check_peer_live (peer_ctx);
-}
-
-/**
* @brief Send a message to another peer.
*
* Keeps track about pending messages so they can be properly removed when the
Modified: gnunet/src/rps/gnunet-service-rps_peers.h
===================================================================
--- gnunet/src/rps/gnunet-service-rps_peers.h 2016-06-13 21:44:38 UTC (rev
37268)
+++ gnunet/src/rps/gnunet-service-rps_peers.h 2016-06-13 22:46:05 UTC (rev
37269)
@@ -169,7 +169,7 @@
* peer was #own_identity)
*/
int
-Peers_check_peer_live (const struct GNUNET_PeerIdentity *peer);
+Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer);
/**
* @brief Remove unecessary data
@@ -381,17 +381,6 @@
void *channel_ctx);
/**
- * @brief Issue a check whether peer is live
- *
- * This tries to establish a channel to the given peer. Once the channel is
- * established successfully, we know the peer is live.
- *
- * @param peer the peer to check liveliness
- */
-void
-Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer);
-
-/**
* @brief Send a message to another peer.
*
* Keeps track about pending messages so they can be properly removed when the
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37269 - gnunet/src/rps,
gnunet <=