aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-wdht_clients.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-wdht_clients.c')
-rw-r--r--src/dht/gnunet-service-wdht_clients.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/dht/gnunet-service-wdht_clients.c b/src/dht/gnunet-service-wdht_clients.c
index 6d5c477ad..2d9730b08 100644
--- a/src/dht/gnunet-service-wdht_clients.c
+++ b/src/dht/gnunet-service-wdht_clients.c
@@ -64,7 +64,7 @@ struct PendingMessage
64 /** 64 /**
65 * Actual message to be sent, allocated at the end of the struct: 65 * Actual message to be sent, allocated at the end of the struct:
66 * // msg = (cast) &pm[1]; 66 * // msg = (cast) &pm[1];
67 * // memcpy (&pm[1], data, len); 67 * // GNUNET_memcpy (&pm[1], data, len);
68 */ 68 */
69 const struct GNUNET_MessageHeader *msg; 69 const struct GNUNET_MessageHeader *msg;
70 70
@@ -316,7 +316,7 @@ send_reply_to_client (void *cls, size_t size, void *buf)
316 { 316 {
317 GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail, 317 GNUNET_CONTAINER_DLL_remove (client->pending_head, client->pending_tail,
318 reply); 318 reply);
319 memcpy (&cbuf[off], reply->msg, msize); 319 GNUNET_memcpy (&cbuf[off], reply->msg, msize);
320 GNUNET_free (reply); 320 GNUNET_free (reply);
321 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 321 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
322 "Transmitting %u bytes to client %p\n", 322 "Transmitting %u bytes to client %p\n",
@@ -580,7 +580,7 @@ forward_reply (void *cls,
580 /* two clients waiting for same reply, must copy for queueing */ 580 /* two clients waiting for same reply, must copy for queueing */
581 pm = GNUNET_malloc (sizeof (struct PendingMessage) + 581 pm = GNUNET_malloc (sizeof (struct PendingMessage) +
582 ntohs (frc->pm->msg->size)); 582 ntohs (frc->pm->msg->size));
583 memcpy (pm, frc->pm, 583 GNUNET_memcpy (pm, frc->pm,
584 sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); 584 sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size));
585 pm->next = pm->prev = NULL; 585 pm->next = pm->prev = NULL;
586 pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; 586 pm->msg = (struct GNUNET_MessageHeader *) &pm[1];
@@ -666,11 +666,11 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration,
666 reply->expiration = GNUNET_TIME_absolute_hton (expiration); 666 reply->expiration = GNUNET_TIME_absolute_hton (expiration);
667 reply->key = *key; 667 reply->key = *key;
668 paths = (struct GNUNET_PeerIdentity *) &reply[1]; 668 paths = (struct GNUNET_PeerIdentity *) &reply[1];
669 memcpy (paths, put_path, 669 GNUNET_memcpy (paths, put_path,
670 sizeof (struct GNUNET_PeerIdentity) * put_path_length); 670 sizeof (struct GNUNET_PeerIdentity) * put_path_length);
671 memcpy (&paths[put_path_length], get_path, 671 GNUNET_memcpy (&paths[put_path_length], get_path,
672 sizeof (struct GNUNET_PeerIdentity) * get_path_length); 672 sizeof (struct GNUNET_PeerIdentity) * get_path_length);
673 memcpy (&paths[get_path_length + put_path_length], data, data_size); 673 GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size);
674 frc.do_copy = GNUNET_NO; 674 frc.do_copy = GNUNET_NO;
675 frc.pm = pm; 675 frc.pm = pm;
676 frc.data = data; 676 frc.data = data;
@@ -750,10 +750,10 @@ GDS_CLIENTS_process_get (uint32_t options,
750 mmsg->hop_count = htonl(hop_count); 750 mmsg->hop_count = htonl(hop_count);
751 mmsg->desired_replication_level = htonl(desired_replication_level); 751 mmsg->desired_replication_level = htonl(desired_replication_level);
752 mmsg->get_path_length = htonl(path_length); 752 mmsg->get_path_length = htonl(path_length);
753 memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); 753 GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode));
754 msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; 754 msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1];
755 if (path_length > 0) 755 if (path_length > 0)
756 memcpy (msg_path, path, 756 GNUNET_memcpy (msg_path, path,
757 path_length * sizeof (struct GNUNET_PeerIdentity)); 757 path_length * sizeof (struct GNUNET_PeerIdentity));
758 add_pending_message (m->client, pm); 758 add_pending_message (m->client, pm);
759 } 759 }
@@ -832,13 +832,13 @@ GDS_CLIENTS_process_put (uint32_t options,
832 msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; 832 msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1];
833 if (path_length > 0) 833 if (path_length > 0)
834 { 834 {
835 memcpy (msg_path, path, 835 GNUNET_memcpy (msg_path, path,
836 path_length * sizeof (struct GNUNET_PeerIdentity)); 836 path_length * sizeof (struct GNUNET_PeerIdentity));
837 } 837 }
838 mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); 838 mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp);
839 memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); 839 GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode));
840 if (size > 0) 840 if (size > 0)
841 memcpy (&msg_path[path_length], data, size); 841 GNUNET_memcpy (&msg_path[path_length], data, size);
842 add_pending_message (m->client, pm); 842 add_pending_message (m->client, pm);
843 } 843 }
844 } 844 }
@@ -1015,7 +1015,7 @@ handle_dht_local_get (void *cls,
1015 cqr->key = get->key; 1015 cqr->key = get->key;
1016 cqr->client = find_active_client (client); 1016 cqr->client = find_active_client (client);
1017 cqr->xquery = (void *) &cqr[1]; 1017 cqr->xquery = (void *) &cqr[1];
1018 memcpy (&cqr[1], xquery, xquery_size); 1018 GNUNET_memcpy (&cqr[1], xquery, xquery_size);
1019 cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); 1019 cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0);
1020 cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; 1020 cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS;
1021 cqr->retry_time = GNUNET_TIME_absolute_get (); 1021 cqr->retry_time = GNUNET_TIME_absolute_get ();
@@ -1141,7 +1141,7 @@ handle_dht_local_get_result_seen (void *cls,
1141 GNUNET_array_grow (cqr->seen_replies, 1141 GNUNET_array_grow (cqr->seen_replies,
1142 cqr->seen_replies_count, 1142 cqr->seen_replies_count,
1143 cqr->seen_replies_count + hash_count); 1143 cqr->seen_replies_count + hash_count);
1144 memcpy (&cqr->seen_replies[old_count], 1144 GNUNET_memcpy (&cqr->seen_replies[old_count],
1145 hc, 1145 hc,
1146 sizeof (struct GNUNET_HashCode) * hash_count); 1146 sizeof (struct GNUNET_HashCode) * hash_count);
1147} 1147}
@@ -1253,7 +1253,7 @@ handle_dht_local_monitor (void *cls,
1253 else 1253 else
1254 { 1254 {
1255 r->key = GNUNET_new (struct GNUNET_HashCode); 1255 r->key = GNUNET_new (struct GNUNET_HashCode);
1256 memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); 1256 GNUNET_memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode));
1257 } 1257 }
1258 GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); 1258 GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r);
1259 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1259 GNUNET_SERVER_receive_done (client, GNUNET_OK);