fixing bad assumptions
authorChristian Grothoff <christian@grothoff.org>
Tue, 16 Feb 2010 22:28:48 +0000 (22:28 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 16 Feb 2010 22:28:48 +0000 (22:28 +0000)
src/core/gnunet-service-core.c
src/transport/gnunet-service-transport.c
src/transport/transport_api.c

index ff71eddd39018b82eea597cc253f65555dd54bb8..4d7a21efea8cc96352679e17aab38d2a0e26afb2 100644 (file)
@@ -2976,11 +2976,9 @@ handle_transport_receive (void *cls,
 #endif
   n = find_neighbour (peer);
   if (n == NULL)
-    {
-      GNUNET_break (0);
-      return;
-    }
-  GNUNET_break (n->is_connected);
+    n = create_neighbour (peer);
+  if (n == NULL)
+    return;   
   n->last_latency = latency;
   n->last_distance = distance;
   up = (n->status == PEER_STATE_KEY_CONFIRMED);
index f94ca3ef877f9a2ab4b1ef595d73513536de0d36..abeaaab68fc73a95bba6bbf7d843016aebf97922 100644 (file)
@@ -2630,16 +2630,6 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
       handle_pong(plugin, message, peer, sender_address, sender_address_len);
       break;
     default:
-      if (! n->received_pong)
-       {
-         GNUNET_break_op (0);
-#if DEBUG_TRANSPORT || 1
-         GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                     "Received message of type %u from `%4s', prior to key confirmation (dropped).\n",
-                     ntohs (message->type), GNUNET_i2s (peer));
-#endif
-         break;
-       }
 #if DEBUG_TRANSPORT
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Received message of type %u from `%4s', sending to all clients.\n",
@@ -2652,7 +2642,6 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
       im->latency = GNUNET_TIME_relative_hton (n->latency);
       im->peer = *peer;
       memcpy (&im[1], message, msize);
-
       cpos = clients;
       while (cpos != NULL)
         {
index 95e7a23fb154cc0dc7ee04ea45240f764a981841..d95b94a7ee470b8d86cf5fd419893c822bee8a45 100644 (file)
@@ -1528,10 +1528,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
 #endif      
       n = neighbour_find (h, &im->peer);
       if (n == NULL)
-       {
-         GNUNET_break (0);
-         break;
-       }      
+       n = neighbour_add (h, &im->peer);
+      if (n == NULL) 
+       break;
       if (h->rec != NULL)
        h->rec (h->cls, &im->peer, imm,
                GNUNET_TIME_relative_ntoh (im->latency), ntohs(im->distance));