* Target of the message.
*/
struct GNUNET_PeerIdentity target;
+
+ /**
+ * Payload size in bytes
+ */
+ size_t payload_size;
+
+ /**
+ * DV message size
+ */
+ size_t msg_size;
};
/**
* @param hash set to uid (extended with zeros)
*/
static void
-hash_from_uid (uint32_t uid, GNUNET_HashCode * hash)
+hash_from_uid (uint32_t uid, struct GNUNET_HashCode * hash)
{
- memset (hash, 0, sizeof (GNUNET_HashCode));
+ memset (hash, 0, sizeof (struct GNUNET_HashCode));
*((uint32_t *) hash) = uid;
}
char *sender_address;
char *packed_msg;
char *packed_msg_start;
- GNUNET_HashCode uidhash;
+ struct GNUNET_HashCode uidhash;
struct SendCallbackContext *send_ctx;
if (msg == NULL)
{
if (ntohl (send_result_msg->result) == 0)
{
- send_ctx->cont (send_ctx->cont_cls, &send_ctx->target, GNUNET_OK);
+ send_ctx->cont (send_ctx->cont_cls, &send_ctx->target, GNUNET_OK,
+ send_ctx->payload_size, send_ctx->msg_size);
}
else
{
- send_ctx->cont (send_ctx->cont_cls, &send_ctx->target, GNUNET_SYSERR);
+ send_ctx->cont (send_ctx->cont_cls, &send_ctx->target, GNUNET_SYSERR,
+ send_ctx->payload_size, 0);
}
}
GNUNET_free_non_null (send_ctx);
struct GNUNET_DV_SendMessage *msg;
struct SendCallbackContext *send_ctx;
char *end_of_message;
- GNUNET_HashCode uidhash;
+ struct GNUNET_HashCode uidhash;
int msize;
#if DEBUG_DV_MESSAGES
memcpy (end_of_message, msgbuf, msgbuf_size);
add_pending (dv_handle, msg);
send_ctx = GNUNET_malloc (sizeof (struct SendCallbackContext));
+ send_ctx->payload_size = msgbuf_size;
+ send_ctx->msg_size = msize;
send_ctx->cont = cont;
send_ctx->cont_cls = cont_cls;
memcpy (&send_ctx->target, target, sizeof (struct GNUNET_PeerIdentity));
GNUNET_YES, &transmit_start,
start_context);
- handle->send_callbacks = GNUNET_CONTAINER_multihashmap_create (100);
+ handle->send_callbacks = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO);
return handle;
}