aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-03-21 18:44:18 +0000
committerBart Polot <bart@net.in.tum.de>2014-03-21 18:44:18 +0000
commitdf06904b49f8ef1ad4db2494ec6c723f2886ebc6 (patch)
tree0501c1660d7464ffe90263bb00145267b3f4c34d /src/mesh
parent0d219b5e98dc47eb2b419e2caf5b17bb7ff516ef (diff)
downloadgnunet-df06904b49f8ef1ad4db2494ec6c723f2886ebc6.tar.gz
gnunet-df06904b49f8ef1ad4db2494ec6c723f2886ebc6.zip
- requeue messages on connection broken
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_connection.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c
index b33737eba..02f703007 100644
--- a/src/mesh/gnunet-service-mesh_connection.c
+++ b/src/mesh/gnunet-service-mesh_connection.c
@@ -1741,7 +1741,7 @@ GMC_handle_confirm (void *cls, const struct GNUNET_PeerIdentity *peer,
1741 1741
1742 1742
1743/** 1743/**
1744 * Core handler for notifications of broken paths 1744 * Core handler for notifications of broken connections.
1745 * 1745 *
1746 * @param cls Closure (unused). 1746 * @param cls Closure (unused).
1747 * @param id Peer identity of sending neighbor. 1747 * @param id Peer identity of sending neighbor.
@@ -1775,11 +1775,20 @@ GMC_handle_broken (void* cls,
1775 fwd = is_fwd (c, id); 1775 fwd = is_fwd (c, id);
1776 if (GMC_is_terminal (c, fwd)) 1776 if (GMC_is_terminal (c, fwd))
1777 { 1777 {
1778 struct GNUNET_MessageHeader *msg;
1779 struct MeshPeer *peer;
1780
1781 peer = get_hop (c, !fwd);
1778 path_invalidate (c->path); 1782 path_invalidate (c->path);
1779 if (0 < c->pending_messages) 1783 c->state = MESH_CONNECTION_DESTROYED;
1780 c->destroy = GNUNET_YES; 1784 while (NULL != (msg = GMP_connection_pop (peer, c)))
1781 else 1785 {
1782 GMC_destroy (c); 1786 GNUNET_assert (NULL ==
1787 GMT_send_prebuilt_message (msg, c->t, NULL, GNUNET_YES,
1788 NULL, NULL));
1789 }
1790
1791 GMC_destroy (c);
1783 } 1792 }
1784 else 1793 else
1785 { 1794 {