diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-19 11:34:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-19 11:34:33 +0000 |
commit | ec8dc1b35d33dc5f2e81180360a57adb9fcdc96f (patch) | |
tree | c321415bab3d401302c2f228cc9fc9ee19e7d0ef /src/fs | |
parent | ef26816a8fe322ec33f594c55e5dcccc9e107fbe (diff) | |
download | gnunet-ec8dc1b35d33dc5f2e81180360a57adb9fcdc96f.tar.gz gnunet-ec8dc1b35d33dc5f2e81180360a57adb9fcdc96f.zip |
cleaner
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index c8504045a..f09516693 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -1604,9 +1604,13 @@ void | |||
1604 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | 1604 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, |
1605 | const struct GSF_ConnectedPeer *initiator_peer) | 1605 | const struct GSF_ConnectedPeer *initiator_peer) |
1606 | { | 1606 | { |
1607 | GNUNET_PEER_change_rc (cp->ppd.last_p2p_replies[cp->last_p2p_replies_woff % P2P_SUCCESS_LIST_SIZE], -1); | 1607 | unsigned int woff; |
1608 | cp->ppd.last_p2p_replies[cp->last_p2p_replies_woff++ % P2P_SUCCESS_LIST_SIZE] = initiator_peer->ppd.pid; | 1608 | |
1609 | woff = cp->last_p2p_replies_woff % P2P_SUCCESS_LIST_SIZE; | ||
1610 | GNUNET_PEER_change_rc (cp->ppd.last_p2p_replies[woff], -1); | ||
1611 | cp->ppd.last_p2p_replies[woff] = initiator_peer->ppd.pid; | ||
1609 | GNUNET_PEER_change_rc (initiator_peer->ppd.pid, 1); | 1612 | GNUNET_PEER_change_rc (initiator_peer->ppd.pid, 1); |
1613 | cp->last_p2p_replies_woff = (woff + 1) % P2P_SUCCESS_LIST_SIZE; | ||
1610 | } | 1614 | } |
1611 | 1615 | ||
1612 | 1616 | ||
@@ -1685,6 +1689,7 @@ GSF_peer_disconnect_handler_ (void *cls, | |||
1685 | GSF_plan_notify_peer_disconnect_ (cp); | 1689 | GSF_plan_notify_peer_disconnect_ (cp); |
1686 | GNUNET_LOAD_value_free (cp->ppd.transmission_delay); | 1690 | GNUNET_LOAD_value_free (cp->ppd.transmission_delay); |
1687 | GNUNET_PEER_decrement_rcs (cp->ppd.last_p2p_replies, P2P_SUCCESS_LIST_SIZE); | 1691 | GNUNET_PEER_decrement_rcs (cp->ppd.last_p2p_replies, P2P_SUCCESS_LIST_SIZE); |
1692 | memset (cp->ppd.last_p2p_replies, 0, sizeof (cp->ppd.last_p2p_replies)); | ||
1688 | GSF_push_stop_ (cp); | 1693 | GSF_push_stop_ (cp); |
1689 | while (NULL != (pth = cp->pth_head)) | 1694 | while (NULL != (pth = cp->pth_head)) |
1690 | { | 1695 | { |