gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21394 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r21394 - gnunet/src/core
Date: Wed, 9 May 2012 20:41:51 +0200

Author: grothoff
Date: 2012-05-09 20:41:51 +0200 (Wed, 09 May 2012)
New Revision: 21394

Modified:
   gnunet/src/core/core_api.c
Log:
-fixing #2332, plus some minor refactoring

Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c  2012-05-09 18:27:14 UTC (rev 21393)
+++ gnunet/src/core/core_api.c  2012-05-09 18:41:51 UTC (rev 21394)
@@ -576,6 +576,13 @@
      * us from the 'ready' list */
     GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, h->ready_peer_tail, pr);
   }
+  if (NULL != th->cm)
+  {
+     /* we're currently in the control queue, remove */
+    GNUNET_CONTAINER_DLL_remove (h->control_pending_head,
+                                 h->control_pending_tail, th->cm);
+    GNUNET_free (th->cm);
+  }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Signalling timeout of request for transmission to CORE service\n");
   request_next_transmission (pr);
@@ -1225,7 +1232,7 @@
   struct ControlMessage *cm;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from CORE service\n");
-  if (handle->cth != NULL)
+  if (NULL != handle->cth)
   {
     GNUNET_CLIENT_notify_transmit_ready_cancel (handle->cth);
     handle->cth = NULL;
@@ -1234,13 +1241,13 @@
   {
     GNUNET_CONTAINER_DLL_remove (handle->control_pending_head,
                                  handle->control_pending_tail, cm);
-    if (cm->th != NULL)
+    if (NULL != cm->th)
       cm->th->cm = NULL;
-    if (cm->cont != NULL)
+    if (NULL != cm->cont)
       cm->cont (cm->cont_cls, GNUNET_SYSERR);
     GNUNET_free (cm);
   }
-  if (handle->client != NULL)
+  if (NULL != handle->client)
   {
     GNUNET_CLIENT_disconnect (handle->client);
     handle->client = NULL;
@@ -1374,7 +1381,7 @@
 
   /* insertion sort */
   prev = pos;
-  while ((pos != NULL) && (pos->timeout.abs_value < th->timeout.abs_value))
+  while ((NULL != pos) && (pos->timeout.abs_value < th->timeout.abs_value))
   {
     prev = pos;
     pos = pos->next;
@@ -1408,7 +1415,7 @@
   was_head = (pr->pending_head == th);
   GNUNET_CONTAINER_DLL_remove (pr->pending_head, pr->pending_tail, th);
   pr->queue_size--;
-  if (th->cm != NULL)
+  if (NULL != th->cm)
   {
     /* we're currently in the control queue, remove */
     GNUNET_CONTAINER_DLL_remove (h->control_pending_head,
@@ -1418,7 +1425,7 @@
   GNUNET_free (th);
   if (was_head)
   {
-    if ((pr->prev != NULL) || (pr->next != NULL) || (pr == h->ready_peer_head))
+    if ((NULL != pr->prev) || (NULL != pr->next) || (pr == h->ready_peer_head))
     {
       /* the request that was 'approved' by core was
        * canceled before it could be transmitted; remove




reply via email to

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