LOG (GNUNET_ERROR_TYPE_INFO,
">>> %s (%s %4u) on conn %s (%p) %s [%5u] in queue %s\n",
GC_m2s (type), GC_m2s (payload_type), pid, GCC_2s (c), c,
- GC_f2s(fwd), size,
+ GC_f2s (fwd), size,
GNUNET_STRINGS_relative_time_to_string (wait, GNUNET_YES));
/* If c is NULL, nothing to update. */
c->pending_messages++;
q = GNUNET_new (struct CadetConnectionQueue);
+ q->cont = cont;
+ q->cont_cls = cont_cls;
q->forced = force;
+ GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q);
q->peer_q = GCP_send (get_hop (c, fwd), message,
payload_type, payload_id,
c, fwd,
if (NULL == q->peer_q)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "dropping msg on %s, NULL q\n", GCC_2s (c));
+ GNUNET_CONTAINER_DLL_remove (fc->q_head, fc->q_tail, q);
GNUNET_free (q);
GCC_check_connections ();
return NULL;
}
- q->cont = cont;
- q->cont_cls = cont_cls;
- GNUNET_CONTAINER_DLL_insert (fc->q_head, fc->q_tail, q);
GCC_check_connections ();
return q;
}
q->c, q->c_fwd, sent,
q->type, q->payload_type, q->payload_id,
q->size, wait_time);
+ q->cont = NULL;
}
GNUNET_CONTAINER_DLL_remove (q->peer->q_head, q->peer->q_tail, q);
}
q->payload_id = payload_id;
q->c = c;
q->c_fwd = fwd;
- GNUNET_MQ_notify_sent (q->env, mq_sent, q);
+ GNUNET_MQ_notify_sent (q->env, &mq_sent, q);
+ GNUNET_CONTAINER_DLL_insert (peer->q_head, peer->q_tail, q);
if (GNUNET_YES == q->management_traffic)
{
q->payload_id, GCC_2s (c), GC_f2s (q->c_fwd));
GNUNET_MQ_discard (q->env);
call_peer_cont (q, GNUNET_YES);
+ GNUNET_CONTAINER_DLL_remove (peer->q_head, peer->q_tail, q);
GNUNET_free (q);
return NULL;
}
peer->queue_n++;
}
- GNUNET_CONTAINER_DLL_insert (peer->q_head, peer->q_tail, q);
GCC_check_connections ();
return q;
}