diff options
Diffstat (limited to 'src/dht/gnunet-service-xdht_clients.c')
-rw-r--r-- | src/dht/gnunet-service-xdht_clients.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c index 2de3576b7..9e489b6d9 100644 --- a/src/dht/gnunet-service-xdht_clients.c +++ b/src/dht/gnunet-service-xdht_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", |
@@ -578,7 +578,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
578 | /* two clients waiting for same reply, must copy for queueing */ | 578 | /* two clients waiting for same reply, must copy for queueing */ |
579 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + | 579 | pm = GNUNET_malloc (sizeof (struct PendingMessage) + |
580 | ntohs (frc->pm->msg->size)); | 580 | ntohs (frc->pm->msg->size)); |
581 | memcpy (pm, frc->pm, | 581 | GNUNET_memcpy (pm, frc->pm, |
582 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); | 582 | sizeof (struct PendingMessage) + ntohs (frc->pm->msg->size)); |
583 | pm->next = pm->prev = NULL; | 583 | pm->next = pm->prev = NULL; |
584 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; | 584 | pm->msg = (struct GNUNET_MessageHeader *) &pm[1]; |
@@ -664,11 +664,11 @@ GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | |||
664 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); | 664 | reply->expiration = GNUNET_TIME_absolute_hton (expiration); |
665 | reply->key = *key; | 665 | reply->key = *key; |
666 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; | 666 | paths = (struct GNUNET_PeerIdentity *) &reply[1]; |
667 | memcpy (paths, put_path, | 667 | GNUNET_memcpy (paths, put_path, |
668 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); | 668 | sizeof (struct GNUNET_PeerIdentity) * put_path_length); |
669 | memcpy (&paths[put_path_length], get_path, | 669 | GNUNET_memcpy (&paths[put_path_length], get_path, |
670 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); | 670 | sizeof (struct GNUNET_PeerIdentity) * get_path_length); |
671 | memcpy (&paths[get_path_length + put_path_length], data, data_size); | 671 | GNUNET_memcpy (&paths[get_path_length + put_path_length], data, data_size); |
672 | frc.do_copy = GNUNET_NO; | 672 | frc.do_copy = GNUNET_NO; |
673 | frc.pm = pm; | 673 | frc.pm = pm; |
674 | frc.data = data; | 674 | frc.data = data; |
@@ -747,10 +747,10 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
747 | mmsg->hop_count = htonl(hop_count); | 747 | mmsg->hop_count = htonl(hop_count); |
748 | mmsg->desired_replication_level = htonl(desired_replication_level); | 748 | mmsg->desired_replication_level = htonl(desired_replication_level); |
749 | mmsg->get_path_length = htonl(path_length); | 749 | mmsg->get_path_length = htonl(path_length); |
750 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 750 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
751 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 751 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
752 | if (path_length > 0) | 752 | if (path_length > 0) |
753 | memcpy (msg_path, path, | 753 | GNUNET_memcpy (msg_path, path, |
754 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 754 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
755 | add_pending_message (m->client, pm); | 755 | add_pending_message (m->client, pm); |
756 | } | 756 | } |
@@ -829,13 +829,13 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
829 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 829 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
830 | if (path_length > 0) | 830 | if (path_length > 0) |
831 | { | 831 | { |
832 | memcpy (msg_path, path, | 832 | GNUNET_memcpy (msg_path, path, |
833 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 833 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
834 | } | 834 | } |
835 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 835 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
836 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); | 836 | GNUNET_memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
837 | if (size > 0) | 837 | if (size > 0) |
838 | memcpy (&msg_path[path_length], data, size); | 838 | GNUNET_memcpy (&msg_path[path_length], data, size); |
839 | add_pending_message (m->client, pm); | 839 | add_pending_message (m->client, pm); |
840 | } | 840 | } |
841 | } | 841 | } |
@@ -1010,7 +1010,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
1010 | cqr->key = get->key; | 1010 | cqr->key = get->key; |
1011 | cqr->client = find_active_client (client); | 1011 | cqr->client = find_active_client (client); |
1012 | cqr->xquery = (void *) &cqr[1]; | 1012 | cqr->xquery = (void *) &cqr[1]; |
1013 | memcpy (&cqr[1], xquery, xquery_size); | 1013 | GNUNET_memcpy (&cqr[1], xquery, xquery_size); |
1014 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); | 1014 | cqr->hnode = GNUNET_CONTAINER_heap_insert (retry_heap, cqr, 0); |
1015 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; | 1015 | cqr->retry_frequency = GNUNET_TIME_UNIT_SECONDS; |
1016 | cqr->retry_time = GNUNET_TIME_absolute_get (); | 1016 | cqr->retry_time = GNUNET_TIME_absolute_get (); |
@@ -1132,7 +1132,7 @@ handle_dht_local_get_result_seen (void *cls, struct GNUNET_SERVER_Client *client | |||
1132 | GNUNET_array_grow (cqr->seen_replies, | 1132 | GNUNET_array_grow (cqr->seen_replies, |
1133 | cqr->seen_replies_count, | 1133 | cqr->seen_replies_count, |
1134 | cqr->seen_replies_count + hash_count); | 1134 | cqr->seen_replies_count + hash_count); |
1135 | memcpy (&cqr->seen_replies[old_count], | 1135 | GNUNET_memcpy (&cqr->seen_replies[old_count], |
1136 | hc, | 1136 | hc, |
1137 | sizeof (struct GNUNET_HashCode) * hash_count); | 1137 | sizeof (struct GNUNET_HashCode) * hash_count); |
1138 | } | 1138 | } |
@@ -1240,7 +1240,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
1240 | else | 1240 | else |
1241 | { | 1241 | { |
1242 | r->key = GNUNET_new (struct GNUNET_HashCode); | 1242 | r->key = GNUNET_new (struct GNUNET_HashCode); |
1243 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 1243 | GNUNET_memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
1244 | } | 1244 | } |
1245 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 1245 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
1246 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1246 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |