diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-12-05 10:17:09 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-12-05 10:17:09 +0000 |
commit | ba295d24fe546446aae8e78cc112af3ae84d4ee0 (patch) | |
tree | b02e3519cd48478743f343ed5b86dfc90dabcabd /src | |
parent | 799594805307a3689a9082696f8f4851e523068a (diff) | |
download | gnunet-ba295d24fe546446aae8e78cc112af3ae84d4ee0.tar.gz gnunet-ba295d24fe546446aae8e78cc112af3ae84d4ee0.zip |
- fix procession of channel create in loopback channels
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh_channel.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index 5abd8c4f9..3ae7ddf75 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c | |||
@@ -2008,9 +2008,9 @@ GMCH_handle_create (struct MeshTunnel3 *t, | |||
2008 | MESH_ChannelNumber chid; | 2008 | MESH_ChannelNumber chid; |
2009 | struct MeshChannel *ch; | 2009 | struct MeshChannel *ch; |
2010 | struct MeshClient *c; | 2010 | struct MeshClient *c; |
2011 | int new_channel; | ||
2011 | 2012 | ||
2012 | chid = ntohl (msg->chid); | 2013 | chid = ntohl (msg->chid); |
2013 | |||
2014 | ch = GMT_get_channel (t, chid); | 2014 | ch = GMT_get_channel (t, chid); |
2015 | if (NULL == ch) | 2015 | if (NULL == ch) |
2016 | { | 2016 | { |
@@ -2018,7 +2018,15 @@ GMCH_handle_create (struct MeshTunnel3 *t, | |||
2018 | ch = channel_new (t, NULL, 0); | 2018 | ch = channel_new (t, NULL, 0); |
2019 | ch->gid = chid; | 2019 | ch->gid = chid; |
2020 | channel_set_options (ch, ntohl (msg->opt)); | 2020 | channel_set_options (ch, ntohl (msg->opt)); |
2021 | new_channel = GNUNET_YES; | ||
2022 | } | ||
2023 | else | ||
2024 | { | ||
2025 | new_channel = GNUNET_NO; | ||
2026 | } | ||
2021 | 2027 | ||
2028 | if (GNUNET_YES == new_channel || GMT_is_loopback (t)) | ||
2029 | { | ||
2022 | /* Find a destination client */ | 2030 | /* Find a destination client */ |
2023 | ch->port = ntohl (msg->port); | 2031 | ch->port = ntohl (msg->port); |
2024 | LOG (GNUNET_ERROR_TYPE_DEBUG, " port %u\n", ch->port); | 2032 | LOG (GNUNET_ERROR_TYPE_DEBUG, " port %u\n", ch->port); |
@@ -2053,7 +2061,10 @@ GMCH_handle_create (struct MeshTunnel3 *t, | |||
2053 | send_client_create (ch); | 2061 | send_client_create (ch); |
2054 | ch->state = MESH_CHANNEL_SENT; | 2062 | ch->state = MESH_CHANNEL_SENT; |
2055 | } | 2063 | } |
2056 | 2064 | else | |
2065 | { | ||
2066 | LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate create channel\n"); | ||
2067 | } | ||
2057 | send_ack (ch, GNUNET_YES); | 2068 | send_ack (ch, GNUNET_YES); |
2058 | 2069 | ||
2059 | return ch; | 2070 | return ch; |