#include "gnunet-service-fs_pe.h"
#include "gnunet-service-fs_pr.h"
+/**
+ * Hard limit on the number of results we may get from the datastore per query.
+ */
+#define MAX_RESULTS (100 * 1024)
/**
* An active request.
/**
* Do we have a first UID yet?
*/
- int have_first_uid;
+ unsigned int have_first_uid;
};
if (GNUNET_NO == pr->have_first_uid)
{
pr->first_uid = uid;
- pr->have_first_uid = GNUNET_YES;
+ pr->have_first_uid = 1;
}
else
{
GNUNET_NO);
key = NULL; /* all replies seen! */
}
+ pr->have_first_uid++;
+ if (pr->have_first_uid > MAX_RESULTS)
+ {
+ GNUNET_STATISTICS_update (GSF_stats,
+ gettext_noop ("# Datastore lookups aborted (more than MAX_RESULTS)"),
+ 1,
+ GNUNET_NO);
+ key = NULL; /* all replies seen! */
+ }
}
if (NULL == key)
{