/**
- * Entry in the DHT routing table for a client's GET request.
+ * Entry in the local forwarding map for a client's GET request.
*/
struct ClientQueryRecord
{
* Previous element in DLL.
*/
struct ClientMonitorRecord *prev;
-
+
/**
* Type of blocks that are of interest
*/
static struct ClientMonitorRecord *monitor_tail;
/**
- * Hashmap for fast key based lookup, maps keys to 'struct ClientQueryRecord' entries.
+ * Hashmap for fast key based lookup, maps keys to `struct ClientQueryRecord` entries.
*/
static struct GNUNET_CONTAINER_MultiHashMap *forward_map;
struct ClientMonitorRecord *monitor;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Local client %p disconnects\n",
+ "Local client %p disconnects\n",
client);
pos = find_active_client (client);
GNUNET_CONTAINER_DLL_remove (client_head, client_tail, pos);
if (monitor->client == pos)
{
struct ClientMonitorRecord *next;
-
+
GNUNET_free_non_null (monitor->key);
next = monitor->next;
GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, monitor);
GNUNET_CONSTANTS_BLOOMFILTER_K);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Initiating GET for %s, replication %u, already have %u replies\n",
- GNUNET_h2s(&cqr->key), cqr->replication, cqr->seen_replies_count);
+ GNUNET_h2s (&cqr->key),
+ cqr->replication,
+ cqr->seen_replies_count);
GDS_NEIGHBOURS_handle_get (cqr->type, cqr->msg_options, cqr->replication,
0 /* hop count */ ,
&cqr->key, cqr->xquery, cqr->xquery_size, reply_bf,
("# PUT requests received from clients"), 1,
GNUNET_NO);
dht_msg = (const struct GNUNET_DHT_ClientPutMessage *) message;
- LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT CLIENT-PUT %s @ %u\n",
- GNUNET_h2s (&dht_msg->key), getpid ());
+ LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "R5N CLIENT-PUT %s\n",
+ GNUNET_h2s_full (&dht_msg->key));
/* give to local clients */
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Handling local PUT of %u-bytes for query %s\n",
&dht_msg[1],
size - sizeof (struct GNUNET_DHT_ClientPutMessage));
GNUNET_CONTAINER_bloomfilter_free (peer_bf);
- pm = GNUNET_malloc (sizeof (struct PendingMessage) +
+ pm = GNUNET_malloc (sizeof (struct PendingMessage) +
sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage));
conf = (struct GNUNET_DHT_ClientPutConfirmationMessage *) &pm[1];
conf->header.size = htons (sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage));
"Received GET request for %s from local client %p, xq: %.*s\n",
GNUNET_h2s (&get->key), client, xquery_size, xquery);
- LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT CLIENT-GET %s @ %u\n",
- GNUNET_h2s (&get->key), getpid ());
+ LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "R5N CLIENT-GET %s\n",
+ GNUNET_h2s_full (&get->key));
cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size);
const struct GNUNET_DHT_MonitorStartStopMessage *msg;
msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message;
- r = GNUNET_malloc (sizeof(struct ClientMonitorRecord));
+ r = GNUNET_new (struct ClientMonitorRecord);
r->client = find_active_client(client);
r->type = ntohl(msg->type);
r->key = NULL;
else
{
- r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ r->key = GNUNET_new (struct GNUNET_HashCode);
memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode));
}
GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
+
/**
* Handler for monitor stop messages
*
}
r = r->next;
}
-
+
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
unsigned int i;
LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
- "XDHT CLIENT-RESULT %s\n",
- GNUNET_h2s (key));
+ "R5N CLIENT-RESULT %s\n",
+ GNUNET_h2s_full (key));
if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type))
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
frc.type = type;
GNUNET_CONTAINER_multihashmap_get_multiple (forward_map, key, &forward_reply,
&frc);
+
if (GNUNET_NO == frc.do_copy)
{
/* did not match any of the requests, free! */
GDS_CLIENTS_process_get (uint32_t options,
enum GNUNET_BLOCK_Type type,
uint32_t hop_count,
- uint32_t desired_replication_level,
+ uint32_t desired_replication_level,
unsigned int path_length,
const struct GNUNET_PeerIdentity *path,
const struct GNUNET_HashCode * key)
GDS_CLIENTS_process_put (uint32_t options,
enum GNUNET_BLOCK_Type type,
uint32_t hop_count,
- uint32_t desired_replication_level,
+ uint32_t desired_replication_level,
unsigned int path_length,
const struct GNUNET_PeerIdentity *path,
struct GNUNET_TIME_Absolute exp,