+/**
+ * Process a local ACK message, enabling the client to send
+ * more data to the service.
+ *
+ * @param h Mesh handle.
+ * @param message Message itself.
+ */
+static void
+process_ack (struct GNUNET_MESH_Handle *h,
+ const struct GNUNET_MessageHeader *message)
+{
+ struct GNUNET_MESH_LocalAck *msg;
+ struct GNUNET_MESH_Tunnel *t;
+ uint32_t ack;
+
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Got an ACK!\n");
+ msg = (struct GNUNET_MESH_LocalAck *) message;
+
+ t = retrieve_tunnel (h, ntohl (msg->tunnel_id));
+
+ if (NULL == t)
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "ACK on unknown tunnel %X\n",
+ ntohl (msg->tunnel_id));
+ return;
+ }
+ ack = ntohl (msg->max_pid);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " on tunnel %X, ack %u!\n", t->tid, ack);
+ if (ack > t->max_pid || PID_OVERFLOW (t->max_pid, ack))
+ t->max_pid = ack;
+ else
+ return;
+ if (NULL == h->th && 0 < t->packet_size)
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " tmt rdy was NULL, requesting!\n", t->tid, ack);
+ h->th =
+ GNUNET_CLIENT_notify_transmit_ready (h->client, t->packet_size,
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_YES, &send_callback, h);
+ }
+}
+
+