- {
- was_transmitted = qe->was_transmitted;
- free_queue_entry (qe);
- if (was_transmitted == GNUNET_YES)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("Failed to receive response from database.\n"));
- do_disconnect (h);
- }
- else
- {
-#if DEBUG_DATASTORE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Request dropped due to finite datastore queue length.\n");
-#endif
- }
- if (rc.iter != NULL)
- rc.iter (rc.iter_cls,
- NULL, 0, NULL, 0, 0, 0,
- GNUNET_TIME_UNIT_ZERO_ABS, 0);
- return;
- }
- GNUNET_assert (GNUNET_YES == qe->was_transmitted);
- GNUNET_assert (h->queue_head == qe);
- if (ntohs(msg->type) == GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END)
- {
- GNUNET_break (ntohs(msg->size) == sizeof(struct GNUNET_MessageHeader));
- free_queue_entry (qe);
-#if DEBUG_DATASTORE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received end of result set, new queue size is %u\n",
- h->queue_size);
-#endif
- if (rc.iter != NULL)
- rc.iter (rc.iter_cls,
- NULL, 0, NULL, 0, 0, 0,
- GNUNET_TIME_UNIT_ZERO_ABS, 0);
- h->retry_time.rel_value = 0;
- h->result_count = 0;
- process_queue (h);
- return;
- }
- if ( (ntohs(msg->size) < sizeof(struct DataMessage)) ||
- (ntohs(msg->type) != GNUNET_MESSAGE_TYPE_DATASTORE_DATA) ||
- (ntohs(msg->size) != sizeof(struct DataMessage) + ntohl (((const struct DataMessage*)msg)->size)) )