diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-01-18 11:17:33 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-01-18 11:17:33 +0000 |
commit | 9935914f3a3c092954ff7c741524b3624b87063c (patch) | |
tree | 79ce0020ff10516ec0fbd9f3345a3fd9682d0362 /src/mesh | |
parent | a827aeaf11f556657ef75e6691ff685db14daadf (diff) | |
download | gnunet-9935914f3a3c092954ff7c741524b3624b87063c.tar.gz gnunet-9935914f3a3c092954ff7c741524b3624b87063c.zip |
Fixed a bug when a multicast packet is delivered exclusively to local clients
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 56ae515f9..2674d7c47 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -796,9 +796,11 @@ send_subscribed_clients (const struct GNUNET_MessageHeader *msg, | |||
796 | uint16_t type; | 796 | uint16_t type; |
797 | char cbuf[htons (msg->size)]; | 797 | char cbuf[htons (msg->size)]; |
798 | 798 | ||
799 | #if MESH_DEBUG | ||
799 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Sending to clients...\n"); | 800 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: Sending to clients...\n"); |
800 | type = ntohs (payload->type); | 801 | type = ntohs (payload->type); |
801 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: message of type %u\n", type); | 802 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: message of type %u\n", type); |
803 | #endif | ||
802 | 804 | ||
803 | memcpy (cbuf, msg, sizeof (cbuf)); | 805 | memcpy (cbuf, msg, sizeof (cbuf)); |
804 | switch (htons (msg->type)) | 806 | switch (htons (msg->type)) |
@@ -2087,7 +2089,12 @@ tunnel_send_multicast (struct MeshTunnel *t, | |||
2087 | { | 2089 | { |
2088 | GNUNET_free (mdata->data); | 2090 | GNUNET_free (mdata->data); |
2089 | GNUNET_free (mdata->reference_counter); | 2091 | GNUNET_free (mdata->reference_counter); |
2090 | GNUNET_free_non_null (mdata->task); | 2092 | if (NULL != mdata->task) |
2093 | { | ||
2094 | GNUNET_SCHEDULER_cancel(*(mdata->task)); | ||
2095 | GNUNET_free (mdata->task); | ||
2096 | } | ||
2097 | // FIXME change order? | ||
2091 | GNUNET_free (mdata); | 2098 | GNUNET_free (mdata); |
2092 | } | 2099 | } |
2093 | #if MESH_DEBUG | 2100 | #if MESH_DEBUG |
@@ -4347,7 +4354,7 @@ static void | |||
4347 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 4354 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
4348 | { | 4355 | { |
4349 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shutting down\n"); | 4356 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shutting down\n"); |
4350 | /* TODO: destroy tunnels? */ | 4357 | |
4351 | if (core_handle != NULL) | 4358 | if (core_handle != NULL) |
4352 | { | 4359 | { |
4353 | GNUNET_CORE_disconnect (core_handle); | 4360 | GNUNET_CORE_disconnect (core_handle); |