From: Bart Polot Date: Mon, 30 Jul 2012 08:52:51 +0000 (+0000) Subject: - fix client<->service flow control X-Git-Tag: initial-import-from-subversion-38251~12290 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0f65018c42bce154f32b66957dd590bcd96a6c0;p=oweals%2Fgnunet.git - fix client<->service flow control --- diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 420b9a1cc..67c50d304 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -3317,6 +3317,7 @@ tunnel_get_ack (struct MeshTunnel *t) /** * Send an ACK informing the predecessor about the available buffer space. + * In case there is no predecessor, inform the owning client. * If buffering is off, send only on behalf of children or self if endpoint. * If buffering is on, send when sent to children and buffer space is free. * @@ -3329,6 +3330,11 @@ tunnel_send_ack (struct MeshTunnel *t, uint16_t type) struct GNUNET_PeerIdentity id; uint32_t ack; + if (NULL != t->owner) + { + send_client_tunnel_ack (t->owner, t); + return; + } /* Is it after unicast / multicast retransmission? */ if (GNUNET_MESSAGE_TYPE_MESH_ACK != type) { @@ -6261,7 +6267,6 @@ handle_local_unicast (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " calling generic handler...\n"); handle_mesh_data_unicast (NULL, &my_full_id, ©->header, NULL, 0); - send_client_tunnel_ack (t->owner, t); } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "receive done OK\n"); GNUNET_SERVER_receive_done (client, GNUNET_OK);