gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r16715 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r16715 - gnunet/src/transport
Date: Tue, 6 Sep 2011 16:39:22 +0200

Author: wachs
Date: 2011-09-06 16:39:22 +0200 (Tue, 06 Sep 2011)
New Revision: 16715

Modified:
   gnunet/src/transport/plugin_transport_udp.c
Log:
udp now working with new transport service
udp plugin should not call transmit_continuation, if NULL


Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2011-09-06 13:42:26 UTC (rev 
16714)
+++ gnunet/src/transport/plugin_transport_udp.c 2011-09-06 14:39:22 UTC (rev 
16715)
@@ -325,7 +325,8 @@
                                                        &target->hashPubKey,
                                                        session));
   plugin->last_expected_delay = GNUNET_FRAGMENT_context_destroy 
(session->frag);
-  session->cont (session->cont_cls, target, GNUNET_SYSERR);
+  if (session->cont != NULL)
+    session->cont (session->cont_cls, target, GNUNET_SYSERR);
   GNUNET_free (session);
 }
 
@@ -406,6 +407,8 @@
   GNUNET_FRAGMENT_context_transmission_done (session->frag);
 }
 
+static const char *
+udp_address_to_string (void *cls, const void *addr, size_t addrlen);
 
 /**
  * Function that can be used by the transport service to transmit
@@ -461,7 +464,8 @@
   case sizeof (struct IPv4UdpAddress):
     if (NULL == plugin->sockv4)
     {
-      cont (cont_cls, target, GNUNET_SYSERR);
+      if (cont != NULL)
+        cont (cont_cls, target, GNUNET_SYSERR);
       return 0;
     }
     t4 = addr;
@@ -479,7 +483,8 @@
   case sizeof (struct IPv6UdpAddress):
     if (NULL == plugin->sockv6)
     {
-      cont (cont_cls, target, GNUNET_SYSERR);
+      if (cont != NULL)
+        cont (cont_cls, target, GNUNET_SYSERR);
       return 0;
     }
     t6 = addr;
@@ -513,8 +518,9 @@
   if (mlen <= UDP_MTU)
   {
     mlen = udp_send (plugin, peer_session->sock_addr, &udp->header);
-    cont (cont_cls, target, (mlen > 0) ? GNUNET_OK : GNUNET_SYSERR);
-    GNUNET_free (peer_session);
+    if (cont != NULL)
+      cont (cont_cls, target, (mlen > 0) ? GNUNET_OK : GNUNET_SYSERR);
+    GNUNET_free_non_null (peer_session);
   }
   else
   {
@@ -857,7 +863,8 @@
                                                          peer_session));
     plugin->last_expected_delay =
         GNUNET_FRAGMENT_context_destroy (peer_session->frag);
-    peer_session->cont (peer_session->cont_cls, &udp->sender, GNUNET_OK);
+    if (peer_session->cont != NULL)
+      peer_session->cont (peer_session->cont_cls, &udp->sender, GNUNET_OK);
     GNUNET_free (peer_session);
     return;
   case GNUNET_MESSAGE_TYPE_FRAGMENT:




reply via email to

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