[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30866 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30866 - gnunet/src/mesh |
Date: |
Tue, 26 Nov 2013 02:52:31 +0100 |
Author: bartpolot
Date: 2013-11-26 02:52:30 +0100 (Tue, 26 Nov 2013)
New Revision: 30866
Modified:
gnunet/src/mesh/gnunet-service-mesh_channel.c
gnunet/src/mesh/gnunet-service-mesh_channel.h
gnunet/src/mesh/gnunet-service-mesh_local.c
Log:
- fix #3114: add feedback from _local to _channel on who is requesting the
channel destruction, notify the other part
Modified: gnunet/src/mesh/gnunet-service-mesh_channel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-11-26 01:33:52 UTC
(rev 30865)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.c 2013-11-26 01:52:30 UTC
(rev 30866)
@@ -1155,7 +1155,7 @@
msg.chid = htonl (ch->gid);
/* If root is not NULL, notify.
- * If it's NULL, check lid_root. When a local destroy comes in, root
+ * If it's NULL, check lid_root. When a local destroy comes in, root
* is set to NULL but lid_root is left untouched. In this case, do nothing,
* the client is the one who reuqested the channel to be destroyed.
*/
@@ -1438,21 +1438,23 @@
*
* @param ch Channel.
* @param c Client that requested the destruction (to avoid notifying him).
+ * @param is_root Is the request coming from root?
*/
void
GMCH_handle_local_destroy (struct MeshChannel *ch,
- struct MeshClient *c)
+ struct MeshClient *c,
+ int is_root)
{
struct MeshTunnel3 *t;
/* Cleanup after the tunnel */
- if (c == ch->dest)
+ if (GNUNET_NO == is_root && c == ch->dest)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Client %s is destination.\n", GML_2s (c));
GML_client_delete_channel (c, ch, ch->lid_dest);
ch->dest = NULL;
}
- if (c == ch->root)
+ if (GNUNET_YES == is_root && c == ch->root)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Client %s is owner.\n", GML_2s (c));
GML_client_delete_channel (c, ch, ch->lid_root);
@@ -1908,7 +1910,7 @@
int retransmission)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "GMCH Send %s %s on channel %s\n",
- fwd ? "FWD" : "BCK", GNUNET_MESH_DEBUG_M2S (ntohs (message->type)),
+ fwd ? "FWD" : "BCK", GNUNET_MESH_DEBUG_M2S (ntohs (message->type)),
GMCH_2s (ch));
if (GMT_is_loopback (ch->t))
Modified: gnunet/src/mesh/gnunet-service-mesh_channel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_channel.h 2013-11-26 01:33:52 UTC
(rev 30865)
+++ gnunet/src/mesh/gnunet-service-mesh_channel.h 2013-11-26 01:52:30 UTC
(rev 30866)
@@ -209,10 +209,12 @@
*
* @param ch Channel.
* @param c Client that requested the destruction (to avoid notifying him).
+ * @param is_root Is the request coming from root?
*/
void
GMCH_handle_local_destroy (struct MeshChannel *ch,
- struct MeshClient *c);
+ struct MeshClient *c,
+ int is_root);
/**
* Handle a channel create requested by a client.
Modified: gnunet/src/mesh/gnunet-service-mesh_local.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_local.c 2013-11-26 01:33:52 UTC (rev
30865)
+++ gnunet/src/mesh/gnunet-service-mesh_local.c 2013-11-26 01:52:30 UTC (rev
30866)
@@ -214,7 +214,7 @@
" Channel %s destroy, due to client %s shutdown.\n",
GMCH_2s (ch), GML_2s (c));
- GMCH_handle_local_destroy (ch, c);
+ GMCH_handle_local_destroy (ch, c, key < GNUNET_MESH_LOCAL_CHANNEL_ID_SERV);
return GNUNET_OK;
}
@@ -439,7 +439,7 @@
return;
}
- GMCH_handle_local_destroy (ch, c);
+ GMCH_handle_local_destroy (ch, c, chid < GNUNET_MESH_LOCAL_CHANNEL_ID_SERV);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
return;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30866 - gnunet/src/mesh,
gnunet <=