gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20293 - gnunet/src/statistics


From: gnunet
Subject: [GNUnet-SVN] r20293 - gnunet/src/statistics
Date: Mon, 5 Mar 2012 22:01:09 +0100

Author: grothoff
Date: 2012-03-05 22:01:09 +0100 (Mon, 05 Mar 2012)
New Revision: 20293

Modified:
   gnunet/src/statistics/gnunet-service-statistics.c
Log:
-fixing #2196

Modified: gnunet/src/statistics/gnunet-service-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-service-statistics.c   2012-03-05 20:33:07 UTC 
(rev 20292)
+++ gnunet/src/statistics/gnunet-service-statistics.c   2012-03-05 21:01:09 UTC 
(rev 20293)
@@ -391,6 +391,11 @@
       return ce;
     ce = ce->next;
   }
+  if (NULL == nc)
+  {
+    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    return NULL;
+  }
   ce = GNUNET_malloc (sizeof (struct ClientEntry));
   ce->client = client;
   GNUNET_SERVER_client_keep (client);
@@ -419,8 +424,9 @@
   struct StatsEntry *pos;
   size_t size;
 
-  if (client != NULL)
-    make_client_entry (client);
+  if ( (NULL != client) &&
+       (NULL == make_client_entry (client)) )
+    return; /* new client during shutdown */
   size = ntohs (message->size) - sizeof (struct GNUNET_MessageHeader);
   if (size !=
       GNUNET_STRINGS_buffer_tokenize ((const char *) &message[1], size, 2,
@@ -494,8 +500,9 @@
   int64_t delta;
   int changed;
 
-  if (client != NULL)
-    make_client_entry (client);
+  if ( (NULL != client) &&
+       (NULL == make_client_entry (client)) )
+    return; /* new client during shutdown */
   msize = ntohs (message->size);
   if (msize < sizeof (struct GNUNET_STATISTICS_SetMessage))
   {
@@ -606,6 +613,11 @@
   struct WatchEntry *we;
   size_t slen;
 
+  if (NULL == nc)
+  {
+    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    return;
+  }
   ce = make_client_entry (client);
   msize = ntohs (message->size);
   if (msize < sizeof (struct GNUNET_MessageHeader))
@@ -672,8 +684,11 @@
   struct StatsEntry *se;
 
   save ();
-  GNUNET_SERVER_notification_context_destroy (nc);
-  nc = NULL;
+  if (NULL != nc)
+  {
+    GNUNET_SERVER_notification_context_destroy (nc);
+    nc = NULL;
+  }
   GNUNET_assert (NULL == client_head);
   while (NULL != (se = start))
   {




reply via email to

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