aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-12-15 07:18:24 +0000
committerBart Polot <bart@net.in.tum.de>2014-12-15 07:18:24 +0000
commitc6a48607eb7fbb58537c2b93894a31d3d7c06554 (patch)
tree159ede80c49d92c52a1ce20a5e9e5b315342dc86
parent821bf0aafe27fe327b9a07dcca8b12b5779f7486 (diff)
downloadgnunet-c6a48607eb7fbb58537c2b93894a31d3d7c06554.tar.gz
gnunet-c6a48607eb7fbb58537c2b93894a31d3d7c06554.zip
Fix channel buffer retrieval, add debug
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c6
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 7f92e8b5e..c77cc5fc4 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -1424,13 +1424,17 @@ GCCH_get_buffer (struct CadetChannel *ch, int fwd)
1424 struct CadetChannelReliability *rel; 1424 struct CadetChannelReliability *rel;
1425 1425
1426 rel = fwd ? ch->dest_rel : ch->root_rel; 1426 rel = fwd ? ch->dest_rel : ch->root_rel;
1427 1427 LOG (GNUNET_ERROR_TYPE_DEBUG, " get buffer, channel %s\n", GCCH_2s (ch));
1428 GCCH_debug (ch);
1428 /* If rel is NULL it means that the end is not yet created, 1429 /* If rel is NULL it means that the end is not yet created,
1429 * most probably is a loopback channel at the point of sending 1430 * most probably is a loopback channel at the point of sending
1430 * the ChannelCreate to itself. 1431 * the ChannelCreate to itself.
1431 */ 1432 */
1432 if (NULL == rel) 1433 if (NULL == rel)
1434 {
1435 LOG (GNUNET_ERROR_TYPE_DEBUG, " rel is NULL: max\n");
1433 return 64; 1436 return 64;
1437 }
1434 1438
1435 return (64 - rel->n_recv); 1439 return (64 - rel->n_recv);
1436} 1440}
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index de40b2bbb..80b116035 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -476,8 +476,8 @@ get_channel_buffer (const struct CadetTChannel *tch)
476{ 476{
477 int fwd; 477 int fwd;
478 478
479 /* If channel is outgoing, is origin in the FWD direction and fwd is YES */ 479 /* If channel is incoming, is terminal in the FWD direction and fwd is YES */
480 fwd = GCCH_is_origin (tch->ch, GNUNET_YES); 480 fwd = GCCH_is_terminal (tch->ch, GNUNET_YES);
481 481
482 return GCCH_get_buffer (tch->ch, fwd); 482 return GCCH_get_buffer (tch->ch, fwd);
483} 483}
@@ -2823,6 +2823,7 @@ GCT_get_channels_buffer (struct CadetTunnel *t)
2823 if (NULL == t->channel_head) 2823 if (NULL == t->channel_head)
2824 { 2824 {
2825 /* Probably getting buffer for a channel create/handshake. */ 2825 /* Probably getting buffer for a channel create/handshake. */
2826 LOG (GNUNET_ERROR_TYPE_DEBUG, " no channels, allow max\n");
2826 return 64; 2827 return 64;
2827 } 2828 }
2828 2829