ret->client = GNUNET_CLIENT_connect (ret->sched, "dv", ret->cfg);
if (ret->client != NULL)
return GNUNET_YES;
-#if DEBUG_STATISTICS
+#if DEBUG_DV_MESSAGES
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
_("Failed to connect to the dv service!\n"));
#endif
if (msg == NULL)
{
+#if DEBUG_DV_MESSAGES
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: connection closed\n");
+#endif
return; /* Connection closed? */
}
packed_msg = GNUNET_malloc(packed_msg_len);
memcpy(packed_msg, &packed_msg_start[sender_address_len], packed_msg_len);
-#if DEBUG_DV
+#if DEBUG_DV_MESSAGES
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: packed message type: %d or %d\n", ntohs(((struct GNUNET_MessageHeader *)packed_msg)->type), ((struct GNUNET_MessageHeader *)packed_msg)->type);
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: message sender reported as %s\n", GNUNET_i2s(&received_msg->sender));
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: distance is %u\n", ntohl(received_msg->distance));
struct StartContext *start_context = cls;
struct GNUNET_DV_Handle *handle = start_context->handle;
size_t tsize;
-
+#if DEBUG_DV
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "DV API: sending start request to service\n");
+#endif
if (buf == NULL)
{
GNUNET_free(start_context->message);
memcpy(buf, start_context->message, tsize);
GNUNET_free(start_context->message);
GNUNET_free(start_context);
+ GNUNET_CLIENT_receive (handle->client,
+ &handle_message_receipt,
+ handle, GNUNET_TIME_UNIT_FOREVER_REL);
+
+
return tsize;
}
handle->send_callbacks = GNUNET_CONTAINER_multihashmap_create(100);
- GNUNET_CLIENT_receive (handle->client,
- &handle_message_receipt,
- handle, GNUNET_TIME_UNIT_FOREVER_REL);
-
return handle;
}