{
GNUNET_CONTAINER_DLL_remove (h->pending_head,
h->pending_tail,
- cm);
- cm->cont (cm->cont_cls, NULL);
+ cm);
+ if (cm->th != NULL)
+ cm->th->cm = NULL;
+ if (cm->cont != NULL)
+ cm->cont (cm->cont_cls, NULL);
GNUNET_free (cm);
}
if (h->client != NULL)
const struct GNUNET_SCHEDULER_TaskContext *tc);
-/**
- * Control message was sent, mark it as such.
- *
- * @param cls the 'struct GNUNET_CORE_TransmitHandle*'
- * @param tc scheduler context
- */
-static void
-mark_control_message_sent (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
-{
- struct GNUNET_CORE_TransmitHandle *th = cls;
-
- th->cm = NULL;
-}
-
-
/**
* Send a control message to the peer asking for transmission
* of the message in the given peer record.
pr);
cm = GNUNET_malloc (sizeof (struct ControlMessage) +
sizeof (struct SendMessageRequest));
- cm->cont = &mark_control_message_sent;
- cm->cont_cls = th;
th->cm = cm;
cm->th = th;
smr = (struct SendMessageRequest*) &cm[1];
cm);
if (cm->th != NULL)
cm->th->cm = NULL;
- cm->cont (cm->cont_cls, NULL);
+ if (cm->cont != NULL)
+ cm->cont (cm->cont_cls, NULL);
GNUNET_free (cm);
}
GNUNET_CONTAINER_multihashmap_iterate (handle->peers,