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\n");
+ "Received end of result set, new queue size is %u\n",
+ h->queue_size);
#endif
- free_queue_entry (qe);
if (rc.iter != NULL)
rc.iter (rc.iter_cls,
NULL, 0, NULL, 0, 0, 0,
do_disconnect (h);
return;
}
- GNUNET_DATASTORE_get_next (h, GNUNET_NO);
+ GNUNET_DATASTORE_get_next (h);
return;
}
dm = (const struct DataMessage*) msg;
* from the datastore.
*
* @param h handle to the datastore
- * @param more GNUNET_YES to get moxre results, GNUNET_NO to abort
- * iteration (with a final call to "iter" with key/data == NULL).
*/
void
-GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h,
- int more)
+GNUNET_DATASTORE_get_next (struct GNUNET_DATASTORE_Handle *h)
{
struct GNUNET_DATASTORE_QueueEntry *qe = h->queue_head;
- struct ResultContext rc = qe->qc.rc;
GNUNET_assert (&process_result_message == qe->response_proc);
- if (GNUNET_YES != more)
- {
- qe->qc.rc.iter = NULL;
- qe->qc.rc.iter_cls = NULL;
- if (rc.iter != NULL)
- rc.iter (rc.iter_cls,
- NULL, 0, NULL, 0, 0, 0,
- GNUNET_TIME_UNIT_ZERO_ABS, 0);
- }
h->in_receive = GNUNET_YES;
GNUNET_CLIENT_receive (h->client,
qe->response_proc,
GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe)
{
struct GNUNET_DATASTORE_Handle *h;
- int reconnect;
h = qe->h;
#if DEBUG_DATASTORE
qe->was_transmitted,
h->queue_head == qe);
#endif
- reconnect = GNUNET_NO;
if (GNUNET_YES == qe->was_transmitted)
{
- if (qe->response_proc == &process_result_message)
- {
- qe->qc.rc.iter = NULL;
- if (GNUNET_YES != h->in_receive)
- GNUNET_DATASTORE_get_next (h, GNUNET_YES);
- }
- else
- {
- qe->qc.sc.cont = NULL;
- }
+ free_queue_entry (qe);
+ h->retry_time = GNUNET_TIME_UNIT_ZERO;
+ do_disconnect (h);
return;
}
free_queue_entry (qe);
stored_ops++;
if (stored_bytes < MAX_SIZE)
{
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
return;
}
crc->key = *key;
crc->esize = size;
memcpy (crc->data, data, size);
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
}
GNUNET_assert (priority == get_priority (i));
GNUNET_assert (anonymity == get_anonymity(i));
GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value);
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
}
crc->key = *key;
crc->data = GNUNET_malloc (size);
memcpy (crc->data, data, size);
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
}
#endif
if (priority == get_priority (42))
crc->uid = uid;
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
}
}
else
GNUNET_assert (size == get_size (43));
- GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
+ GNUNET_DATASTORE_get_next (datastore);
}