gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r34919 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r34919 - gnunet/src/util
Date: Sun, 18 Jan 2015 00:29:11 +0100

Author: grothoff
Date: 2015-01-18 00:29:10 +0100 (Sun, 18 Jan 2015)
New Revision: 34919

Modified:
   gnunet/src/util/mq.c
Log:
exit loop once first handler is found

Modified: gnunet/src/util/mq.c
===================================================================
--- gnunet/src/util/mq.c        2015-01-17 23:20:27 UTC (rev 34918)
+++ gnunet/src/util/mq.c        2015-01-17 23:29:10 UTC (rev 34919)
@@ -207,23 +207,22 @@
   const struct GNUNET_MQ_MessageHandler *handler;
   int handled = GNUNET_NO;
 
-  handler = mq->handlers;
-  if (NULL == handler)
+  if (NULL == mq->handlers)
   {
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "No handler for message of type %d\n",
          ntohs (mh->type));
     return;
   }
-  for (; NULL != handler->cb; handler++)
+  for (handler = mq->handlers; NULL != handler->cb; handler++)
   {
     if (handler->type == ntohs (mh->type))
     {
       handler->cb (mq->handlers_cls, mh);
       handled = GNUNET_YES;
+      break;
     }
   }
-
   if (GNUNET_NO == handled)
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "No handler for message of type %d\n",




reply via email to

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