[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r15659 - gnunet/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r15659 - gnunet/src/fs |
Date: |
Thu, 16 Jun 2011 14:05:47 +0200 |
Author: grothoff
Date: 2011-06-16 14:05:46 +0200 (Thu, 16 Jun 2011)
New Revision: 15659
Modified:
gnunet/src/fs/gnunet-service-fs_pr.c
Log:
fix
Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c 2011-06-16 12:02:03 UTC (rev
15658)
+++ gnunet/src/fs/gnunet-service-fs_pr.c 2011-06-16 12:05:46 UTC (rev
15659)
@@ -31,6 +31,10 @@
#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.
@@ -141,7 +145,7 @@
/**
* Do we have a first UID yet?
*/
- int have_first_uid;
+ unsigned int have_first_uid;
};
@@ -1145,7 +1149,7 @@
if (GNUNET_NO == pr->have_first_uid)
{
pr->first_uid = uid;
- pr->have_first_uid = GNUNET_YES;
+ pr->have_first_uid = 1;
}
else
{
@@ -1157,6 +1161,15 @@
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)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r15659 - gnunet/src/fs,
gnunet <=