[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36310 - gnunet/src/cadet
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36310 - gnunet/src/cadet |
Date: |
Thu, 3 Sep 2015 20:04:10 +0200 |
Author: bartpolot
Date: 2015-09-03 20:04:10 +0200 (Thu, 03 Sep 2015)
New Revision: 36310
Modified:
gnunet/src/cadet/gnunet-service-cadet_connection.c
gnunet/src/cadet/gnunet-service-cadet_connection.h
gnunet/src/cadet/gnunet-service-cadet_peer.c
Log:
Fix #3929: cancel poll towards disconnected neighbor
Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c 2015-09-03 18:04:09 UTC
(rev 36309)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c 2015-09-03 18:04:10 UTC
(rev 36310)
@@ -3270,17 +3270,18 @@
* @param peer Peer that disconnected.
*/
void
-GCC_notify_broken (struct CadetConnection *c,
- struct CadetPeer *peer)
+GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer)
{
struct CadetPeer *hop;
+ char peer_name[16];
int fwd;
GCC_check_connections ();
+ strncpy (peer_name, GCP_2s (peer), 16);
+ peer_name[15] = '\0';
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Notify broken on %s due to %s disconnect\n",
- GCC_2s (c),
- GCP_2s (peer));
+ "shutting down %s, %s disconnected\n",
+ GCC_2s (c), peer_name);
hop = get_prev_hop (c);
if (NULL == hop)
{
@@ -3290,7 +3291,7 @@
}
fwd = (peer == hop);
if ( (GNUNET_YES == GCC_is_terminal (c, fwd)) ||
- (GNUNET_YES == c->destroy) )
+ (GNUNET_NO != c->destroy) )
{
/* Local shutdown, or other peer already down (hence 'c->destroy');
so there is no one to notify about this, just clean up. */
@@ -3312,6 +3313,7 @@
c));
/* Cancel queue in the direction that just died. */
connection_cancel_queues (c, ! fwd);
+ GCC_stop_poll (c, ! fwd);
unregister_neighbors (c);
GCC_check_connections ();
}
Modified: gnunet/src/cadet/gnunet-service-cadet_connection.h
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.h 2015-09-03 18:04:09 UTC
(rev 36309)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.h 2015-09-03 18:04:10 UTC
(rev 36310)
@@ -460,8 +460,7 @@
* @param peer Peer that disconnected.
*/
void
-GCC_notify_broken (struct CadetConnection *c,
- struct CadetPeer *peer);
+GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer);
/**
* Is this peer the first one on the connection?
Modified: gnunet/src/cadet/gnunet-service-cadet_peer.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_peer.c 2015-09-03 18:04:09 UTC
(rev 36309)
+++ gnunet/src/cadet/gnunet-service-cadet_peer.c 2015-09-03 18:04:10 UTC
(rev 36310)
@@ -343,7 +343,7 @@
* Iterator to notify all connections of a broken link. Mark connections
* to destroy after all traffic has been sent.
*
- * @param cls Closure (peer disconnected).
+ * @param cls Closure (disconnected peer).
* @param key Current key code (peer id).
* @param value Value in the hash map (connection).
*
@@ -361,8 +361,7 @@
"Notifying %s due to %s\n",
GCC_2s (c),
GCP_2s (peer));
- GCC_notify_broken (c,
- peer);
+ GCC_neighbor_disconnected (c, peer);
return GNUNET_YES;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36310 - gnunet/src/cadet,
gnunet <=