gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36232 - in libmicrohttpd/src: include microhttpd


From: gnunet
Subject: [GNUnet-SVN] r36232 - in libmicrohttpd/src: include microhttpd
Date: Sat, 8 Aug 2015 14:30:06 +0200

Author: Karlson2k
Date: 2015-08-08 14:30:06 +0200 (Sat, 08 Aug 2015)
New Revision: 36232

Modified:
   libmicrohttpd/src/include/platform_interface.h
   libmicrohttpd/src/microhttpd/daemon.c
Log:
daemon.c: recv_param_adapter(): fix VS compiler warning for send()/recv()

Modified: libmicrohttpd/src/include/platform_interface.h
===================================================================
--- libmicrohttpd/src/include/platform_interface.h      2015-08-08 12:29:58 UTC 
(rev 36231)
+++ libmicrohttpd/src/include/platform_interface.h      2015-08-08 12:30:06 UTC 
(rev 36232)
@@ -81,6 +81,16 @@
 
 
 /**
+ * _MHD_socket_funcs_size is type used to specify size for send and recv
+ * functions
+ */
+#if !defined(MHD_WINSOCK_SOCKETS)
+typedef size_t _MHD_socket_funcs_size;
+#else
+typedef int _MHD_socket_funcs_size;
+#endif
+
+/**
  * MHD_socket_close_(fd) close any FDs (non-W32) / close only socket
  * FDs (W32).  Note that on HP-UNIX, this function may leak the FD if
  * errno is set to EINTR.  Do not use HP-UNIX.

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2015-08-08 12:29:58 UTC (rev 
36231)
+++ libmicrohttpd/src/microhttpd/daemon.c       2015-08-08 12:30:06 UTC (rev 
36232)
@@ -1061,7 +1061,7 @@
     i = INT_MAX; /* return value limit */
 #endif /* MHD_WINSOCK_SOCKETS */
 
-  ret = recv(connection->socket_fd, other, i, MSG_NOSIGNAL);
+  ret = (ssize_t)recv (connection->socket_fd, other, 
(_MHD_socket_funcs_size)i, MSG_NOSIGNAL);
 #if EPOLL_SUPPORT
   if ( (0 > ret) || (requested_size > (size_t) ret))
     {
@@ -1109,7 +1109,7 @@
 #endif /* MHD_WINSOCK_SOCKETS */
 
   if (0 != (connection->daemon->options & MHD_USE_SSL))
-    return send (connection->socket_fd, other, i, MSG_NOSIGNAL);
+    return (ssize_t)send (connection->socket_fd, other, 
(_MHD_socket_funcs_size)i, MSG_NOSIGNAL);
 #if LINUX
   if ( (connection->write_buffer_append_offset ==
        connection->write_buffer_send_offset) &&
@@ -1156,7 +1156,7 @@
         http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html 
*/
     }
 #endif
-  ret = send (connection->socket_fd, other, i, MSG_NOSIGNAL);
+  ret = (ssize_t)send (connection->socket_fd, other, 
(_MHD_socket_funcs_size)i, MSG_NOSIGNAL);
 #if EPOLL_SUPPORT
   if ( (0 > ret) || (requested_size > (size_t) ret) )
     {




reply via email to

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