aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-16 13:46:20 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-16 13:46:20 +0000
commitb463799cce828b69dc55f02b4280b67010dd9f77 (patch)
tree767f90f125f9751407b7c8dd3b25851418cf7011 /src/fs
parent3a8feedfbc1c8f2a3db82e4e0a117388ff1f316e (diff)
downloadgnunet-b463799cce828b69dc55f02b4280b67010dd9f77.tar.gz
gnunet-b463799cce828b69dc55f02b4280b67010dd9f77.zip
fix
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-service-fs_pr.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 2a6897cfb..d8c4340fb 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1150,33 +1150,43 @@ process_local_reply (void *cls,
1150 struct ProcessReplyClosure prq; 1150 struct ProcessReplyClosure prq;
1151 GNUNET_HashCode query; 1151 GNUNET_HashCode query;
1152 unsigned int old_rf; 1152 unsigned int old_rf;
1153 1153
1154 pr->qe = NULL;
1155 GNUNET_SCHEDULER_cancel (pr->warn_task); 1154 GNUNET_SCHEDULER_cancel (pr->warn_task);
1156 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 1155 pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
1157 if (GNUNET_NO == pr->have_first_uid) 1156 if (NULL != pr->qe)
1158 {
1159 pr->first_uid = uid;
1160 pr->have_first_uid = 1;
1161 }
1162 else
1163 { 1157 {
1164 if (uid == pr->first_uid) 1158 pr->qe = NULL;
1159 if (NULL == key)
1165 { 1160 {
1166 GNUNET_STATISTICS_update (GSF_stats, 1161 GNUNET_STATISTICS_update (GSF_stats,
1167 gettext_noop ("# Datastore lookups concluded"), 1162 gettext_noop ("# Datastore lookups concluded (no results)"),
1168 1, 1163 1,
1169 GNUNET_NO); 1164 GNUNET_NO);
1170 key = NULL; /* all replies seen! */
1171 } 1165 }
1172 pr->have_first_uid++; 1166 if (GNUNET_NO == pr->have_first_uid)
1173 if (pr->have_first_uid > MAX_RESULTS)
1174 { 1167 {
1175 GNUNET_STATISTICS_update (GSF_stats, 1168 pr->first_uid = uid;
1176 gettext_noop ("# Datastore lookups aborted (more than MAX_RESULTS)"), 1169 pr->have_first_uid = 1;
1177 1, 1170 }
1178 GNUNET_NO); 1171 else
1179 key = NULL; /* all replies seen! */ 1172 {
1173 if ( (uid == pr->first_uid) && (key != NULL) )
1174 {
1175 GNUNET_STATISTICS_update (GSF_stats,
1176 gettext_noop ("# Datastore lookups concluded (seen all)"),
1177 1,
1178 GNUNET_NO);
1179 key = NULL; /* all replies seen! */
1180 }
1181 pr->have_first_uid++;
1182 if ( (pr->have_first_uid > MAX_RESULTS) && (key != NULL) )
1183 {
1184 GNUNET_STATISTICS_update (GSF_stats,
1185 gettext_noop ("# Datastore lookups aborted (more than MAX_RESULTS)"),
1186 1,
1187 GNUNET_NO);
1188 key = NULL; /* all replies seen! */
1189 }
1180 } 1190 }
1181 } 1191 }
1182 if (NULL == key) 1192 if (NULL == key)
@@ -1250,7 +1260,13 @@ process_local_reply (void *cls,
1250 &process_local_reply, 1260 &process_local_reply,
1251 pr); 1261 pr);
1252 if (NULL != pr->qe) 1262 if (NULL != pr->qe)
1253 return; /* we're done */ 1263 {
1264 GNUNET_STATISTICS_update (GSF_stats,
1265 gettext_noop ("# Datastore lookups concluded (error queueing)"),
1266 1,
1267 GNUNET_NO);
1268 return; /* we're done */
1269 }
1254 goto check_error_and_continue; 1270 goto check_error_and_continue;
1255 } 1271 }
1256 old_rf = pr->public_data.results_found; 1272 old_rf = pr->public_data.results_found;