gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6260 - GNUnet/src/applications/fs/gap


From: gnunet
Subject: [GNUnet-SVN] r6260 - GNUnet/src/applications/fs/gap
Date: Mon, 11 Feb 2008 21:52:41 -0700 (MST)

Author: grothoff
Date: 2008-02-11 21:52:41 -0700 (Mon, 11 Feb 2008)
New Revision: 6260

Modified:
   GNUnet/src/applications/fs/gap/fs.c
   GNUnet/src/applications/fs/gap/gap.c
   GNUnet/src/applications/fs/gap/plan.c
Log:
ptrs

Modified: GNUnet/src/applications/fs/gap/fs.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs.c 2008-02-12 04:52:22 UTC (rev 6259)
+++ GNUnet/src/applications/fs/gap/fs.c 2008-02-12 04:52:41 UTC (rev 6260)
@@ -622,8 +622,12 @@
       ttl -= 2 * TTL_DECREMENT +
         GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, TTL_DECREMENT);
     }
+  fprintf(stderr,
+         "TTL in: %d out: %d (prio: %u)\n", 
+         ntohl(req->type),
+         ttl, 
+         prio);
 
-
   preference = (double) prio;
   if (preference < QUERY_BANDWIDTH_VALUE)
     preference = QUERY_BANDWIDTH_VALUE;

Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c        2008-02-12 04:52:22 UTC (rev 
6259)
+++ GNUnet/src/applications/fs/gap/gap.c        2008-02-12 04:52:41 UTC (rev 
6260)
@@ -255,8 +255,10 @@
   rl->response_target = GNUNET_FS_PT_intern (respond_to);
   table[index] = rl;
   fprintf(stderr,
-         "GAP creates RT entry `%p' for query from `%u' in slot %u\n",
+         "GAP creates RT entry `%p' for query with ttl %d prio %u from `%u' in 
slot %u\n",
          rl,
+         ttl, 
+         priority,
          rl->response_target,
          index);
 

Modified: GNUnet/src/applications/fs/gap/plan.c
===================================================================
--- GNUnet/src/applications/fs/gap/plan.c       2008-02-12 04:52:22 UTC (rev 
6259)
+++ GNUnet/src/applications/fs/gap/plan.c       2008-02-12 04:52:41 UTC (rev 
6260)
@@ -313,7 +313,10 @@
   else
     {
       entry->next = pos->next;
-      pos->next->prev = entry;
+      if (pos->next == NULL)
+       qpl->tail = entry;
+      else
+       pos->next->prev = entry;
       entry->prev = pos;
       pos->next = entry;
     }
@@ -347,7 +350,7 @@
   GNUNET_CronTime now;
   GNUNET_CronTime last;
   unsigned int prio;
-  unsigned int ttl;
+  int ttl;
   unsigned int allowable_prio;
   long long score;
 
@@ -420,6 +423,8 @@
       if (ttl > 0)              /* integer underflow */
         ttl = -(1 << 30);
     }
+  fprintf(stderr,
+         "Plan's TTL is %d (%u)\n", ttl, prio);
   ttl = GNUNET_FS_HELPER_bound_ttl (ttl, prio);
   rank->prio = prio;
   rank->ttl = ttl;
@@ -538,10 +543,12 @@
           if (rank->score > selector)
             {
              fprintf(stderr,
-                     "Adding query from %p/%u to plan for peer %u\n",
+                     "Adding query from %p/%u to plan for peer %u with ttl %d 
and prio %u\n",
                      client,
                      peer,
-                     rank->peer);
+                     rank->peer,
+                     rank->ttl,
+                     rank->prio);
               add_request (rank->peer, request, rank->ttl, rank->prio);
               total_score -= rank->score;
               rank->score = 0;  /* mark as used */
@@ -587,9 +594,10 @@
   if (size > available)
     return 0;
   fprintf(stderr,
-         "Adding request to send buffer (plan.c)\n");
+         "Adding request to send buffer (plan.c) with TTL %d (%d) and prio 
%u\n",
+         ttl, GNUNET_FS_HELPER_bound_ttl(ttl, prio), prio);
   if ((prio > req->remaining_value) && (req->response_client == NULL))
-    prio = req->remaining_value;
+    prio = req->remaining_value; 
   ttl = GNUNET_FS_HELPER_bound_ttl (ttl, prio);
   msg->header.size = htons (size);
   msg->header.type = htons (GNUNET_P2P_PROTO_GAP_QUERY);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]