[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17348 - gnunet/src/dv
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17348 - gnunet/src/dv |
Date: |
Mon, 10 Oct 2011 15:48:16 +0200 |
Author: grothoff
Date: 2011-10-10 15:48:16 +0200 (Mon, 10 Oct 2011)
New Revision: 17348
Modified:
gnunet/src/dv/dv_api.c
Log:
use LOG macro in dv_api.c
Modified: gnunet/src/dv/dv_api.c
===================================================================
--- gnunet/src/dv/dv_api.c 2011-10-10 13:47:33 UTC (rev 17347)
+++ gnunet/src/dv/dv_api.c 2011-10-10 13:48:16 UTC (rev 17348)
@@ -38,6 +38,8 @@
#include "dv.h"
#include "gnunet_transport_plugin.h"
+#define LOG(kind,...) GNUNET_log_from (kind, "dv-api",__VA_ARGS__)
+
/**
* Store ready to send messages
*/
@@ -174,8 +176,7 @@
if (ret->client != NULL)
return GNUNET_YES;
#if DEBUG_DV_MESSAGES
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- _("Failed to connect to the dv service!\n"));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, _("Failed to connect to the dv service!\n"));
#endif
return GNUNET_NO;
}
@@ -219,16 +220,15 @@
#if DEBUG_DV
if (handle->current != NULL)
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "DV API: Transmit pending called with message type %d\n",
- ntohs (handle->current->msg->header.type));
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "DV API: Transmit pending called with message type %d\n",
+ ntohs (handle->current->msg->header.type));
#endif
if (buf == NULL)
{
#if DEBUG_DV
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "DV API: Transmit pending FAILED!\n\n\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "DV API: Transmit pending FAILED!\n\n\n");
#endif
finish (handle, GNUNET_SYSERR);
return 0;
@@ -244,8 +244,8 @@
{
memcpy (buf, handle->current->msg, tsize);
#if DEBUG_DV
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "DV API: Copied %d bytes into buffer!\n\n\n", tsize);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "DV API: Copied %d bytes into buffer!\n\n\n", tsize);
#endif
finish (handle, GNUNET_OK);
return tsize;
@@ -292,8 +292,8 @@
handle)))
{
#if DEBUG_DV
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Failed to transmit request to dv service.\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to transmit request to dv service.\n");
#endif
finish (handle, GNUNET_SYSERR);
}
@@ -357,7 +357,7 @@
if (msg == NULL)
{
#if DEBUG_DV_MESSAGES
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: connection
closed\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: connection closed\n");
#endif
return; /* Connection closed? */
}
@@ -385,15 +385,15 @@
memcpy (packed_msg, &packed_msg_start[sender_address_len], packed_msg_len);
#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));
+ 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);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "DV_API receive: message sender reported as %s\n",
+ GNUNET_i2s (&received_msg->sender));
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "DV_API receive: distance is %u\n",
+ ntohl (received_msg->distance));
#endif
handle->receive_handler (handle->receive_cls, &received_msg->sender,
@@ -513,8 +513,7 @@
size_t tsize;
#if DEBUG_DV
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "DV API: sending start request to service\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "DV API: sending start request to service\n");
#endif
if (buf == NULL)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17348 - gnunet/src/dv,
gnunet <=