- GNUNET_assert (GNUNET_YES == qe->was_transmitted);
- 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)) )
- {
- GNUNET_break (0);
- free_queue_entry (qe);
- h->retry_time = GNUNET_TIME_UNIT_ZERO;
- do_disconnect (h);
- if (rc.iter != NULL)
- rc.iter (rc.iter_cls,
- NULL, 0, NULL, 0, 0, 0,
- GNUNET_TIME_UNIT_ZERO_ABS, 0);
- return;
- }
- GNUNET_STATISTICS_update (h->stats,
- gettext_noop ("# Results received"),
- 1,
- GNUNET_NO);
- if (rc.iter == NULL)
- {
- h->result_count++;
- GNUNET_STATISTICS_update (h->stats,
- gettext_noop ("# Excess results received"),
- 1,
- GNUNET_NO);
- if (h->result_count > MAX_EXCESS_RESULTS)
- {
- free_queue_entry (qe);
- GNUNET_STATISTICS_update (h->stats,
- gettext_noop ("# Forced database connection resets"),
- 1,
- GNUNET_NO);
- h->retry_time = GNUNET_TIME_UNIT_ZERO;
- do_disconnect (h);
- return;
- }
- if (GNUNET_YES == qe->one_shot)
- free_queue_entry (qe);
- else
- GNUNET_DATASTORE_iterate_get_next (h);
- return;
- }
- dm = (const struct DataMessage*) msg;
-#if DEBUG_DATASTORE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Received result %llu with type %u and size %u with key %s\n",
- (unsigned long long) GNUNET_ntohll(dm->uid),
- ntohl(dm->type),
- ntohl(dm->size),
- GNUNET_h2s(&dm->key));
-#endif
- if (GNUNET_YES == qe->one_shot)
+ if (GNUNET_YES != qe->was_transmitted)
+ {
+ GNUNET_break (0);
+ free_queue_entry (qe);
+ h->retry_time = GNUNET_TIME_UNIT_ZERO;
+ do_disconnect (h);
+ if (rc.proc != NULL)
+ rc.proc (rc.proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS,
+ 0);
+ 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)))
+ {
+ GNUNET_break (0);