gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37923 - in libmicrohttpd: . src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r37923 - in libmicrohttpd: . src/microhttpd
Date: Wed, 14 Sep 2016 20:51:12 +0200

Author: Karlson2k
Date: 2016-09-14 20:51:12 +0200 (Wed, 14 Sep 2016)
New Revision: 37923

Modified:
   libmicrohttpd/configure.ac
   libmicrohttpd/src/microhttpd/response.c
   libmicrohttpd/src/microhttpd/test_upgrade.c
   libmicrohttpd/src/microhttpd/test_upgrade_common.c
   libmicrohttpd/src/microhttpd/test_upgrade_ssl.c
Log:
HTTP Upgrade: portability corrections

Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac  2016-09-14 18:51:09 UTC (rev 37922)
+++ libmicrohttpd/configure.ac  2016-09-14 18:51:12 UTC (rev 37923)
@@ -558,7 +558,8 @@
 AC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h 
sys/types.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX 
headers files]))
 
 # Check for optional headers
-AC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h netdb.h netinet/in.h 
netinet/tcp.h time.h sys/socket.h sys/mman.h arpa/inet.h sys/select.h search.h \
+AC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h time.h sys/mman.h search.h 
sys/ioctl.h \
+  sys/socket.h sys/select.h netdb.h netinet/in.h netinet/ip.h netinet/tcp.h 
arpa/inet.h \
   endian.h machine/endian.h sys/endian.h sys/param.h sys/machine.h 
sys/byteorder.h machine/param.h sys/isa_defs.h \
   inttypes.h stddef.h unistd.h \
   sockLib.h inetLib.h net/if.h])

Modified: libmicrohttpd/src/microhttpd/response.c
===================================================================
--- libmicrohttpd/src/microhttpd/response.c     2016-09-14 18:51:09 UTC (rev 
37922)
+++ libmicrohttpd/src/microhttpd/response.c     2016-09-14 18:51:12 UTC (rev 
37923)
@@ -25,6 +25,11 @@
 
 #define MHD_NO_DEPRECATION 1
 
+#include "mhd_options.h"
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
 #include "internal.h"
 #include "response.h"
 #include "mhd_limits.h"
@@ -33,7 +38,6 @@
 #include "connection.h"
 #include "memorypool.h"
 
-#include <sys/ioctl.h>
 
 #if defined(_WIN32) && defined(MHD_W32_MUTEX_)
 #ifndef WIN32_LEAN_AND_MEAN
@@ -714,7 +718,7 @@
     struct MemoryPool *pool;
     size_t avail;
     char *buf;
-    int sv[2];
+    MHD_socket sv[2];
 
     if (! MHD_socket_pair_ (sv))
     {

Modified: libmicrohttpd/src/microhttpd/test_upgrade.c
===================================================================
--- libmicrohttpd/src/microhttpd/test_upgrade.c 2016-09-14 18:51:09 UTC (rev 
37922)
+++ libmicrohttpd/src/microhttpd/test_upgrade.c 2016-09-14 18:51:12 UTC (rev 
37923)
@@ -35,10 +35,10 @@
 #include <unistd.h>
 #endif
 
-#include <sys/socket.h>
-#include <netinet/in.h>
+#include "mhd_sockets.h"
+#ifdef HAVE_NETINET_IP_H
 #include <netinet/ip.h>
-#include "mhd_sockets.h"
+#endif /* HAVE_NETINET_IP_H */
 #include "test_upgrade_common.c"
 
 

Modified: libmicrohttpd/src/microhttpd/test_upgrade_common.c
===================================================================
--- libmicrohttpd/src/microhttpd/test_upgrade_common.c  2016-09-14 18:51:09 UTC 
(rev 37922)
+++ libmicrohttpd/src/microhttpd/test_upgrade_common.c  2016-09-14 18:51:12 UTC 
(rev 37923)
@@ -46,14 +46,15 @@
 static int done;
 
 /**
- * Change itc FD options to be non-blocking.
+ * Change socket to non-blocking.
  *
- * @param fd the FD to manipulate
+ * @param fd the socket to manipulate
  * @return non-zero if succeeded, zero otherwise
  */
 static void
 make_blocking (MHD_socket fd)
 {
+#if defined(MHD_POSIX_SOCKETS)
   int flags;
 
   flags = fcntl (fd, F_GETFL);
@@ -62,6 +63,12 @@
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
+#elif defined(MHD_WINSOCK_SOCKETS)
+  unsigned long flags = 1;
+
+  ioctlsocket (fd, FIONBIO, &flags);
+#endif /* MHD_WINSOCK_SOCKETS */
+
 }
 
 

Modified: libmicrohttpd/src/microhttpd/test_upgrade_ssl.c
===================================================================
--- libmicrohttpd/src/microhttpd/test_upgrade_ssl.c     2016-09-14 18:51:09 UTC 
(rev 37922)
+++ libmicrohttpd/src/microhttpd/test_upgrade_ssl.c     2016-09-14 18:51:12 UTC 
(rev 37923)
@@ -34,12 +34,12 @@
 #include <unistd.h>
 #endif
 
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
 #include <pthread.h>
 #include "mhd_sockets.h"
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif /* HAVE_NETINET_IP_H */
+#include "mhd_sockets.h"
 #include "test_upgrade_common.c"
 
 #include "../testcurl/https/tls_test_keys.h"




reply via email to

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