fix
[oweals/gnunet.git] / src / util / network.c
index c4fb73049e19718a7b9bdc8974da58dbd2597b48..8ec365269dd5b003ffce0a9407b19edaf4a20c8d 100644 (file)
@@ -226,7 +226,10 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
 #ifdef DARWIN
   socket_set_nosigpipe (ret);
 #endif
-  socket_set_nodelay (ret);
+#ifdef AF_UNIX
+  if (address->sa_family != AF_UNIX)
+#endif
+    socket_set_nodelay (ret);
   return ret;
 }
 
@@ -590,7 +593,11 @@ GNUNET_NETWORK_socket_create (int domain, int type, int protocol)
 #ifdef DARWIN
   socket_set_nosigpipe (ret);
 #endif
-  if (type == SOCK_STREAM)
+  if ( (type == SOCK_STREAM) 
+#ifdef AF_UNIX
+       && (domain != AF_UNIX) 
+#endif
+       )
     socket_set_nodelay (ret);
   return ret;
 }
@@ -723,6 +730,21 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
   to->nsds = nfds;
 }
 
+
+/**
+ * Set a native fd in a set
+ *
+ * @param to destination
+ * @param nfd native FD to set
+ */
+void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
+                                     int nfd)
+{
+  FD_SET (nfd, &to->sds);
+  to->nsds = GNUNET_MAX (nfd + 1, to->nsds);
+}
+
+
 /**
  * Add a file handle to the fd set
  * @param fds fd set