aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_pe.c')
-rw-r--r--src/fs/gnunet-service-fs_pe.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index beb435c0c..ede109c2d 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -355,18 +355,23 @@ get_latest (const struct GSF_RequestPlan *rp)
355{ 355{
356 struct GSF_PendingRequest *ret; 356 struct GSF_PendingRequest *ret;
357 struct GSF_PendingRequestPlanBijection *bi; 357 struct GSF_PendingRequestPlanBijection *bi;
358 const struct GSF_PendingRequestData *rprd;
359 const struct GSF_PendingRequestData *prd;
358 360
359 bi = rp->pe_head; 361 bi = rp->pe_head;
360 if (NULL == bi) 362 if (NULL == bi)
361 return NULL; /* should never happen */ 363 return NULL; /* should never happen */
362 ret = bi->pr; 364 ret = bi->pr;
363 bi = bi->next_PE; 365 rprd = GSF_pending_request_get_data_ (ret);
364 while (NULL != bi) 366 for (bi = bi->next_PE; NULL != bi; bi = bi->next_PE)
365 { 367 {
366 if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us > 368 prd = GSF_pending_request_get_data_ (bi->pr);
367 GSF_pending_request_get_data_ (ret)->ttl.abs_value_us) 369 if (prd->ttl.abs_value_us >
370 rprd->ttl.abs_value_us)
371 {
368 ret = bi->pr; 372 ret = bi->pr;
369 bi = bi->next_PE; 373 rprd = prd;
374 }
370 } 375 }
371 return ret; 376 return ret;
372} 377}