aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_tunnel.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-10-11 15:37:21 +0000
committerBart Polot <bart@net.in.tum.de>2013-10-11 15:37:21 +0000
commit8f6c85fba2386a4e6673f07e32dbfefcfcffdd1c (patch)
treed525f468b2efcd39be2fc3062ea918bda7f1fbdc /src/mesh/gnunet-service-mesh_tunnel.c
parent2729dc7c819e58338e2f56531d44475198ebed6c (diff)
downloadgnunet-8f6c85fba2386a4e6673f07e32dbfefcfcffdd1c.tar.gz
gnunet-8f6c85fba2386a4e6673f07e32dbfefcfcffdd1c.zip
- mesh builds again
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c
index 105317501..01f581c27 100644
--- a/src/mesh/gnunet-service-mesh_tunnel.c
+++ b/src/mesh/gnunet-service-mesh_tunnel.c
@@ -1095,10 +1095,8 @@ GMT_get_next_chid (struct MeshTunnel3 *t)
1095 * @param ch Channel which has some free buffer space. 1095 * @param ch Channel which has some free buffer space.
1096 * @param fwd Is this in for FWD traffic? (ACK goes dest->root) 1096 * @param fwd Is this in for FWD traffic? (ACK goes dest->root)
1097 */ 1097 */
1098static void 1098void
1099GMT_send_acks (struct MeshTunnel3 *t, 1099GMT_send_acks (struct MeshTunnel3 *t, unsigned int buffer, int fwd)
1100 unsigned int buffer,
1101 int fwd)
1102{ 1100{
1103 struct MeshTConnection *iter; 1101 struct MeshTConnection *iter;
1104 uint32_t allowed; 1102 uint32_t allowed;
@@ -1108,7 +1106,19 @@ GMT_send_acks (struct MeshTunnel3 *t,
1108 1106
1109 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1110 "Tunnel send acks on %s:%X\n", 1108 "Tunnel send acks on %s:%X\n",
1111 fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid); 1109 fwd ? "FWD" : "BCK", GMT_2s (t));
1110
1111 if (NULL == t)
1112 {
1113 GNUNET_break (0);
1114 return;
1115 }
1116 if (NULL == t->channel_head ||
1117 GNUNET_NO == GMCH_is_origin (t->channel_head->ch, fwd))
1118 {
1119 GNUNET_break (0);
1120 return;
1121 }
1112 1122
1113 /* Count connections, how many messages are already allowed */ 1123 /* Count connections, how many messages are already allowed */
1114 cs = GMT_count_connections (t); 1124 cs = GMT_count_connections (t);
@@ -1125,7 +1135,7 @@ GMT_send_acks (struct MeshTunnel3 *t,
1125 } 1135 }
1126 1136
1127 /* Authorize connections to send more data */ 1137 /* Authorize connections to send more data */
1128 to_allow = buffer - allowed; 1138 to_allow = buffer; /* - allowed; */
1129 1139
1130 for (iter = t->connection_head; NULL != iter && to_allow > 0; iter = iter->next) 1140 for (iter = t->connection_head; NULL != iter && to_allow > 0; iter = iter->next)
1131 { 1141 {
@@ -1136,13 +1146,9 @@ GMT_send_acks (struct MeshTunnel3 *t,
1136 { 1146 {
1137 continue; 1147 continue;
1138 } 1148 }
1139 GMC_send_ack (iter->c, NULL, fwd); 1149 GMC_allow (iter->c, buffer, fwd);
1140 connection_send_ack (iter, allow_per_connection, fwd);
1141 } 1150 }
1142 1151
1143 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1144 "Channel send connection %s ack on %s:%X\n",
1145 fwd ? "FWD" : "BCK", peer2s (ch->t->peer), ch->gid);
1146 GNUNET_break (to_allow == 0); 1152 GNUNET_break (to_allow == 0);
1147} 1153}
1148 1154