aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-10-30 14:34:00 +0000
committerBart Polot <bart@net.in.tum.de>2012-10-30 14:34:00 +0000
commit5da2a88edbccb7b87909023c20c320d73df7e6f8 (patch)
tree87d00606888d2f3a62122a9c86fdeb67be03d016
parent1e6c749b1630de6d7ab0ea6915ce0226cd90482d (diff)
downloadgnunet-5da2a88edbccb7b87909023c20c320d73df7e6f8.tar.gz
gnunet-5da2a88edbccb7b87909023c20c320d73df7e6f8.zip
- refactoring, oneliners
-rw-r--r--src/mesh/gnunet-service-mesh-new.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c
index 12ac42a67..aec28e7e1 100644
--- a/src/mesh/gnunet-service-mesh-new.c
+++ b/src/mesh/gnunet-service-mesh-new.c
@@ -3380,7 +3380,7 @@ tunnel_add_client (struct MeshTunnel *t, struct MeshClient *c)
3380 // FIXME fc buffering is done by context_notify. Confirm this is OK. 3380 // FIXME fc buffering is done by context_notify. Confirm this is OK.
3381 3381
3382 t->nclients--; 3382 t->nclients--;
3383 GNUNET_array_append (t->clients_fc, t->nclients, clinfo); 3383 GNUNET_array_append (t->clients_fc, t->nclients, fcinfo);
3384} 3384}
3385 3385
3386 3386
@@ -3551,14 +3551,14 @@ tunnel_add_skip (void *cls,
3551 void *value) 3551 void *value)
3552{ 3552{
3553 struct GNUNET_PeerIdentity *neighbor = cls; 3553 struct GNUNET_PeerIdentity *neighbor = cls;
3554 struct MeshTunnelChildInfo *cinfo = value; 3554 struct MeshTunnelFlowControlInfo *fcinfo = value;
3555 3555
3556 /* TODO compare only pointers? key == neighbor? */ 3556 /* TODO compare only pointers? key == neighbor? */
3557 if (0 == memcmp (&neighbor->hashPubKey, key, sizeof (struct GNUNET_HashCode))) 3557 if (0 == memcmp (&neighbor->hashPubKey, key, sizeof (struct GNUNET_HashCode)))
3558 { 3558 {
3559 return GNUNET_YES; 3559 return GNUNET_YES;
3560 } 3560 }
3561 cinfo->skip++; 3561 fcinfo->skip++;
3562 return GNUNET_YES; 3562 return GNUNET_YES;
3563} 3563}
3564 3564
@@ -3623,7 +3623,7 @@ tunnel_get_neighbor_fc (struct MeshTunnel *t,
3623 * 3623 *
3624 * @return ACK value. 3624 * @return ACK value.
3625 */ 3625 */
3626static struct MeshTunnelClientInfo * 3626static struct MeshTunnelFlowControlInfo *
3627tunnel_get_client_fc (struct MeshTunnel *t, 3627tunnel_get_client_fc (struct MeshTunnel *t,
3628 struct MeshClient *c) 3628 struct MeshClient *c)
3629{ 3629{
@@ -3636,7 +3636,7 @@ tunnel_get_client_fc (struct MeshTunnel *t,
3636 return &t->clients_fc[i]; 3636 return &t->clients_fc[i];
3637 } 3637 }
3638 GNUNET_assert (0); 3638 GNUNET_assert (0);
3639 return NULL; // avoid compiler / coverity complaints 3639 return NULL; // won't get here. Just to avoid compiler / coverity complaints.
3640} 3640}
3641 3641
3642 3642
@@ -3651,14 +3651,14 @@ tunnel_get_child_fwd_ack (void *cls,
3651 GNUNET_PEER_Id id) 3651 GNUNET_PEER_Id id)
3652{ 3652{
3653 struct GNUNET_PeerIdentity peer_id; 3653 struct GNUNET_PeerIdentity peer_id;
3654 struct MeshTunnelChildInfo *cinfo; 3654 struct MeshTunnelFlowControlInfo *fcinfo;
3655 struct MeshTunnelChildIteratorContext *ctx = cls; 3655 struct MeshTunnelChildIteratorContext *ctx = cls;
3656 struct MeshTunnel *t = ctx->t; 3656 struct MeshTunnel *t = ctx->t;
3657 uint32_t ack; 3657 uint32_t ack;
3658 3658
3659 GNUNET_PEER_resolve (id, &peer_id); 3659 GNUNET_PEER_resolve (id, &peer_id);
3660 cinfo = tunnel_get_neighbor_fc (t, &peer_id); 3660 fcinfo = tunnel_get_neighbor_fc (t, &peer_id);
3661 ack = cinfo->fwd_ack; 3661 ack = fcinfo->fwd_ack;
3662 3662
3663 ctx->nchildren++; 3663 ctx->nchildren++;
3664 if (GNUNET_NO == ctx->init) 3664 if (GNUNET_NO == ctx->init)
@@ -3675,7 +3675,6 @@ tunnel_get_child_fwd_ack (void *cls,
3675 { 3675 {
3676 ctx->max_child_ack = ctx->max_child_ack > ack ? ctx->max_child_ack : ack; 3676 ctx->max_child_ack = ctx->max_child_ack > ack ? ctx->max_child_ack : ack;
3677 } 3677 }
3678
3679} 3678}
3680 3679
3681 3680