fix
authorChristian Grothoff <christian@grothoff.org>
Wed, 9 Nov 2011 15:01:02 +0000 (15:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 9 Nov 2011 15:01:02 +0000 (15:01 +0000)
src/ats/ats_api_scheduling.c
src/transport/gnunet-service-transport_neighbours.c

index 0885f53e9f60b2609f1e919a9273100ed0fe5d84..13a4ce8308352f4c3c7a061c35e7fa02cbcdc795 100644 (file)
@@ -290,13 +290,15 @@ find_session (struct GNUNET_ATS_SchedulingHandle *sh, uint32_t session_id,
     GNUNET_break (0);
     return NULL;
   }
+  if (0 == session_id)
+    return NULL;
   /* Check if this session was:
    *  removed by remove_session (transport service)
    *  released by release_session (ATS)
    *  */
   if (sh->session_array[session_id].session == NULL)
   {
-    GNUNET_assert (0 ==
+    GNUNET_break (0 ==
         memcmp (peer, &sh->session_array[session_id].peer,
                 sizeof (struct GNUNET_PeerIdentity)));
     return NULL;
@@ -715,6 +717,7 @@ GNUNET_ATS_address_in_use (struct GNUNET_ATS_SchedulingHandle *sh,
   size_t namelen;
   size_t msize;
 
+  GNUNET_assert (NULL != address);
   namelen = (address->transport_name == NULL) ? 0 : strlen (address->transport_name) + 1;
   msize = sizeof (struct AddressUseMessage) + address->address_length + namelen;
   if ((msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
index 62fc441a15f20d274f31322b88a68a4effc7f477..40790dfe4770a59ef8ee65159639e71719fb38aa 100644 (file)
@@ -1092,10 +1092,9 @@ send_switch_address_continuation (void *cls,
   {
 #if DEBUG_TRANSPORT
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Failed to switch connected peer `%s' to plugin `%s' address '%s' session %X, asking ATS for new address \n",
-                GNUNET_i2s (&n->id), n->address->transport_name,
-                (n->addrlen ==
-                 0) ? "<inbound>" : GST_plugins_a2s (n->address), n->session);
+                "Failed to switch connected peer `%s' to address '%s' session %X, asking ATS for new address \n",
+                GNUNET_i2s (&n->id), 
+               GST_plugins_a2s (n->address), n->session);
 #endif
 
     GNUNET_ATS_address_destroyed (GST_ats, n->address, NULL);
@@ -1135,9 +1134,9 @@ send_connect_ack_continuation (void *cls,
   /* sending failed, ask for next address  */
 #if DEBUG_TRANSPORT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Failed to send CONNECT_MSG to peer `%4s' with plugin `%s' address '%s' session %X, asking ATS for new address \n",
-              GNUNET_i2s (&n->id), n->address->transport_name,
-              (n->addrlen == 0) ? "<inbound>" : GST_plugins_a2s (n->address),
+              "Failed to send CONNECT_MSG to peer `%4s' with address '%s' session %X, asking ATS for new address \n",
+              GNUNET_i2s (&n->id), 
+              GST_plugins_a2s (n->address),
               n->session);
 #endif
   change_state (n, S_NOT_CONNECTED);