{
struct MeshChannelReliability *rel = fwd ? ch->root_rel : ch->dest_rel;
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ " sending %s ack to client on channel %s\n",
+ fwd ? "FWD" : "BCK", GMCH_2s (ch));
+
if (NULL == rel)
{
GNUNET_break (0);
return;
}
- if (GNUNET_YES == rel->client_ready)
- return;
GML_send_ack (fwd ? ch->root : ch->dest, fwd ? ch->lid_root : ch->lid_dest);
- rel->client_ready = GNUNET_YES;
}
ch->state = MESH_CHANNEL_READY;
rel = fwd ? ch->root_rel : ch->dest_rel;
+ rel->client_ready = GNUNET_YES;
for (copy = rel->head_sent; NULL != copy; copy = next)
{
struct GNUNET_MessageHeader *msg;
payload->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_DATA);
payload->chid = htonl (ch->gid);
LOG (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
- GMCH_send_prebuilt_message (&payload->header, ch, fwd);
-
if (GNUNET_YES == ch->reliable)
channel_save_copy (ch, &payload->header, fwd);
+ GMCH_send_prebuilt_message (&payload->header, ch, fwd);
+
if (GMT_get_buffer (ch->t, fwd) > 0)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG,
- " sending ack to client (%X)\n", ackid);
- send_client_ack (c, fwd);
+ send_client_ack (ch, fwd);
}
return GNUNET_OK;