client->tag = NULL;
}
client->receiver_handler = NULL;
- GNUNET_array_grow (client->received_buf, client->received_size, 0);
+ GNUNET_array_grow (client->received_buf,
+ client->received_size,
+ 0);
GNUNET_free (client->service_name);
GNUNET_free (client);
}
* @return number of bytes written to @a buf
*/
static size_t
-transmit_queued (void *cls, size_t size,
+transmit_queued (void *cls,
+ size_t size,
void *buf)
{
struct GNUNET_MQ_Handle *mq = cls;
size_t msg_size;
GNUNET_assert (NULL != buf);
-
msg_size = ntohs (msg->size);
GNUNET_assert (size >= msg_size);
memcpy (buf, msg, msg_size);
size_t msg_size;
GNUNET_assert (NULL != mq);
+ state->th = NULL;
msg = GNUNET_MQ_impl_current (mq);
if (NULL == buf)
{
struct ClientConnectionState *state = impl_state;
+ if (NULL != state->th)
+ {
+ GNUNET_CLIENT_notify_transmit_ready_cancel (state->th);
+ state->th = NULL;
+ }
GNUNET_CLIENT_disconnect (state->connection);
GNUNET_free (impl_state);
}
state->th =
GNUNET_CLIENT_notify_transmit_ready (state->connection,
ntohs (msg->size),
- GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_NO,
- &connection_client_transmit_queued, mq);
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ GNUNET_NO,
+ &connection_client_transmit_queued,
+ mq);
GNUNET_assert (NULL != state->th);
}