gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3899 - in GNUnet: . src/applications/gap


From: grothoff
Subject: [GNUnet-SVN] r3899 - in GNUnet: . src/applications/gap
Date: Thu, 7 Dec 2006 18:56:42 -0800 (PST)

Author: grothoff
Date: 2006-12-07 18:56:36 -0800 (Thu, 07 Dec 2006)
New Revision: 3899

Modified:
   GNUnet/src/applications/gap/gap.c
   GNUnet/src/applications/gap/pid_table.c
   GNUnet/todo
Log:
fixing rc for pid table

Modified: GNUnet/src/applications/gap/gap.c
===================================================================
--- GNUnet/src/applications/gap/gap.c   2006-12-07 23:32:03 UTC (rev 3898)
+++ GNUnet/src/applications/gap/gap.c   2006-12-08 02:56:36 UTC (rev 3899)
@@ -493,10 +493,11 @@
     ranking = 0; /* no chance for blocked peers */
   idx = getIndex(id);
 #if DEBUG_GAP
-  GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-      "Ranking for %u: %u\n",
-      idx,
-      ranking);
+  GE_LOG(ectx,
+        GE_DEBUG | GE_REQUEST | GE_USER,
+        "Ranking for %u: %u\n",
+        idx,
+        ranking);
 #endif
   qr->rankings[idx] = ranking;
   change_pid_rc(id, -1);
@@ -544,15 +545,17 @@
 
   if (getBit(qr, getIndex(id)) == 1) {
 #if DEBUG_GAP
-    IF_GELOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-         hash2enc(&peer->hashPubKey,
-                  &encp);
-         hash2enc(&qr->msg->queries[0],
-                  &encq));
-    GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-       "Sending query `%s' to `%s'\n",
-       &encq,
-       &encp);
+    IF_GELOG(ectx, 
+            GE_DEBUG | GE_REQUEST | GE_USER,
+            hash2enc(&peer->hashPubKey,
+                     &encp);
+            hash2enc(&qr->msg->queries[0],
+                     &encq));
+    GE_LOG(ectx, 
+          GE_DEBUG | GE_REQUEST | GE_USER,
+          "Sending query `%s' to `%s'\n",
+          &encq,
+          &encp);
 #endif
     if (stats != NULL)
       stats->change(stat_routing_forwards, 1);
@@ -632,6 +635,9 @@
     }
   }
   if (oldestIndex == -1) {                             
+    memset(&dummy,
+          0,
+          sizeof(QueryRecord));
     qr = &dummy;
   } else {
     qr = &queries[oldestIndex];
@@ -648,6 +654,8 @@
     memset(&qr->bitmap[0],
           0,
           BITMAP_SIZE);
+    if (qr->noTarget != 0)
+      change_pid_rc(qr->noTarget, -1);
     if (excludePeer != NULL)
       qr->noTarget = intern_pid(excludePeer);
     else
@@ -688,8 +696,10 @@
     coreAPI->forAllConnectedNodes
       (&sendToSelected,
        qr);
-    if (qr == &dummy)
+    if (qr == &dummy) {      
+      change_pid_rc(dummy.noTarget, -1);
       FREE(dummy.msg);
+    }
   }
   MUTEX_UNLOCK(lock);
 }
@@ -941,7 +951,8 @@
        if (ite->destination[i] == sender)
          return SYSERR;
       if (ite->hostsWaiting >= MAX_HOSTS_WAITING) {
-       decrement_pid_rcs(ite->destination, ite->hostsWaiting);
+       decrement_pid_rcs(ite->destination, 
+                         ite->hostsWaiting);
        if (stats != NULL)
          stats->change(stat_memory_destinations, - ite->hostsWaiting);
        GROW(ite->destination,
@@ -955,7 +966,8 @@
       ite->primaryKey = *query;
       if (stats != NULL)
        stats->change(stat_memory_destinations, - ite->hostsWaiting);
-      decrement_pid_rcs(ite->destination, ite->hostsWaiting);
+      decrement_pid_rcs(ite->destination, 
+                       ite->hostsWaiting);
       GROW(ite->destination,
           ite->hostsWaiting,
           0);
@@ -1303,12 +1315,14 @@
     resolve_pid(ite->destination[j],
                &recv);
 #if DEBUG_GAP
-    IF_GELOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-         hash2enc(&recv.hashPubKey,
-                  &enc));
-    GE_LOG(ectx, GE_DEBUG | GE_REQUEST | GE_USER,
-       "GAP sending reply to `%s'\n",
-       &enc);
+    IF_GELOG(ectx, 
+            GE_DEBUG | GE_REQUEST | GE_USER,
+            hash2enc(&recv.hashPubKey,
+                     &enc));
+    GE_LOG(ectx, 
+          GE_DEBUG | GE_REQUEST | GE_USER,
+          "GAP sending reply to `%s'\n",
+          &enc);
 #endif
     coreAPI->unicast(&recv,
                     msg,

Modified: GNUnet/src/applications/gap/pid_table.c
===================================================================
--- GNUnet/src/applications/gap/pid_table.c     2006-12-07 23:32:03 UTC (rev 
3898)
+++ GNUnet/src/applications/gap/pid_table.c     2006-12-08 02:56:36 UTC (rev 
3899)
@@ -39,9 +39,14 @@
 static struct GE_Context * ectx;
 
 typedef struct {
-  /** the identifier itself */
+  /**
+   * the identifier itself 
+   */
   HashCode512 id;
-  /** reference counter */
+
+  /**
+   * reference counter 
+   */
   unsigned int rc;
 } PID_Entry;
 
@@ -88,11 +93,11 @@
   GE_ASSERT(ectx, ret < size);
   table[ret].id = pid->hashPubKey;
   table[ret].rc = 1;
+  MUTEX_UNLOCK(lock);
   if (stats != NULL) {
     stats->change(stat_pid_rc, 1);
     stats->change(stat_pid_entries, 1);
   }
-  MUTEX_UNLOCK(lock);
   return ret;
 }
 

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-12-07 23:32:03 UTC (rev 3898)
+++ GNUnet/todo 2006-12-08 02:56:36 UTC (rev 3899)
@@ -13,8 +13,6 @@
 
 
 0.7.1 [12'06] (aka "stabilization")
-- core:
-  * # total RC of interned peer IDs in pid table -- why so big? [RCpre2]
 - finish util refactoring:
   * gnunet-setup ncurses wizard [RCpre2]
 - more testcases: [RCpre3]
@@ -22,24 +20,24 @@
   * gap (incl. economy)
   * fs/namespaces
   * fs/collection
-  * tracekit
   * advertising
-  * rpc
 - fix critical known bugs:
   * Windows installer [Nils]
     + uninstall: Remove account
-    + libcurl, guile [RCpre0]
+    + libcurl, guile
   * file/socket leak (#955) - possibly fixed
 
 0.7.2 [3'07]:
 - Transports:
   * SMTP/HTTP (using libcurl, libmicrohttpd, libesmtp)
-- Testcases not compiling or passing:
+- Testcases (fix, add):
   * dht/tools
+  * tracekit
 - Scheme (scm) specification of entire configuration;
   check options used in modules:
   - DHT options
   - kvstore
+  - gnunet-gtk
 - Features:
   * SMTP logger
   * Chat support [RC]
@@ -64,6 +62,8 @@
   as keyword (to allow getting meta-data from URI only)
 - Documentation:
   * LJ article
+- Testcases:
+  * RPC
 
 0.7.4 [12'07] (aka "advanced features"):
 - gnunet-chat [ RC ]





reply via email to

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