gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19402 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r19402 - gnunet/src/mesh
Date: Wed, 25 Jan 2012 18:46:22 +0100

Author: bartpolot
Date: 2012-01-25 18:46:22 +0100 (Wed, 25 Jan 2012)
New Revision: 19402

Modified:
   gnunet/src/mesh/mesh_api.c
Log:
- Fixed coverity #10084

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2012-01-25 17:27:55 UTC (rev 19401)
+++ gnunet/src/mesh/mesh_api.c  2012-01-25 17:46:22 UTC (rev 19402)
@@ -901,8 +901,11 @@
  *
  * @param h         The mesh handle
  * @param message   A message encapsulating the data
+ * 
+ * @return GNUNET_YES if everything went fine
+ *         GNUNET_NO if client closed connection (h no longer valid)
  */
-static void
+static int
 process_incoming_data (struct GNUNET_MESH_Handle *h,
                        const struct GNUNET_MessageHeader *message)
 {
@@ -947,12 +950,12 @@
     break;
   default:
     GNUNET_break (0);
-    return;
+    return GNUNET_YES;
   }
   if (NULL == t)
   {
     GNUNET_break (0);
-    return;
+    return GNUNET_YES;
   }
   type = ntohs (payload->type);
   for (i = 0; i < h->n_handlers; i++)
@@ -969,7 +972,7 @@
       {
         LOG (GNUNET_ERROR_TYPE_DEBUG, "MESH: callback caused disconnection\n");
         GNUNET_MESH_disconnect (h);
-        return;
+        return GNUNET_NO;
       }
 #if MESH_API_DEBUG
       else
@@ -981,6 +984,7 @@
 #endif
     }
   }
+  return GNUNET_YES;
 }
 
 
@@ -1021,7 +1025,8 @@
   case GNUNET_MESSAGE_TYPE_MESH_UNICAST:
   case GNUNET_MESSAGE_TYPE_MESH_MULTICAST:
   case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN:
-    process_incoming_data (h, msg);
+    if (GNUNET_NO == process_incoming_data (h, msg))
+      return;
     break;
     /* We shouldn't get any other packages, log and ignore */
   default:




reply via email to

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