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,
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);
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:
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;
}
"`%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
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);
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);
}