diff options
Diffstat (limited to 'src/dht/gnunet-service-dht_clients.c')
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index d897d1fd6..173a1c3ef 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -111,7 +111,7 @@ struct ClientQueryRecord | |||
111 | /** | 111 | /** |
112 | * The key this request was about | 112 | * The key this request was about |
113 | */ | 113 | */ |
114 | GNUNET_HashCode key; | 114 | struct GNUNET_HashCode key; |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * Client responsible for the request. | 117 | * Client responsible for the request. |
@@ -126,7 +126,7 @@ struct ClientQueryRecord | |||
126 | /** | 126 | /** |
127 | * Replies we have already seen for this request. | 127 | * Replies we have already seen for this request. |
128 | */ | 128 | */ |
129 | GNUNET_HashCode *seen_replies; | 129 | struct GNUNET_HashCode *seen_replies; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Pointer to this nodes heap location in the retry-heap (for fast removal) | 132 | * Pointer to this nodes heap location in the retry-heap (for fast removal) |
@@ -201,7 +201,7 @@ struct ClientMonitorRecord | |||
201 | /** | 201 | /** |
202 | * Key of data of interest, NULL for all. | 202 | * Key of data of interest, NULL for all. |
203 | */ | 203 | */ |
204 | GNUNET_HashCode *key; | 204 | struct GNUNET_HashCode *key; |
205 | 205 | ||
206 | /** | 206 | /** |
207 | * Flag whether to notify about GET messages. | 207 | * Flag whether to notify about GET messages. |
@@ -322,7 +322,7 @@ find_active_client (struct GNUNET_SERVER_Client *client) | |||
322 | * @return GNUNET_YES (we should continue to iterate) | 322 | * @return GNUNET_YES (we should continue to iterate) |
323 | */ | 323 | */ |
324 | static int | 324 | static int |
325 | remove_client_records (void *cls, const GNUNET_HashCode * key, void *value) | 325 | remove_client_records (void *cls, const struct GNUNET_HashCode * key, void *value) |
326 | { | 326 | { |
327 | struct ClientList *client = cls; | 327 | struct ClientList *client = cls; |
328 | struct ClientQueryRecord *record = value; | 328 | struct ClientQueryRecord *record = value; |
@@ -646,7 +646,7 @@ struct RemoveByUniqueIdContext | |||
646 | * @return GNUNET_YES (we should continue to iterate) | 646 | * @return GNUNET_YES (we should continue to iterate) |
647 | */ | 647 | */ |
648 | static int | 648 | static int |
649 | remove_by_unique_id (void *cls, const GNUNET_HashCode * key, void *value) | 649 | remove_by_unique_id (void *cls, const struct GNUNET_HashCode * key, void *value) |
650 | { | 650 | { |
651 | const struct RemoveByUniqueIdContext *ctx = cls; | 651 | const struct RemoveByUniqueIdContext *ctx = cls; |
652 | struct ClientQueryRecord *record = value; | 652 | struct ClientQueryRecord *record = value; |
@@ -718,8 +718,8 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
718 | r->key = NULL; | 718 | r->key = NULL; |
719 | else | 719 | else |
720 | { | 720 | { |
721 | r->key = GNUNET_malloc (sizeof (GNUNET_HashCode)); | 721 | r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode)); |
722 | memcpy (r->key, &msg->key, sizeof (GNUNET_HashCode)); | 722 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
723 | } | 723 | } |
724 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 724 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
725 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 725 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -751,7 +751,7 @@ handle_dht_local_monitor_stop (void *cls, struct GNUNET_SERVER_Client *client, | |||
751 | else | 751 | else |
752 | { | 752 | { |
753 | keys_match = (0 != ntohs(msg->filter_key) | 753 | keys_match = (0 != ntohs(msg->filter_key) |
754 | && !memcmp(r->key, &msg->key, sizeof(GNUNET_HashCode))); | 754 | && !memcmp(r->key, &msg->key, sizeof(struct GNUNET_HashCode))); |
755 | } | 755 | } |
756 | if (find_active_client(client) == r->client | 756 | if (find_active_client(client) == r->client |
757 | && ntohl(msg->type) == r->type | 757 | && ntohl(msg->type) == r->type |
@@ -898,7 +898,7 @@ struct ForwardReplyContext | |||
898 | * if the result is mal-formed, GNUNET_NO | 898 | * if the result is mal-formed, GNUNET_NO |
899 | */ | 899 | */ |
900 | static int | 900 | static int |
901 | forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | 901 | forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) |
902 | { | 902 | { |
903 | struct ForwardReplyContext *frc = cls; | 903 | struct ForwardReplyContext *frc = cls; |
904 | struct ClientQueryRecord *record = value; | 904 | struct ClientQueryRecord *record = value; |
@@ -906,7 +906,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
906 | struct GNUNET_DHT_ClientResultMessage *reply; | 906 | struct GNUNET_DHT_ClientResultMessage *reply; |
907 | enum GNUNET_BLOCK_EvaluationResult eval; | 907 | enum GNUNET_BLOCK_EvaluationResult eval; |
908 | int do_free; | 908 | int do_free; |
909 | GNUNET_HashCode ch; | 909 | struct GNUNET_HashCode ch; |
910 | unsigned int i; | 910 | unsigned int i; |
911 | 911 | ||
912 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) | 912 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) |
@@ -922,7 +922,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
922 | } | 922 | } |
923 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); | 923 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); |
924 | for (i = 0; i < record->seen_replies_count; i++) | 924 | for (i = 0; i < record->seen_replies_count; i++) |
925 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (GNUNET_HashCode))) | 925 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (struct GNUNET_HashCode))) |
926 | { | 926 | { |
927 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 927 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
928 | "Duplicate reply, not passing request for key %s to local client\n", | 928 | "Duplicate reply, not passing request for key %s to local client\n", |
@@ -1017,7 +1017,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
1017 | */ | 1017 | */ |
1018 | void | 1018 | void |
1019 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | 1019 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, |
1020 | const GNUNET_HashCode * key, | 1020 | const struct GNUNET_HashCode * key, |
1021 | unsigned int get_path_length, | 1021 | unsigned int get_path_length, |
1022 | const struct GNUNET_PeerIdentity *get_path, | 1022 | const struct GNUNET_PeerIdentity *get_path, |
1023 | unsigned int put_path_length, | 1023 | unsigned int put_path_length, |
@@ -1104,7 +1104,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1104 | uint32_t desired_replication_level, | 1104 | uint32_t desired_replication_level, |
1105 | unsigned int path_length, | 1105 | unsigned int path_length, |
1106 | const struct GNUNET_PeerIdentity *path, | 1106 | const struct GNUNET_PeerIdentity *path, |
1107 | const GNUNET_HashCode * key) | 1107 | const struct GNUNET_HashCode * key) |
1108 | { | 1108 | { |
1109 | struct ClientMonitorRecord *m; | 1109 | struct ClientMonitorRecord *m; |
1110 | struct ClientList **cl; | 1110 | struct ClientList **cl; |
@@ -1116,7 +1116,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1116 | { | 1116 | { |
1117 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1117 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1118 | (NULL == m->key || | 1118 | (NULL == m->key || |
1119 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1119 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1120 | { | 1120 | { |
1121 | struct PendingMessage *pm; | 1121 | struct PendingMessage *pm; |
1122 | struct GNUNET_DHT_MonitorGetMessage *mmsg; | 1122 | struct GNUNET_DHT_MonitorGetMessage *mmsg; |
@@ -1145,7 +1145,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1145 | mmsg->hop_count = htonl(hop_count); | 1145 | mmsg->hop_count = htonl(hop_count); |
1146 | mmsg->desired_replication_level = htonl(desired_replication_level); | 1146 | mmsg->desired_replication_level = htonl(desired_replication_level); |
1147 | mmsg->get_path_length = htonl(path_length); | 1147 | mmsg->get_path_length = htonl(path_length); |
1148 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1148 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1149 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 1149 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
1150 | if (path_length > 0) | 1150 | if (path_length > 0) |
1151 | memcpy (msg_path, path, | 1151 | memcpy (msg_path, path, |
@@ -1178,7 +1178,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1178 | const struct GNUNET_PeerIdentity *put_path, | 1178 | const struct GNUNET_PeerIdentity *put_path, |
1179 | unsigned int put_path_length, | 1179 | unsigned int put_path_length, |
1180 | struct GNUNET_TIME_Absolute exp, | 1180 | struct GNUNET_TIME_Absolute exp, |
1181 | const GNUNET_HashCode * key, | 1181 | const struct GNUNET_HashCode * key, |
1182 | const void *data, | 1182 | const void *data, |
1183 | size_t size) | 1183 | size_t size) |
1184 | { | 1184 | { |
@@ -1192,7 +1192,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1192 | { | 1192 | { |
1193 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1193 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1194 | (NULL == m->key || | 1194 | (NULL == m->key || |
1195 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1195 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1196 | { | 1196 | { |
1197 | struct PendingMessage *pm; | 1197 | struct PendingMessage *pm; |
1198 | struct GNUNET_DHT_MonitorGetRespMessage *mmsg; | 1198 | struct GNUNET_DHT_MonitorGetRespMessage *mmsg; |
@@ -1232,7 +1232,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1232 | memcpy (path, get_path, | 1232 | memcpy (path, get_path, |
1233 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1233 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1234 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1234 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1235 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1235 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1236 | if (size > 0) | 1236 | if (size > 0) |
1237 | memcpy (&path[get_path_length], data, size); | 1237 | memcpy (&path[get_path_length], data, size); |
1238 | add_pending_message (m->client, pm); | 1238 | add_pending_message (m->client, pm); |
@@ -1265,7 +1265,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1265 | unsigned int path_length, | 1265 | unsigned int path_length, |
1266 | const struct GNUNET_PeerIdentity *path, | 1266 | const struct GNUNET_PeerIdentity *path, |
1267 | struct GNUNET_TIME_Absolute exp, | 1267 | struct GNUNET_TIME_Absolute exp, |
1268 | const GNUNET_HashCode * key, | 1268 | const struct GNUNET_HashCode * key, |
1269 | const void *data, | 1269 | const void *data, |
1270 | size_t size) | 1270 | size_t size) |
1271 | { | 1271 | { |
@@ -1279,7 +1279,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1279 | { | 1279 | { |
1280 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1280 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1281 | (NULL == m->key || | 1281 | (NULL == m->key || |
1282 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1282 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1283 | { | 1283 | { |
1284 | struct PendingMessage *pm; | 1284 | struct PendingMessage *pm; |
1285 | struct GNUNET_DHT_MonitorPutMessage *mmsg; | 1285 | struct GNUNET_DHT_MonitorPutMessage *mmsg; |
@@ -1316,7 +1316,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1316 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 1316 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
1317 | } | 1317 | } |
1318 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1318 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1319 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1319 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1320 | if (size > 0) | 1320 | if (size > 0) |
1321 | memcpy (&msg_path[path_length], data, size); | 1321 | memcpy (&msg_path[path_length], data, size); |
1322 | add_pending_message (m->client, pm); | 1322 | add_pending_message (m->client, pm); |