diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-08-08 12:30:06 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2015-08-08 12:30:06 +0000 |
commit | e15abfd99c9a1c892b68b17f9a8d65c949658adb (patch) | |
tree | bfca89d50b6d3f9fa5c197369fdfe00b94af7562 /src | |
parent | 066f70ea6830a65b092b41365a050d681fae44ed (diff) | |
download | libmicrohttpd-e15abfd99c9a1c892b68b17f9a8d65c949658adb.tar.gz libmicrohttpd-e15abfd99c9a1c892b68b17f9a8d65c949658adb.zip |
daemon.c: recv_param_adapter(): fix VS compiler warning for send()/recv()
Diffstat (limited to 'src')
-rw-r--r-- | src/include/platform_interface.h | 10 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/include/platform_interface.h b/src/include/platform_interface.h index e78f40b2..e0493a29 100644 --- a/src/include/platform_interface.h +++ b/src/include/platform_interface.h | |||
@@ -81,6 +81,16 @@ | |||
81 | 81 | ||
82 | 82 | ||
83 | /** | 83 | /** |
84 | * _MHD_socket_funcs_size is type used to specify size for send and recv | ||
85 | * functions | ||
86 | */ | ||
87 | #if !defined(MHD_WINSOCK_SOCKETS) | ||
88 | typedef size_t _MHD_socket_funcs_size; | ||
89 | #else | ||
90 | typedef int _MHD_socket_funcs_size; | ||
91 | #endif | ||
92 | |||
93 | /** | ||
84 | * MHD_socket_close_(fd) close any FDs (non-W32) / close only socket | 94 | * MHD_socket_close_(fd) close any FDs (non-W32) / close only socket |
85 | * FDs (W32). Note that on HP-UNIX, this function may leak the FD if | 95 | * FDs (W32). Note that on HP-UNIX, this function may leak the FD if |
86 | * errno is set to EINTR. Do not use HP-UNIX. | 96 | * errno is set to EINTR. Do not use HP-UNIX. |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index d45c7487..f4da2c8c 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1061,7 +1061,7 @@ recv_param_adapter (struct MHD_Connection *connection, | |||
1061 | i = INT_MAX; /* return value limit */ | 1061 | i = INT_MAX; /* return value limit */ |
1062 | #endif /* MHD_WINSOCK_SOCKETS */ | 1062 | #endif /* MHD_WINSOCK_SOCKETS */ |
1063 | 1063 | ||
1064 | ret = recv(connection->socket_fd, other, i, MSG_NOSIGNAL); | 1064 | ret = (ssize_t)recv (connection->socket_fd, other, (_MHD_socket_funcs_size)i, MSG_NOSIGNAL); |
1065 | #if EPOLL_SUPPORT | 1065 | #if EPOLL_SUPPORT |
1066 | if ( (0 > ret) || (requested_size > (size_t) ret)) | 1066 | if ( (0 > ret) || (requested_size > (size_t) ret)) |
1067 | { | 1067 | { |
@@ -1109,7 +1109,7 @@ send_param_adapter (struct MHD_Connection *connection, | |||
1109 | #endif /* MHD_WINSOCK_SOCKETS */ | 1109 | #endif /* MHD_WINSOCK_SOCKETS */ |
1110 | 1110 | ||
1111 | if (0 != (connection->daemon->options & MHD_USE_SSL)) | 1111 | if (0 != (connection->daemon->options & MHD_USE_SSL)) |
1112 | return send (connection->socket_fd, other, i, MSG_NOSIGNAL); | 1112 | return (ssize_t)send (connection->socket_fd, other, (_MHD_socket_funcs_size)i, MSG_NOSIGNAL); |
1113 | #if LINUX | 1113 | #if LINUX |
1114 | if ( (connection->write_buffer_append_offset == | 1114 | if ( (connection->write_buffer_append_offset == |
1115 | connection->write_buffer_send_offset) && | 1115 | connection->write_buffer_send_offset) && |
@@ -1156,7 +1156,7 @@ send_param_adapter (struct MHD_Connection *connection, | |||
1156 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */ | 1156 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */ |
1157 | } | 1157 | } |
1158 | #endif | 1158 | #endif |
1159 | ret = send (connection->socket_fd, other, i, MSG_NOSIGNAL); | 1159 | ret = (ssize_t)send (connection->socket_fd, other, (_MHD_socket_funcs_size)i, MSG_NOSIGNAL); |
1160 | #if EPOLL_SUPPORT | 1160 | #if EPOLL_SUPPORT |
1161 | if ( (0 > ret) || (requested_size > (size_t) ret) ) | 1161 | if ( (0 > ret) || (requested_size > (size_t) ret) ) |
1162 | { | 1162 | { |