gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11042 - gnunet/src/arm


From: gnunet
Subject: [GNUnet-SVN] r11042 - gnunet/src/arm
Date: Thu, 22 Apr 2010 16:58:36 +0200

Author: nevans
Date: 2010-04-22 16:58:36 +0200 (Thu, 22 Apr 2010)
New Revision: 11042

Modified:
   gnunet/src/arm/arm_api.c
   gnunet/src/arm/gnunet-service-arm.c
Log:
remove reference counts

Modified: gnunet/src/arm/arm_api.c
===================================================================
--- gnunet/src/arm/arm_api.c    2010-04-22 14:56:50 UTC (rev 11041)
+++ gnunet/src/arm/arm_api.c    2010-04-22 14:58:36 UTC (rev 11042)
@@ -399,10 +399,11 @@
 {
   struct RequestContext *sctx;
   size_t slen;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+#if DEBUG_ARM
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               _("Asked to start service `%s' within %llu ms\n"), service_name,
              (unsigned long long) timeout.value);
+#endif
   if (0 == strcasecmp ("arm", service_name))
     {
       slen = strlen ("arm") + 1;
@@ -592,6 +593,8 @@
 /**
  * Stop multiple services in the specified order.  Convenience
  * function.  Works asynchronously, failures are not reported.
+ * Should normally only be called from gnunet-arm or testcases,
+ * stopping a service is generally otherwise a bad idea.
  *
  * @param cfg configuration to use (needed to contact ARM;
  *        the ARM service may internally use a different

Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2010-04-22 14:56:50 UTC (rev 11041)
+++ gnunet/src/arm/gnunet-service-arm.c 2010-04-22 14:58:36 UTC (rev 11042)
@@ -112,12 +112,14 @@
    */
   struct GNUNET_TIME_Absolute restartAt;
 
+#if RC
   /**
    * Reference counter (counts how many times we've been
    * asked to start the service).  We only actually stop
    * it once rc hits zero.
    */
   unsigned int rc;
+#endif
 
 };
 
@@ -468,9 +470,11 @@
   if (sl != NULL)
     {
       /* already running, just increment RC */
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  _("Service `%s' already running.\n"), servicename);
+#if RC
       sl->rc++;
+#endif
       sl->next = running;
       running = sl;
       signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_UP);
@@ -504,7 +508,9 @@
   sl = GNUNET_malloc (sizeof (struct ServiceList));
   sl->name = GNUNET_strdup (servicename);
   sl->next = running;
+#if RC
   sl->rc = 1;
+#endif
   sl->binary = binary;
   sl->config = config;
   sl->mtime = sbuf.st_mtime;
@@ -538,6 +544,7 @@
       GNUNET_SERVER_receive_done (client, GNUNET_OK);
       return;
     }
+#if RC
   if (pos->rc > 1)
     {
       /* RC>1, just decrement RC */
@@ -555,6 +562,7 @@
     }
   if (pos->rc == 1)
     pos->rc--;                 /* decrement RC to zero */
+#endif
   if (pos->killing_client != NULL)
     {
       /* killing already in progress */





reply via email to

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