aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-08-02 00:42:06 +0000
committerBart Polot <bart@net.in.tum.de>2013-08-02 00:42:06 +0000
commit8a017c1db5aa966285e171211a0f10ad10bae556 (patch)
tree19e2bde35c649066122f98eb25c1e5e52e1cd0a8 /src
parent3f6149fffcc47f1ce9f6cb6a13dc520be6789c7d (diff)
downloadgnunet-8a017c1db5aa966285e171211a0f10ad10bae556.tar.gz
gnunet-8a017c1db5aa966285e171211a0f10ad10bae556.zip
- fixes
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh-enc.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c
index 7f81dee26..da54db74f 100644
--- a/src/mesh/gnunet-service-mesh-enc.c
+++ b/src/mesh/gnunet-service-mesh-enc.c
@@ -3598,6 +3598,8 @@ channel_destroy (struct MeshChannel *ch)
3598 channel_rel_free_all (ch->bck_rel); 3598 channel_rel_free_all (ch->bck_rel);
3599 } 3599 }
3600 3600
3601 GNUNET_STATISTICS_update (stats, "# channels", -1, GNUNET_NO);
3602
3601 GNUNET_free (ch); 3603 GNUNET_free (ch);
3602} 3604}
3603 3605
@@ -3622,7 +3624,7 @@ channel_new (struct MeshClient *owner,
3622 ch->owner = owner; 3624 ch->owner = owner;
3623 ch->id = id; 3625 ch->id = id;
3624 3626
3625 GNUNET_STATISTICS_update (stats, "# channel", 1, GNUNET_NO); 3627 GNUNET_STATISTICS_update (stats, "# channels", 1, GNUNET_NO);
3626 3628
3627 if (GNUNET_OK != 3629 if (GNUNET_OK !=
3628 GNUNET_CONTAINER_multihashmap32_put (owner->own_channels, id, ch, 3630 GNUNET_CONTAINER_multihashmap32_put (owner->own_channels, id, ch,
@@ -3630,44 +3632,26 @@ channel_new (struct MeshClient *owner,
3630 { 3632 {
3631 GNUNET_break (0); 3633 GNUNET_break (0);
3632 channel_destroy (ch); 3634 channel_destroy (ch);
3633 if (NULL != client) 3635 GNUNET_SERVER_receive_done (owner->handle, GNUNET_SYSERR);
3634 {
3635 GNUNET_break (0);
3636 GNUNET_SERVER_receive_done (client->handle, GNUNET_SYSERR);
3637 }
3638 return NULL; 3636 return NULL;
3639 } 3637 }
3640 3638
3641 if (NULL != client) 3639 return ch;
3642 {
3643 if (GNUNET_OK !=
3644 GNUNET_CONTAINER_multihashmap32_put (client->own_tunnels,
3645 t->local_tid, t,
3646 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY))
3647 {
3648 tunnel_destroy (t);
3649 GNUNET_break (0);
3650 GNUNET_SERVER_receive_done (client->handle, GNUNET_SYSERR);
3651 return NULL;
3652 }
3653 }
3654
3655 return t;
3656} 3640}
3657 3641
3658 3642
3659/** 3643/**
3660 * Set options in a tunnel, extracted from a bit flag field 3644 * Set options in a channel, extracted from a bit flag field
3661 * 3645 *
3662 * @param t Tunnel to set options to. 3646 * @param ch Channel to set options to.
3663 * @param options Bit array in host byte order. 3647 * @param options Bit array in host byte order.
3664 */ 3648 */
3665static void 3649static void
3666tunnel_set_options (struct MeshTunnel *t, uint32_t options) 3650channel_set_options (struct MeshChannel *ch, uint32_t options)
3667{ 3651{
3668 t->nobuffer = (options & GNUNET_MESH_OPTION_NOBUFFER) != 0 ? 3652 ch->nobuffer = (options & GNUNET_MESH_OPTION_NOBUFFER) != 0 ?
3669 GNUNET_YES : GNUNET_NO; 3653 GNUNET_YES : GNUNET_NO;
3670 t->reliable = (options & GNUNET_MESH_OPTION_RELIABLE) != 0 ? 3654 ch->reliable = (options & GNUNET_MESH_OPTION_RELIABLE) != 0 ?
3671 GNUNET_YES : GNUNET_NO; 3655 GNUNET_YES : GNUNET_NO;
3672} 3656}
3673 3657