diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-01-19 22:39:41 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-01-19 22:39:41 +0000 |
commit | f8d053e3db33e6874e7557331aad1a0aba4de830 (patch) | |
tree | dbbd4d8bf19025988569dccff89f2b1346ca88e5 /src/mesh | |
parent | ef93f11e7c3e325e66d2644b989fc9b7b1cc2af6 (diff) | |
download | gnunet-f8d053e3db33e6874e7557331aad1a0aba4de830.tar.gz gnunet-f8d053e3db33e6874e7557331aad1a0aba4de830.zip |
Fixed #2087, wrong local tunnel number sent when multiple clients are subscribed to one type message on same peer and one clientis owner of the tunnel and the other is target
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 9f988a17e..0739e0d7d 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -850,11 +850,7 @@ send_subscribed_clients (const struct GNUNET_MessageHeader *msg, | |||
850 | GNUNET_break (0); | 850 | GNUNET_break (0); |
851 | return 0; | 851 | return 0; |
852 | } | 852 | } |
853 | // FIXME proper client differentiation mechanism required | 853 | |
854 | if (htons (msg->type) == GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN) | ||
855 | *tid = htonl (t->local_tid); | ||
856 | else | ||
857 | *tid = htonl (t->local_tid_dest != 0 ? t->local_tid_dest : t->local_tid); | ||
858 | for (count = 0, c = clients; c != NULL; c = c->next) | 854 | for (count = 0, c = clients; c != NULL; c = c->next) |
859 | { | 855 | { |
860 | #if MESH_DEBUG | 856 | #if MESH_DEBUG |
@@ -862,6 +858,18 @@ send_subscribed_clients (const struct GNUNET_MessageHeader *msg, | |||
862 | #endif | 858 | #endif |
863 | if (client_is_subscribed (type, c)) | 859 | if (client_is_subscribed (type, c)) |
864 | { | 860 | { |
861 | // FIXME proper client differentiation mechanism required | ||
862 | if (htons (msg->type) == GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN) | ||
863 | *tid = htonl (t->local_tid); | ||
864 | else if(c == t->client) | ||
865 | *tid = htonl (t->local_tid); | ||
866 | else if(c == t->client_dest) | ||
867 | *tid = htonl (t->local_tid_dest); | ||
868 | else | ||
869 | { | ||
870 | GNUNET_break (0); | ||
871 | continue; | ||
872 | } | ||
865 | count++; | 873 | count++; |
866 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: sending\n"); | 874 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: sending\n"); |
867 | GNUNET_SERVER_notification_context_unicast (nc, c->handle, | 875 | GNUNET_SERVER_notification_context_unicast (nc, c->handle, |