fc = fwd ? &c->fwd_fc : &c->bck_fc;
LOG (GNUNET_ERROR_TYPE_DEBUG, "! sent %s\n", GNUNET_MESH_DEBUG_M2S (type));
- LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n);
LOG (GNUNET_ERROR_TYPE_DEBUG, "! C_P- %p %u\n", c, c->pending_messages);
c->pending_messages--;
if (GNUNET_YES == c->destroy && 0 == c->pending_messages)
{
case GNUNET_MESSAGE_TYPE_MESH_ENCRYPTED:
fc->last_pid_sent++;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "! Q_N- %p %u\n", fc, fc->queue_n);
fc->queue_n--;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"! accounting pid %u\n",
GNUNET_MESSAGE_TYPE_MESH_CONNECTION_ACK,
sizeof (struct GNUNET_MESH_ConnectionACK),
connection, fwd, &message_sent, NULL);
+ connection->pending_messages++;
if (MESH_TUNNEL3_NEW == GMT_get_state (t))
GMT_change_state (t, MESH_TUNNEL3_WAITING);
if (MESH_CONNECTION_READY != connection->state)
id = GNUNET_PEER_search (peer);
if (GMP_get_short_id (get_next_hop (c)) == id)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " FWD ACK\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " FWD FC\n");
fc = &c->fwd_fc;
}
else if (GMP_get_short_id (get_prev_hop (c)) == id)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, " BCK ACK\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " BCK FC\n");
fc = &c->bck_fc;
}
else
}
pid = ntohl (msg->pid);
- LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u, OLD %u\n",
- pid, fc->last_pid_recv);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " PID %u, OLD %u\n", pid, fc->last_pid_recv);
fc->last_pid_recv = pid;
- fwd = fc == &c->fwd_fc;
+ fwd = fc == &c->bck_fc;
GMC_send_ack (c, fwd);
return GNUNET_OK;
data = GNUNET_malloc (size);
memcpy (data, message, size);
type = ntohs (message->type);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Send %s (%u) on connection %s\n",
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Send %s (%u bytes) on connection %s\n",
GNUNET_MESH_DEBUG_M2S (type), size, GMC_2s (c));
fc = fwd ? &c->fwd_fc : &c->bck_fc;
queue->fwd = fwd;
queue->callback = cont;
queue->callback_cls = cont_cls;
- if (100 <= priority)
+ if (100 > priority)
{
- struct MeshPeerQueue *copy;
- struct MeshPeerQueue *next;
-
- for (copy = peer->queue_head; NULL != copy; copy = next)
- {
- next = copy->next;
- if (copy->type == type && copy->c == c && copy->fwd == fwd)
- {
- /* Example: also a FWD ACK for connection XYZ */
- queue_destroy (copy, GNUNET_YES);
- }
- }
- GNUNET_CONTAINER_DLL_insert (peer->queue_head, peer->queue_tail, queue);
+ GNUNET_CONTAINER_DLL_insert_tail (peer->queue_head, peer->queue_tail, queue);
+ peer->queue_n++;
}
else
{
- GNUNET_CONTAINER_DLL_insert_tail (peer->queue_head, peer->queue_tail, queue);
- peer->queue_n++;
+ GNUNET_CONTAINER_DLL_insert (peer->queue_head, peer->queue_tail, queue);
+ call_core = GNUNET_YES;
}
if (NULL == peer->core_transmit && GNUNET_YES == call_core)