gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17600 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r17600 - gnunet/src/fs
Date: Wed, 19 Oct 2011 14:39:01 +0200

Author: grothoff
Date: 2011-10-19 14:39:01 +0200 (Wed, 19 Oct 2011)
New Revision: 17600

Modified:
   gnunet/src/fs/gnunet-service-fs_cp.c
   gnunet/src/fs/perf_gnunet_service_fs_p2p.c
Log:
cleanup+stats

Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c        2011-10-19 12:26:57 UTC (rev 
17599)
+++ gnunet/src/fs/gnunet-service-fs_cp.c        2011-10-19 12:39:01 UTC (rev 
17600)
@@ -551,6 +551,11 @@
   struct GSF_ConnectedPeer *cp = cls;
   struct GSF_PeerTransmitHandle *pth;
 
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "fs-ats-r",
+                  "Reserved %d bytes / need to wait %llu ms for reservation\n",
+                  (int) amount,
+                  (unsigned long long) res_delay.rel_value);
   cp->rc = NULL;
   if (0 == amount)
   {
@@ -590,6 +595,10 @@
   char *fn;
   uint32_t trust;
 
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG,
+                  "fs-ats-r",
+                  "Connected to peer %s\n",
+                  GNUNET_i2s (peer));
   cp = GNUNET_malloc (sizeof (struct GSF_ConnectedPeer));
   cp->ppd.pid = GNUNET_PEER_intern (peer);
   cp->ppd.transmission_delay = GNUNET_LOAD_value_init (GNUNET_TIME_UNIT_ZERO);
@@ -607,6 +616,11 @@
                 GNUNET_CONTAINER_multihashmap_put (cp_map, &peer->hashPubKey,
                                                    cp,
                                                    
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+  GNUNET_STATISTICS_set (GSF_stats,
+                        gettext_noop
+                        ("# connected peers"), 
+                        GNUNET_CONTAINER_multihashmap_size (cp_map),
+                        GNUNET_NO);
   update_atsi (cp, atsi);
   GSF_push_start_ (cp);
   return cp;
@@ -677,7 +691,7 @@
   struct GNUNET_TIME_Relative bt;
 
   msm = (const struct MigrationStopMessage *) message;
-  cp = GNUNET_CONTAINER_multihashmap_get (cp_map, &other->hashPubKey);
+  cp = GSF_peer_get_ (other);
   if (cp == NULL)
   {
     GNUNET_break (0);
@@ -1151,7 +1165,7 @@
   GSF_cover_query_count++;
   bm = ntohl (gm->hash_bitmap);
   bits = 0;
-  cps = GNUNET_CONTAINER_multihashmap_get (cp_map, &other->hashPubKey);
+  cps = GSF_peer_get_ (other);
   if (NULL == cps)
   {
     /* peer must have just disconnected */
@@ -1162,7 +1176,7 @@
     return NULL;
   }
   if (0 != (bm & GET_MESSAGE_BIT_RETURN_TO))
-    cp = GNUNET_CONTAINER_multihashmap_get (cp_map, &opt[bits++]);
+    cp = GSF_peer_get_ ((const struct GNUNET_PeerIdentity*) &opt[bits++]);
   else
     cp = cps;
   if (cp == NULL)
@@ -1521,13 +1535,18 @@
   struct GSF_PeerTransmitHandle *pth;
   struct GSF_DelayedHandle *dh;
 
-  cp = GNUNET_CONTAINER_multihashmap_get (cp_map, &peer->hashPubKey);
+  cp = GSF_peer_get_ (peer);
   if (NULL == cp)
     return;                     /* must have been disconnect from core with
                                  * 'peer' == my_id, ignore */
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_CONTAINER_multihashmap_remove (cp_map,
                                                        &peer->hashPubKey, cp));
+  GNUNET_STATISTICS_set (GSF_stats,
+                        gettext_noop
+                        ("# connected peers"), 
+                        GNUNET_CONTAINER_multihashmap_size (cp_map),
+                        GNUNET_NO);
   if (NULL != cp->migration_pth)
   {
     GSF_peer_transmit_cancel_ (cp->migration_pth);

Modified: gnunet/src/fs/perf_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2011-10-19 12:26:57 UTC (rev 
17599)
+++ gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2011-10-19 12:39:01 UTC (rev 
17600)
@@ -32,7 +32,7 @@
 /**
  * File-size we use for testing.
  */
-#define FILESIZE (1024 * 1024 * 1)
+#define FILESIZE (1024 * 1024 * 10)
 
 /**
  * How long until we give up on transmitting the message?




reply via email to

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