Removing all the tests for the bluetooth transport plugin.
[oweals/gnunet.git] / src / transport / plugin_transport_unix.c
index 3f64e5c1941a4d8c56e7ca2e5c63d34bd1def43c..2087d30e5ab972a5446ae0731604d4ae78cec3ae 100644 (file)
@@ -610,7 +610,6 @@ unix_real_send (void *cls,
 
 resend:
   /* Send the data */
-  sent = 0;
   sent = GNUNET_NETWORK_socket_sendto (send_handle, msgbuf, msgbuf_size, sb, sbs);
 
   if (GNUNET_SYSERR == sent)
@@ -701,7 +700,7 @@ get_session_it (void *cls,
   struct GetSessionIteratorContext *gsi = cls;
   struct Session *s = value;
 
-  if ( (gsi->addrlen == s->addrlen) &&
+  if ((GNUNET_NO == s->inbound) && (gsi->addrlen == s->addrlen) &&
        (0 == memcmp (gsi->address, s->addr, s->addrlen)) )
   {
     gsi->res = s;
@@ -732,6 +731,7 @@ session_timeout (void *cls,
   disconnect_session (s);
 }
 
+
 /**
  * Function obtain the network type for a session
  *
@@ -740,10 +740,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;
 }
 
 
@@ -1041,6 +1042,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];
@@ -1077,7 +1079,7 @@ unix_plugin_select_write (struct Plugin *plugin)
 
   while (NULL != (msgw = plugin->msg_tail))
   {
-    if (GNUNET_TIME_absolute_get_remaining (msgw->timeout).rel_value > 0)
+    if (GNUNET_TIME_absolute_get_remaining (msgw->timeout).rel_value_us > 0)
       break; /* Message is ready for sending */
     /* Message has a timeout */
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1292,7 +1294,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))
   {
@@ -1399,7 +1401,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
   {
@@ -1437,7 +1439,7 @@ unix_string_to_address (void *cls, const char *addr, uint16_t addrlen,
   address = NULL;
   plugin = NULL;
   optionstr = NULL;
-  options = 0;
+
   if ((NULL == addr) || (addrlen == 0))
   {
     GNUNET_break (0);