struct GNUNET_TRANSPORT_Blacklist *br = cls;
const struct BlacklistMessage *bm;
- if ((ntohs (msg->size) != sizeof (struct BlacklistMessage)) ||
+ GNUNET_assert (br != NULL);
+ if ((NULL == msg) ||
+ (ntohs (msg->size) != sizeof (struct BlacklistMessage)) ||
(ntohs (msg->type) != GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY))
{
reconnect (br);
struct GNUNET_TRANSPORT_Blacklist *br = cls;
struct GNUNET_MessageHeader req;
+ br->th = NULL;
if (buf == NULL)
{
reconnect (br);
struct GNUNET_TRANSPORT_Blacklist *br = cls;
struct BlacklistMessage req;
+ br->th = NULL;
if (buf == NULL)
{
reconnect (br);
req.is_allowed = htonl (br->cb (br->cb_cls, &br->peer));
req.peer = br->peer;
memcpy (buf, &req, sizeof (req));
+ br->th = NULL;
receive (br);
return sizeof (req);
}
static void
reply (struct GNUNET_TRANSPORT_Blacklist *br)
{
+ GNUNET_assert (br->th == NULL);
br->th =
GNUNET_CLIENT_notify_transmit_ready (br->client,
sizeof (struct BlacklistMessage),
ret->cfg = cfg;
ret->cb = cb;
ret->cb_cls = cb_cls;
+ GNUNET_assert (ret->th == NULL);
ret->th =
GNUNET_CLIENT_notify_transmit_ready (client,
sizeof (struct GNUNET_MessageHeader),
GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br)
{
if (br->th != NULL)
+ {
GNUNET_CLIENT_notify_transmit_ready_cancel (br->th);
+ br->th = NULL;
+ }
GNUNET_CLIENT_disconnect (br->client, GNUNET_NO);
GNUNET_free (br);
}