diff options
-rw-r--r-- | src/dht/dht_api.c | 1 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 23 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 15 |
3 files changed, 35 insertions, 4 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index f469007784..0e709a83ff 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -1268,6 +1268,7 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, pending); pending->in_pending_queue = GNUNET_YES; get_handle = GNUNET_malloc (sizeof (struct GNUNET_DHT_GetHandle)); + get_handle->dht_handle = handle; get_handle->iter = iter; get_handle->iter_cls = iter_cls; get_handle->message = pending; diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 85cdf8252a..0e309e59e2 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c @@ -37,6 +37,12 @@ /** + * Should routing details be logged to stderr (for debugging)? + */ +#define LOG_ROUTE_DETAILS_STDERR GNUNET_YES + + +/** * Linked list of messages to send to clients. */ struct PendingMessage @@ -581,6 +587,16 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received request for %s from local client %p\n", GNUNET_h2s (&get->key), client); + + if (LOG_ROUTE_DETAILS_STDERR) + { + fprintf (stderr, + "XDHT CLIENT-GET %s @ %u\n", + GNUNET_h2s (&get->key), + getpid ()); + } + + cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size); cqr->key = get->key; cqr->client = find_active_client (client); @@ -1002,6 +1018,13 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) struct GNUNET_HashCode ch; unsigned int i; + if (LOG_ROUTE_DETAILS_STDERR) + { + fprintf (stderr, + "XDHT CLIENT-RESULT %s @ %u\n", + GNUNET_h2s (key), + getpid ()); + } if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 5d11e55ae3..ea4baa9e9b 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -97,7 +97,7 @@ /** * Should routing details be logged to stderr (for debugging)? */ -#define LOG_ROUTE_DETAILS_STDERR GNUNET_NO +#define LOG_ROUTE_DETAILS_STDERR GNUNET_YES GNUNET_NETWORK_STRUCT_BEGIN @@ -1598,7 +1598,9 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, char *tmp; tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); - fprintf (stderr, "XDHT PUT %s: %s<-%s\n", GNUNET_h2s (&put->key), tmp, GNUNET_i2s (peer)); + fprintf (stderr, "XDHT PUT %s: %s(%u)<-%s\n", + GNUNET_h2s (&put->key), tmp, getpid (), + GNUNET_i2s (peer)); GNUNET_free (tmp); } @@ -1855,7 +1857,9 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, char *tmp; tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); - fprintf (stderr, "XDHT GET %s: %s<-%s\n", GNUNET_h2s (&get->key), tmp, GNUNET_i2s (peer)); + fprintf (stderr, "XDHT GET %s: %s(%u)<-%s\n", + GNUNET_h2s (&get->key), tmp, getpid(), + GNUNET_i2s (peer)); GNUNET_free (tmp); } @@ -1989,7 +1993,10 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, char *tmp; tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); - fprintf (stderr, "XDHT RESULT %s: %s<-%s\n", GNUNET_h2s (&prm->key), tmp, GNUNET_i2s (peer)); + fprintf (stderr, + "XDHT RESULT %s: %s(%u)<-%s\n", + GNUNET_h2s (&prm->key), tmp, + getpid(), GNUNET_i2s (peer)); GNUNET_free (tmp); } |