-makefile for new test_stream_local (commented)
[oweals/gnunet.git] / src / transport / plugin_transport_udp.c
index 662ecffa1b1b513ea2d5b9c68cd8ce0f7df05773..5ea2ba8da521fa58370339d2383794498e952f7e 100644 (file)
@@ -1387,7 +1387,8 @@ ack_proc (void *cls, uint32_t id, const struct GNUNET_MessageHeader *msg)
       &l_ctx);
   s = l_ctx.res;
 
-  GNUNET_assert (s != NULL);
+  if (NULL == s)
+    return;
 
   if (s->flow_delay_for_other_peer.rel_value <= UINT32_MAX)
     delay = s->flow_delay_for_other_peer.rel_value;
@@ -1760,7 +1761,6 @@ udp_select_send (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *sock)
         udpw = udpw->next;
       }
     }
-
   }
 
   if (udpw == NULL)
@@ -1773,19 +1773,20 @@ udp_select_send (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *sock)
 
   if (GNUNET_SYSERR == sent)
   {
-    GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sendto");
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+         "UDP could not transmit %u-byte message to `%s': `%s'\n",
+         (unsigned int) (udpw->msg_size), GNUNET_a2s (sa, slen),
+         STRERROR (errno));
+    if (udpw->cont != NULL)
+      udpw->cont (udpw->cont_cls, &udpw->session->target, GNUNET_SYSERR);
+  }
+  else
+  {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "UDP transmitted %u-byte message to %s (%d: %s)\n",
+         "UDP transmitted %u-byte message to `%s' (%d: %s)\n",
          (unsigned int) (udpw->msg_size), GNUNET_a2s (sa, slen), (int) sent,
          (sent < 0) ? STRERROR (errno) : "ok");
-    if (udpw->cont != NULL)
-      udpw->cont (udpw->cont_cls, &udpw->session->target, GNUNET_SYSERR);
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "UDP transmitted %u-byte message to %s (%d: %s)\n",
-       (unsigned int) (udpw->msg_size), GNUNET_a2s (sa, slen), (int) sent,
-       (sent < 0) ? STRERROR (errno) : "ok");
-
   /* This was just a message fragment */
   if (udpw->frag_ctx != NULL)
   {