From c6a48607eb7fbb58537c2b93894a31d3d7c06554 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 15 Dec 2014 07:18:24 +0000 Subject: Fix channel buffer retrieval, add debug --- src/cadet/gnunet-service-cadet_channel.c | 6 +++++- src/cadet/gnunet-service-cadet_tunnel.c | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/cadet') 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) struct CadetChannelReliability *rel; rel = fwd ? ch->dest_rel : ch->root_rel; - + LOG (GNUNET_ERROR_TYPE_DEBUG, " get buffer, channel %s\n", GCCH_2s (ch)); + GCCH_debug (ch); /* If rel is NULL it means that the end is not yet created, * most probably is a loopback channel at the point of sending * the ChannelCreate to itself. */ if (NULL == rel) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, " rel is NULL: max\n"); return 64; + } return (64 - rel->n_recv); } 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) { int fwd; - /* If channel is outgoing, is origin in the FWD direction and fwd is YES */ - fwd = GCCH_is_origin (tch->ch, GNUNET_YES); + /* If channel is incoming, is terminal in the FWD direction and fwd is YES */ + fwd = GCCH_is_terminal (tch->ch, GNUNET_YES); return GCCH_get_buffer (tch->ch, fwd); } @@ -2823,6 +2823,7 @@ GCT_get_channels_buffer (struct CadetTunnel *t) if (NULL == t->channel_head) { /* Probably getting buffer for a channel create/handshake. */ + LOG (GNUNET_ERROR_TYPE_DEBUG, " no channels, allow max\n"); return 64; } -- cgit v1.2.3