[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13172 - gnunet/src/dht
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13172 - gnunet/src/dht |
Date: |
Wed, 6 Oct 2010 11:27:09 +0200 |
Author: nevans
Date: 2010-10-06 11:27:09 +0200 (Wed, 06 Oct 2010)
New Revision: 13172
Modified:
gnunet/src/dht/dht.h
gnunet/src/dht/dht_api_get_put.c
gnunet/src/dht/gnunet-service-dht.c
gnunet/src/dht/test_dht_api_peer1.conf
Log:
type errors, test case errors, etc.
Modified: gnunet/src/dht/dht.h
===================================================================
--- gnunet/src/dht/dht.h 2010-10-06 08:46:51 UTC (rev 13171)
+++ gnunet/src/dht/dht.h 2010-10-06 09:27:09 UTC (rev 13172)
@@ -27,7 +27,7 @@
#ifndef DHT_H_
#define DHT_H_
-#define DEBUG_DHT GNUNET_NO
+#define DEBUG_DHT GNUNET_YES
/**
* Needs to be GNUNET_YES for logging to dhtlog to work!
Modified: gnunet/src/dht/dht_api_get_put.c
===================================================================
--- gnunet/src/dht/dht_api_get_put.c 2010-10-06 08:46:51 UTC (rev 13171)
+++ gnunet/src/dht/dht_api_get_put.c 2010-10-06 09:27:09 UTC (rev 13172)
@@ -72,13 +72,13 @@
put_msg = (struct GNUNET_DHT_PutMessage*) buf;
put_msg->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_PUT);
put_msg->header.size = htons (sizeof (struct GNUNET_DHT_PutMessage) + size);
- put_msg->type = htons (type);
+ put_msg->type = htonl ((uint32_t)type);
put_msg->expiration = GNUNET_TIME_absolute_hton (exp);
memcpy (&put_msg[1], data, size);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Starting route for %u byte `%s' message\n",
+ "Starting route for %u byte `%s' message of type %u \n",
(unsigned int) (sizeof (struct GNUNET_DHT_PutMessage) + size),
- "PUT");
+ "PUT", type);
GNUNET_break (NULL ==
GNUNET_DHT_route_start (handle,
key,
@@ -212,7 +212,7 @@
get_msg->header.size = htons (sizeof (struct GNUNET_DHT_GetMessage) +
xquery_size +
bf_size);
- get_msg->type = htons ((uint32_t) type);
+ get_msg->type = htonl ((uint32_t) type);
get_msg->bf_mutator = bf_mutator;
get_msg->xquery_size = htons ((uint16_t) xquery_size);
get_msg->bf_size = htons (bf_size);
Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-10-06 08:46:51 UTC (rev 13171)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-10-06 09:27:09 UTC (rev 13172)
@@ -2187,10 +2187,22 @@
GNUNET_free (get_result);
break;
case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
+#if DEBUG_DHT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s:%s': Duplicate block error\n", my_short_id, "DHT");
+#endif
break;
case GNUNET_BLOCK_EVALUATION_RESULT_INVALID:
+#if DEBUG_DHT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s:%s': Invalid request error\n", my_short_id, "DHT");
+#endif
break;
case GNUNET_BLOCK_EVALUATION_REQUEST_VALID:
+#if DEBUG_DHT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s:%s': Valid request, no results.\n", my_short_id, "DHT");
+#endif
GNUNET_break (0);
break;
case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID:
@@ -2198,6 +2210,10 @@
msg_ctx->do_forward = GNUNET_NO;
break;
case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED:
+#if DEBUG_DHT
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s:%s': Unsupported block type (%u) in response!\n",
my_short_id, "DHT", type);
+#endif
/* msg_ctx->do_forward = GNUNET_NO; // not sure... */
break;
}
@@ -2280,7 +2296,7 @@
"`%s:%s': Received `%s' request, message type %u, key %s, uid
%llu\n",
my_short_id,
"DHT", "GET",
- get_type,
+ type,
GNUNET_h2s (&message_context->key),
message_context->unique_id);
#endif
@@ -3841,7 +3857,7 @@
dhtlog_handle->insert_dhtkey(NULL, &key);
#endif
increment_stats(STAT_PUT_START);
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message
with hash %s", my_short_id, "DHT", GNUNET_h2s(&key));
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message
with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key));
route_message(NULL, &put_message.header, &message_context);
GNUNET_SCHEDULER_add_delayed(sched,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS,
malicious_put_frequency), &malicious_put_task, NULL);
@@ -3884,7 +3900,7 @@
dhtlog_handle->insert_dhtkey(NULL, &key);
#endif
increment_stats(STAT_GET_START);
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious GET message
with hash %s", my_short_id, "DHT", GNUNET_h2s(&key));
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious GET message
with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key));
route_message (NULL, &get_message.header, &message_context);
GNUNET_SCHEDULER_add_delayed(sched,
GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS,
malicious_get_frequency), &malicious_get_task, NULL);
}
Modified: gnunet/src/dht/test_dht_api_peer1.conf
===================================================================
--- gnunet/src/dht/test_dht_api_peer1.conf 2010-10-06 08:46:51 UTC (rev
13171)
+++ gnunet/src/dht/test_dht_api_peer1.conf 2010-10-06 09:27:09 UTC (rev
13172)
@@ -9,6 +9,9 @@
HOSTNAME = localhost
PORT = 2100
+[block]
+plugins = dht test
+
[dhtcache]
QUOTA = 1000000
DATABASE = sqlite
@@ -27,7 +30,7 @@
PORT = 12092
[arm]
-DEFAULTSERVICES =
+DEFAULTSERVICES = core dht
PORT = 12366
DEBUG = NO
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13172 - gnunet/src/dht,
gnunet <=