aboutsummaryrefslogtreecommitdiff
path: root/src/peerstore/gnunet-service-peerstore.c
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-07-24 12:44:24 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-07-24 12:44:24 +0000
commitc057bd312c783e0a2f3783dfd888a66f490b0a30 (patch)
treeff87b7bf7189a723045d7c851d2d383b786724ec /src/peerstore/gnunet-service-peerstore.c
parentf2594744c121f45f3b36867b051220e7186d6f9b (diff)
downloadgnunet-c057bd312c783e0a2f3783dfd888a66f490b0a30.tar.gz
gnunet-c057bd312c783e0a2f3783dfd888a66f490b0a30.zip
peerstore: doxygen
Diffstat (limited to 'src/peerstore/gnunet-service-peerstore.c')
-rw-r--r--src/peerstore/gnunet-service-peerstore.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c
index b7128dda5..c93d2cc95 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -207,26 +207,29 @@ handle_client_disconnect (void *cls,
207 * Function called by for each matching record. 207 * Function called by for each matching record.
208 * 208 *
209 * @param cls closure 209 * @param cls closure
210 * @param peer peer identity 210 * @param record peerstore record found
211 * @param sub_system name of the GNUnet sub system responsible 211 * @param emsg error message or NULL if no errors
212 * @param value stored value 212 * @return #GNUNET_YES to continue iteration
213 * @param size size of stored value
214 */ 213 */
215static int record_iterator(void *cls, 214static int
216 struct GNUNET_PEERSTORE_Record *record, 215record_iterator (void *cls,
217 char *emsg) 216 struct GNUNET_PEERSTORE_Record *record,
217 char *emsg)
218{ 218{
219 struct GNUNET_SERVER_Client *client = cls; 219 struct GNUNET_SERVER_Client *client = cls;
220 struct StoreRecordMessage *srm; 220 struct StoreRecordMessage *srm;
221 221
222 srm = PEERSTORE_create_record_message(record->sub_system, 222 srm =
223 record->peer, 223 PEERSTORE_create_record_message(record->sub_system,
224 record->key, 224 record->peer,
225 record->value, 225 record->key,
226 record->value_size, 226 record->value,
227 record->expiry, 227 record->value_size,
228 GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD); 228 record->expiry,
229 GNUNET_SERVER_notification_context_unicast(nc, client, (struct GNUNET_MessageHeader *)srm, GNUNET_NO); 229 GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD);
230 GNUNET_SERVER_notification_context_unicast (nc, client,
231 (struct GNUNET_MessageHeader *)srm,
232 GNUNET_NO);
230 GNUNET_free(srm); 233 GNUNET_free(srm);
231 return GNUNET_YES; 234 return GNUNET_YES;
232} 235}
@@ -348,17 +351,18 @@ static void handle_iterate (void *cls,
348 GNUNET_SERVER_receive_done(client, GNUNET_SYSERR); 351 GNUNET_SERVER_receive_done(client, GNUNET_SYSERR);
349 return; 352 return;
350 } 353 }
351 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Iterate request: ss `%s', peer `%s', key `%s'\n", 354 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
352 record->sub_system, 355 "Iterate request: ss `%s', peer `%s', key `%s'\n",
353 (NULL == record->peer) ? "NULL" : GNUNET_i2s(record->peer), 356 record->sub_system,
354 (NULL == record->key) ? "NULL" : record->key); 357 (NULL == record->peer) ? "NULL" : GNUNET_i2s(record->peer),
358 (NULL == record->key) ? "NULL" : record->key);
355 GNUNET_SERVER_notification_context_add(nc, client); 359 GNUNET_SERVER_notification_context_add(nc, client);
356 if(GNUNET_OK == db->iterate_records(db->cls, 360 if(GNUNET_OK == db->iterate_records(db->cls,
357 record->sub_system, 361 record->sub_system,
358 record->peer, 362 record->peer,
359 record->key, 363 record->key,
360 &record_iterator, 364 &record_iterator,
361 client)) 365 client))
362 { 366 {
363 endmsg = GNUNET_new(struct GNUNET_MessageHeader); 367 endmsg = GNUNET_new(struct GNUNET_MessageHeader);
364 endmsg->size = htons(sizeof(struct GNUNET_MessageHeader)); 368 endmsg->size = htons(sizeof(struct GNUNET_MessageHeader));