diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-08-23 20:13:14 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-08-23 20:13:14 +0000 |
commit | daeda7abc81cbec6cc00dab4db22db96308488d7 (patch) | |
tree | 15177ecc0bac27d94b84dc867ddd9860deb30c64 | |
parent | 515c50a1fa2706b2d0cd9687c381662e39b30be8 (diff) | |
download | libmicrohttpd-daeda7abc81cbec6cc00dab4db22db96308488d7.tar.gz libmicrohttpd-daeda7abc81cbec6cc00dab4db22db96308488d7.zip |
mhd_sockets.h: unify some macro names
-rw-r--r-- | src/microhttpd/connection.c | 16 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 10 | ||||
-rw-r--r-- | src/microhttpd/mhd_sockets.h | 12 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 7c0ce674..bf3f4d00 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -146,9 +146,9 @@ socket_start_extra_buffering (struct MHD_Connection *connection) | |||
146 | { | 146 | { |
147 | int res = MHD_NO; | 147 | int res = MHD_NO; |
148 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) | 148 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) |
149 | const _MHD_SOCKOPT_BOOL_TYPE on_val = 1; | 149 | const MHD_SCKT_OPT_BOOL_ on_val = 1; |
150 | #if defined(TCP_NODELAY) | 150 | #if defined(TCP_NODELAY) |
151 | const _MHD_SOCKOPT_BOOL_TYPE off_val = 0; | 151 | const MHD_SCKT_OPT_BOOL_ off_val = 0; |
152 | #endif /* TCP_NODELAY */ | 152 | #endif /* TCP_NODELAY */ |
153 | if (!connection) | 153 | if (!connection) |
154 | return MHD_NO; | 154 | return MHD_NO; |
@@ -191,9 +191,9 @@ socket_start_no_buffering_flush (struct MHD_Connection *connection) | |||
191 | { | 191 | { |
192 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) | 192 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) |
193 | int res = MHD_YES; | 193 | int res = MHD_YES; |
194 | const _MHD_SOCKOPT_BOOL_TYPE off_val = 0; | 194 | const MHD_SCKT_OPT_BOOL_ off_val = 0; |
195 | #if defined(TCP_NODELAY) | 195 | #if defined(TCP_NODELAY) |
196 | const _MHD_SOCKOPT_BOOL_TYPE on_val = 1; | 196 | const MHD_SCKT_OPT_BOOL_ on_val = 1; |
197 | #endif /* TCP_NODELAY */ | 197 | #endif /* TCP_NODELAY */ |
198 | #if !defined(TCP_CORK) | 198 | #if !defined(TCP_CORK) |
199 | const int dummy = 0; | 199 | const int dummy = 0; |
@@ -237,9 +237,9 @@ socket_start_no_buffering (struct MHD_Connection *connection) | |||
237 | { | 237 | { |
238 | #if defined(TCP_NODELAY) | 238 | #if defined(TCP_NODELAY) |
239 | int res = MHD_YES; | 239 | int res = MHD_YES; |
240 | const _MHD_SOCKOPT_BOOL_TYPE on_val = 1; | 240 | const MHD_SCKT_OPT_BOOL_ on_val = 1; |
241 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) | 241 | #if defined(TCP_CORK) || defined(TCP_NOPUSH) |
242 | const _MHD_SOCKOPT_BOOL_TYPE off_val = 0; | 242 | const MHD_SCKT_OPT_BOOL_ off_val = 0; |
243 | #endif /* TCP_CORK || TCP_NOPUSH */ | 243 | #endif /* TCP_CORK || TCP_NOPUSH */ |
244 | if (!connection) | 244 | if (!connection) |
245 | return MHD_NO; | 245 | return MHD_NO; |
@@ -276,9 +276,9 @@ socket_start_normal_buffering (struct MHD_Connection *connection) | |||
276 | { | 276 | { |
277 | #if defined(TCP_NODELAY) | 277 | #if defined(TCP_NODELAY) |
278 | int res = MHD_YES; | 278 | int res = MHD_YES; |
279 | const _MHD_SOCKOPT_BOOL_TYPE off_val = 0; | 279 | const MHD_SCKT_OPT_BOOL_ off_val = 0; |
280 | #if defined(TCP_CORK) | 280 | #if defined(TCP_CORK) |
281 | _MHD_SOCKOPT_BOOL_TYPE cork_val = 0; | 281 | MHD_SCKT_OPT_BOOL_ cork_val = 0; |
282 | socklen_t param_size = sizeof (cork_val); | 282 | socklen_t param_size = sizeof (cork_val); |
283 | #endif /* TCP_CORK */ | 283 | #endif /* TCP_CORK */ |
284 | if (!connection) | 284 | if (!connection) |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 68491938..076a7ada 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1131,7 +1131,7 @@ recv_param_adapter (struct MHD_Connection *connection, | |||
1131 | 1131 | ||
1132 | ret = (ssize_t) recv (connection->socket_fd, | 1132 | ret = (ssize_t) recv (connection->socket_fd, |
1133 | other, | 1133 | other, |
1134 | (_MHD_socket_funcs_size) i, | 1134 | (MHD_SCKT_SEND_SIZE_) i, |
1135 | MSG_NOSIGNAL); | 1135 | MSG_NOSIGNAL); |
1136 | #if EPOLL_SUPPORT | 1136 | #if EPOLL_SUPPORT |
1137 | if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ())) ) | 1137 | if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_ (MHD_socket_get_error_ ())) ) |
@@ -1180,7 +1180,7 @@ send_param_adapter (struct MHD_Connection *connection, | |||
1180 | if (0 != (connection->daemon->options & MHD_USE_SSL)) | 1180 | if (0 != (connection->daemon->options & MHD_USE_SSL)) |
1181 | return (ssize_t) send (connection->socket_fd, | 1181 | return (ssize_t) send (connection->socket_fd, |
1182 | other, | 1182 | other, |
1183 | (_MHD_socket_funcs_size) i, | 1183 | (MHD_SCKT_SEND_SIZE_) i, |
1184 | MSG_NOSIGNAL); | 1184 | MSG_NOSIGNAL); |
1185 | #if LINUX | 1185 | #if LINUX |
1186 | if ( (connection->write_buffer_append_offset == | 1186 | if ( (connection->write_buffer_append_offset == |
@@ -1232,7 +1232,7 @@ send_param_adapter (struct MHD_Connection *connection, | |||
1232 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */ | 1232 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */ |
1233 | } | 1233 | } |
1234 | #endif | 1234 | #endif |
1235 | ret = (ssize_t) send (connection->socket_fd, other, (_MHD_socket_funcs_size)i, MSG_NOSIGNAL); | 1235 | ret = (ssize_t) send (connection->socket_fd, other, (MHD_SCKT_SEND_SIZE_)i, MSG_NOSIGNAL); |
1236 | err = MHD_socket_get_error_(); | 1236 | err = MHD_socket_get_error_(); |
1237 | #if EPOLL_SUPPORT | 1237 | #if EPOLL_SUPPORT |
1238 | if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_(err)) ) | 1238 | if ( (0 > ret) && (MHD_SCKT_ERR_IS_EAGAIN_(err)) ) |
@@ -3667,7 +3667,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3667 | MHD_AccessHandlerCallback dh, void *dh_cls, | 3667 | MHD_AccessHandlerCallback dh, void *dh_cls, |
3668 | va_list ap) | 3668 | va_list ap) |
3669 | { | 3669 | { |
3670 | const _MHD_SOCKOPT_BOOL_TYPE on = 1; | 3670 | const MHD_SCKT_OPT_BOOL_ on = 1; |
3671 | struct MHD_Daemon *daemon; | 3671 | struct MHD_Daemon *daemon; |
3672 | MHD_socket socket_fd; | 3672 | MHD_socket socket_fd; |
3673 | struct sockaddr_in servaddr4; | 3673 | struct sockaddr_in servaddr4; |
@@ -4056,7 +4056,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
4056 | (http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx); | 4056 | (http://msdn.microsoft.com/en-us/library/ms738574%28v=VS.85%29.aspx); |
4057 | and may also be missing on older POSIX systems; good luck if you have any of those, | 4057 | and may also be missing on older POSIX systems; good luck if you have any of those, |
4058 | your IPv6 socket may then also bind against IPv4 anyway... */ | 4058 | your IPv6 socket may then also bind against IPv4 anyway... */ |
4059 | const _MHD_SOCKOPT_BOOL_TYPE v6_only = | 4059 | const MHD_SCKT_OPT_BOOL_ v6_only = |
4060 | (MHD_USE_DUAL_STACK != (flags & MHD_USE_DUAL_STACK)); | 4060 | (MHD_USE_DUAL_STACK != (flags & MHD_USE_DUAL_STACK)); |
4061 | if (0 > setsockopt (socket_fd, | 4061 | if (0 > setsockopt (socket_fd, |
4062 | IPPROTO_IPV6, IPV6_V6ONLY, | 4062 | IPPROTO_IPV6, IPV6_V6ONLY, |
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h index b38a5d55..b01134a9 100644 --- a/src/microhttpd/mhd_sockets.h +++ b/src/microhttpd/mhd_sockets.h | |||
@@ -171,22 +171,22 @@ | |||
171 | 171 | ||
172 | 172 | ||
173 | /** | 173 | /** |
174 | * _MHD_SOCKOPT_BOOL_TYPE is type for bool parameters for setsockopt()/getsockopt() | 174 | * MHD_SCKT_OPT_BOOL_ is type for bool parameters for setsockopt()/getsockopt() |
175 | */ | 175 | */ |
176 | #ifdef MHD_POSIX_SOCKETS | 176 | #ifdef MHD_POSIX_SOCKETS |
177 | typedef int _MHD_SOCKOPT_BOOL_TYPE; | 177 | typedef int MHD_SCKT_OPT_BOOL_; |
178 | #else /* MHD_WINSOCK_SOCKETS */ | 178 | #else /* MHD_WINSOCK_SOCKETS */ |
179 | typedef BOOL _MHD_SOCKOPT_BOOL_TYPE; | 179 | typedef BOOL MHD_SCKT_OPT_BOOL_; |
180 | #endif /* MHD_WINSOCK_SOCKETS */ | 180 | #endif /* MHD_WINSOCK_SOCKETS */ |
181 | 181 | ||
182 | /** | 182 | /** |
183 | * _MHD_socket_funcs_size is type used to specify size for send and recv | 183 | * MHD_SCKT_SEND_SIZE_ is type used to specify size for send and recv |
184 | * functions | 184 | * functions |
185 | */ | 185 | */ |
186 | #if !defined(MHD_WINSOCK_SOCKETS) | 186 | #if !defined(MHD_WINSOCK_SOCKETS) |
187 | typedef size_t _MHD_socket_funcs_size; | 187 | typedef size_t MHD_SCKT_SEND_SIZE_; |
188 | #else | 188 | #else |
189 | typedef int _MHD_socket_funcs_size; | 189 | typedef int MHD_SCKT_SEND_SIZE_; |
190 | #endif | 190 | #endif |
191 | 191 | ||
192 | /** | 192 | /** |