Extending the testcases to use bluetooth
[oweals/gnunet.git] / src / transport / plugin_transport_unix.c
index e5cf8cf7edcf2ac7c15bbcead2e95b9c6ed5a143..19a4d8e601aa2c616bdbbe4875bee430a758f7b5 100644 (file)
@@ -732,6 +732,7 @@ session_timeout (void *cls,
   disconnect_session (s);
 }
 
+
 /**
  * Function obtain the network type for a session
  *
@@ -740,10 +741,11 @@ session_timeout (void *cls,
  * @return the network type in HBO or GNUNET_SYSERR
  */
 static enum GNUNET_ATS_Network_Type
-unix_get_network (void *cls, void *session)
+unix_get_network (void *cls, 
+                 struct Session *session)
 {
-       GNUNET_assert (NULL != session);
-       return GNUNET_ATS_NET_LOOPBACK;
+  GNUNET_assert (NULL != session);
+  return GNUNET_ATS_NET_LOOPBACK;
 }
 
 
@@ -962,7 +964,6 @@ unix_demultiplexer (struct Plugin *plugin, struct GNUNET_PeerIdentity *sender,
   s = lookup_session (plugin, sender, ua, ua_len);
   if (NULL == s)
   {
-       GNUNET_break (0);
     s = unix_plugin_get_session (plugin, addr);
     s->inbound = GNUNET_YES;
     /* Notify transport and ATS about new inbound session */
@@ -1042,6 +1043,7 @@ unix_plugin_select_read (struct Plugin *plugin)
   if ((csize < sizeof (struct UNIXMessage)) || (csize > ret))
   {
     GNUNET_break_op (0);
+    GNUNET_free (ua);
     return;
   }
   msgbuf = (char *) &msg[1];
@@ -1293,7 +1295,7 @@ unix_address_to_string (void *cls, const void *addr, size_t addrlen)
 
        if (0 == addrlen)
        {
-               GNUNET_snprintf(rbuf, sizeof (rbuf), "%s", "<inbound>");
+               GNUNET_snprintf(rbuf, sizeof (rbuf), "%s", TRANSPORT_SESSION_INBOUND_STRING);
        }
   if ((NULL == addr) || (sizeof (struct UnixAddress) > addrlen))
   {
@@ -1400,7 +1402,7 @@ unix_plugin_address_pretty_printer (void *cls, const char *type,
   }
   else if (0 == addrlen)
   {
-    asc (asc_cls, "<inbound>");
+    asc (asc_cls, TRANSPORT_SESSION_INBOUND_STRING);
   }
   else
   {