[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11877 - gnunet/src/dv
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11877 - gnunet/src/dv |
Date: |
Tue, 22 Jun 2010 18:38:59 +0200 |
Author: nevans
Date: 2010-06-22 18:38:59 +0200 (Tue, 22 Jun 2010)
New Revision: 11877
Modified:
gnunet/src/dv/dv.h
gnunet/src/dv/gnunet-service-dv.c
Log:
remove ugly ifdef for message tracking
Modified: gnunet/src/dv/dv.h
===================================================================
--- gnunet/src/dv/dv.h 2010-06-22 16:30:43 UTC (rev 11876)
+++ gnunet/src/dv/dv.h 2010-06-22 16:38:59 UTC (rev 11877)
@@ -229,17 +229,11 @@
{
struct GNUNET_MessageHeader header;
-#if DEBUG_DV_MESSAGES
/**
- * Unique ID for this message.
+ * Unique ID for this message. Will be zero unless
+ * message tracking is desired.
*/
uint32_t uid GNUNET_PACKED;
-#else
- /*
- * Alignment.
- */
- uint32_t reserved GNUNET_PACKED;
-#endif
/**
* Identity of peer that ultimately sent the message.
Modified: gnunet/src/dv/gnunet-service-dv.c
===================================================================
--- gnunet/src/dv/gnunet-service-dv.c 2010-06-22 16:30:43 UTC (rev 11876)
+++ gnunet/src/dv/gnunet-service-dv.c 2010-06-22 16:38:59 UTC (rev 11877)
@@ -511,12 +511,10 @@
*/
struct GNUNET_TIME_Relative timeout;
-#if DEBUG_DV_MESSAGES
/**
* Unique ID for DV message
*/
unsigned int uid;
-#endif
};
@@ -944,6 +942,8 @@
toSend->recipient = htonl (recipient_id);
#if DEBUG_DV_MESSAGES
toSend->uid = send_context->uid; /* Still sent around in network byte order
*/
+#else
+ toSend->uid = htonl(0);
#endif
memcpy (&toSend[1], send_context->message, send_context->message_size);
@@ -1009,7 +1009,6 @@
return GNUNET_YES;
}
-#if DEBUG_DV_MESSAGES
/**
* Send a DV data message via DV.
*
@@ -1019,22 +1018,8 @@
* @param message the packed message
* @param message_size size of the message
* @param importance what priority to send this message with
- * @param uid unique id for this message
* @param timeout how long to possibly delay sending this message
*/
-#else
-/**
- * Send a DV data message via DV.
- *
- * @param recipient the ultimate recipient of this message
- * @param sender the original sender of the message
- * @param specific_neighbor the specific neighbor to send this message via
- * @param message the packed message
- * @param message_size size of the message
- * @param importance what priority to send this message with
- * @param timeout how long to possibly delay sending this message
- */
-#endif
static int
send_message (const struct GNUNET_PeerIdentity * recipient,
const struct GNUNET_PeerIdentity * sender,
@@ -1042,9 +1027,7 @@
const struct GNUNET_MessageHeader * message,
size_t message_size,
unsigned int importance,
-#if DEBUG_DV_MESSAGES
unsigned int uid,
-#endif
struct GNUNET_TIME_Relative timeout)
{
p2p_dv_MESSAGE_Data *toSend;
@@ -1127,7 +1110,10 @@
toSend->recipient = htonl (recipient_id);
#if DEBUG_DV_MESSAGES
toSend->uid = htonl(uid);
+#else
+ toSend->uid = htonl(0);
#endif
+
#if DEBUG_DV_PEER_NUMBERS
GNUNET_CRYPTO_hash_to_enc (&target->identity.hashPubKey, &encPeerTo);
encPeerTo.encoding[4] = '\0';
@@ -1393,9 +1379,7 @@
packed_message,
packed_message_size,
default_dv_priority,
-#if DEBUG_DV_MESSAGES
ntohl(incoming->uid),
-#endif
GNUNET_TIME_relative_get_forever());
if (ret != GNUNET_SYSERR)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11877 - gnunet/src/dv,
gnunet <=