aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/datastore_api.c')
-rw-r--r--src/datastore/datastore_api.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index c67b7556a..4fc719629 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -215,6 +215,12 @@ with_status_response_handler (void *cls,
215 } 215 }
216 } 216 }
217 h->response_proc = NULL; 217 h->response_proc = NULL;
218#if VERBOSE
219 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
220 "Received status %d/%s\n",
221 status,
222 emsg);
223#endif
218 cont (h->response_proc_cls, 224 cont (h->response_proc_cls,
219 status, 225 status,
220 emsg); 226 emsg);
@@ -251,6 +257,11 @@ transmit_get_status (void *cls,
251 } 257 }
252 GNUNET_assert (h->message_size <= size); 258 GNUNET_assert (h->message_size <= size);
253 memcpy (buf, &h[1], h->message_size); 259 memcpy (buf, &h[1], h->message_size);
260#if VERBOSE
261 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
262 "Transmitted %u byte message to datastore service, now waiting for status.\n",
263 h->message_size);
264#endif
254 h->message_size = 0; 265 h->message_size = 0;
255 GNUNET_CLIENT_receive (h->client, 266 GNUNET_CLIENT_receive (h->client,
256 &with_status_response_handler, 267 &with_status_response_handler,
@@ -284,6 +295,12 @@ transmit_for_status (struct GNUNET_DATASTORE_Handle *h,
284 295
285 hdr = (const struct GNUNET_MessageHeader*) &h[1]; 296 hdr = (const struct GNUNET_MessageHeader*) &h[1];
286 msize = ntohs(hdr->size); 297 msize = ntohs(hdr->size);
298#if VERBOSE
299 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
300 "Transmitting %u byte message of type %u to datastore service\n",
301 msize,
302 ntohs(hdr->type));
303#endif
287 GNUNET_assert (h->response_proc == NULL); 304 GNUNET_assert (h->response_proc == NULL);
288 h->response_proc = cont; 305 h->response_proc = cont;
289 h->response_proc_cls = cont_cls; 306 h->response_proc_cls = cont_cls;
@@ -485,6 +502,10 @@ with_result_response_handler (void *cls,
485 { 502 {
486 GNUNET_break (ntohs(msg->size) == sizeof(struct GNUNET_MessageHeader)); 503 GNUNET_break (ntohs(msg->size) == sizeof(struct GNUNET_MessageHeader));
487 h->response_proc = NULL; 504 h->response_proc = NULL;
505#if VERBOSE
506 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
507 "Received end of result set\n");
508#endif
488 cont (h->response_proc_cls, 509 cont (h->response_proc_cls,
489 NULL, 0, NULL, 0, 0, 0, zero, 0); 510 NULL, 0, NULL, 0, 0, 0, zero, 0);
490 return; 511 return;
@@ -512,6 +533,14 @@ with_result_response_handler (void *cls,
512 NULL, 0, NULL, 0, 0, 0, zero, 0); 533 NULL, 0, NULL, 0, 0, 0, zero, 0);
513 return; 534 return;
514 } 535 }
536#if VERBOSE
537 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
538 "Received result %llu with type %u and size %u with key %s\n",
539 (unsigned long long) GNUNET_ntohll(dm->uid),
540 ntohl(dm->type),
541 msize,
542 GNUNET_h2s(&dm->key));
543#endif
515 cont (h->response_proc_cls, 544 cont (h->response_proc_cls,
516 &dm->key, 545 &dm->key,
517 msize, 546 msize,
@@ -558,6 +587,11 @@ transmit_get_result (void *cls,
558 } 587 }
559 GNUNET_assert (h->message_size <= size); 588 GNUNET_assert (h->message_size <= size);
560 memcpy (buf, &h[1], h->message_size); 589 memcpy (buf, &h[1], h->message_size);
590#if VERBOSE
591 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
592 "Transmitted %u byte message to datastore service, now waiting for result.\n",
593 h->message_size);
594#endif
561 h->message_size = 0; 595 h->message_size = 0;
562 GNUNET_CLIENT_receive (h->client, 596 GNUNET_CLIENT_receive (h->client,
563 &with_result_response_handler, 597 &with_result_response_handler,
@@ -592,6 +626,12 @@ transmit_for_result (struct GNUNET_DATASTORE_Handle *h,
592 626
593 hdr = (const struct GNUNET_MessageHeader*) &h[1]; 627 hdr = (const struct GNUNET_MessageHeader*) &h[1];
594 msize = ntohs(hdr->size); 628 msize = ntohs(hdr->size);
629#if VERBOSE
630 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
631 "Transmitting %u byte message of type %u to datastore service\n",
632 msize,
633 ntohs(hdr->type));
634#endif
595 GNUNET_assert (h->response_proc == NULL); 635 GNUNET_assert (h->response_proc == NULL);
596 h->response_proc = cont; 636 h->response_proc = cont;
597 h->response_proc_cls = cont_cls; 637 h->response_proc_cls = cont_cls;