diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2014-02-18 18:38:04 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2014-02-18 18:38:04 +0000 |
commit | 4e0abfce9e307db0c6d5a1c253603600d3ba0ced (patch) | |
tree | 970b8f4a8ced22430c255e66ad5b6edb9b9f0c41 | |
parent | c311027f28797ef8dc692baa84a898bda033c410 (diff) | |
download | libmicrohttpd-4e0abfce9e307db0c6d5a1c253603600d3ba0ced.tar.gz libmicrohttpd-4e0abfce9e307db0c6d5a1c253603600d3ba0ced.zip |
Replace CLOSE() with MHD_socket_close_() for sockets
-rw-r--r-- | src/microhttpd/Makefile.am | 6 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 50 | ||||
-rw-r--r-- | src/platform/platform_interface.h | 36 | ||||
-rw-r--r-- | src/testcurl/Makefile.am | 1 | ||||
-rw-r--r-- | src/testcurl/https/Makefile.am | 1 | ||||
-rw-r--r-- | src/testcurl/test_get.c | 5 |
6 files changed, 70 insertions, 29 deletions
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am index 35ab6021..f09c3b12 100644 --- a/src/microhttpd/Makefile.am +++ b/src/microhttpd/Makefile.am | |||
@@ -5,7 +5,8 @@ endif | |||
5 | AM_CPPFLAGS = \ | 5 | AM_CPPFLAGS = \ |
6 | $(PLIBC_INCLUDE) \ | 6 | $(PLIBC_INCLUDE) \ |
7 | -I$(top_srcdir)/src/include \ | 7 | -I$(top_srcdir)/src/include \ |
8 | -I$(top_srcdir)/src/microhttpd | 8 | -I$(top_srcdir)/src/microhttpd \ |
9 | -I$(top_srcdir)/src/platform | ||
9 | 10 | ||
10 | AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) \ | 11 | AM_CFLAGS = $(HIDDEN_VISIBILITY_CFLAGS) \ |
11 | @LIBGCRYPT_CFLAGS@ | 12 | @LIBGCRYPT_CFLAGS@ |
@@ -20,7 +21,8 @@ libmicrohttpd_la_SOURCES = \ | |||
20 | daemon.c \ | 21 | daemon.c \ |
21 | internal.c internal.h \ | 22 | internal.c internal.h \ |
22 | memorypool.c memorypool.h \ | 23 | memorypool.c memorypool.h \ |
23 | response.c response.h | 24 | response.c response.h \ |
25 | ../platform/platform_interface.h | ||
24 | libmicrohttpd_la_CPPFLAGS = \ | 26 | libmicrohttpd_la_CPPFLAGS = \ |
25 | $(AM_CPPFLAGS) \ | 27 | $(AM_CPPFLAGS) \ |
26 | -DBUILDING_MHD_LIB=1 | 28 | -DBUILDING_MHD_LIB=1 |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index c7ff9040..af77644a 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -25,6 +25,7 @@ | |||
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | */ | 26 | */ |
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "platform_interface.h" | ||
28 | #include "internal.h" | 29 | #include "internal.h" |
29 | #include "response.h" | 30 | #include "response.h" |
30 | #include "connection.h" | 31 | #include "connection.h" |
@@ -1052,7 +1053,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1052 | addr, addrlen, | 1053 | addr, addrlen, |
1053 | external_add); | 1054 | external_add); |
1054 | /* all pools are at their connection limit, must refuse */ | 1055 | /* all pools are at their connection limit, must refuse */ |
1055 | if (0 != CLOSE (client_socket)) | 1056 | if (0 != MHD_socket_close_ (client_socket)) |
1056 | MHD_PANIC ("close failed\n"); | 1057 | MHD_PANIC ("close failed\n"); |
1057 | #if ENFILE | 1058 | #if ENFILE |
1058 | errno = ENFILE; | 1059 | errno = ENFILE; |
@@ -1070,7 +1071,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1070 | client_socket, | 1071 | client_socket, |
1071 | FD_SETSIZE); | 1072 | FD_SETSIZE); |
1072 | #endif | 1073 | #endif |
1073 | if (0 != CLOSE (client_socket)) | 1074 | if (0 != MHD_socket_close_ (client_socket)) |
1074 | MHD_PANIC ("close failed\n"); | 1075 | MHD_PANIC ("close failed\n"); |
1075 | #if EINVAL | 1076 | #if EINVAL |
1076 | errno = EINVAL; | 1077 | errno = EINVAL; |
@@ -1093,7 +1094,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1093 | MHD_DLOG (daemon, | 1094 | MHD_DLOG (daemon, |
1094 | "Server reached connection limit (closing inbound connection)\n"); | 1095 | "Server reached connection limit (closing inbound connection)\n"); |
1095 | #endif | 1096 | #endif |
1096 | if (0 != CLOSE (client_socket)) | 1097 | if (0 != MHD_socket_close_ (client_socket)) |
1097 | MHD_PANIC ("close failed\n"); | 1098 | MHD_PANIC ("close failed\n"); |
1098 | #if ENFILE | 1099 | #if ENFILE |
1099 | errno = ENFILE; | 1100 | errno = ENFILE; |
@@ -1111,7 +1112,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1111 | MHD_DLOG (daemon, "Connection rejected, closing connection\n"); | 1112 | MHD_DLOG (daemon, "Connection rejected, closing connection\n"); |
1112 | #endif | 1113 | #endif |
1113 | #endif | 1114 | #endif |
1114 | if (0 != CLOSE (client_socket)) | 1115 | if (0 != MHD_socket_close_ (client_socket)) |
1115 | MHD_PANIC ("close failed\n"); | 1116 | MHD_PANIC ("close failed\n"); |
1116 | MHD_ip_limit_del (daemon, addr, addrlen); | 1117 | MHD_ip_limit_del (daemon, addr, addrlen); |
1117 | #if EACCESS | 1118 | #if EACCESS |
@@ -1138,7 +1139,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1138 | "Error allocating memory: %s\n", | 1139 | "Error allocating memory: %s\n", |
1139 | STRERROR (errno)); | 1140 | STRERROR (errno)); |
1140 | #endif | 1141 | #endif |
1141 | if (0 != CLOSE (client_socket)) | 1142 | if (0 != MHD_socket_close_ (client_socket)) |
1142 | MHD_PANIC ("close failed\n"); | 1143 | MHD_PANIC ("close failed\n"); |
1143 | MHD_ip_limit_del (daemon, addr, addrlen); | 1144 | MHD_ip_limit_del (daemon, addr, addrlen); |
1144 | errno = eno; | 1145 | errno = eno; |
@@ -1153,7 +1154,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1153 | "Error allocating memory: %s\n", | 1154 | "Error allocating memory: %s\n", |
1154 | STRERROR (errno)); | 1155 | STRERROR (errno)); |
1155 | #endif | 1156 | #endif |
1156 | if (0 != CLOSE (client_socket)) | 1157 | if (0 != MHD_socket_close_ (client_socket)) |
1157 | MHD_PANIC ("close failed\n"); | 1158 | MHD_PANIC ("close failed\n"); |
1158 | MHD_ip_limit_del (daemon, addr, addrlen); | 1159 | MHD_ip_limit_del (daemon, addr, addrlen); |
1159 | free (connection); | 1160 | free (connection); |
@@ -1172,7 +1173,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1172 | "Error allocating memory: %s\n", | 1173 | "Error allocating memory: %s\n", |
1173 | STRERROR (errno)); | 1174 | STRERROR (errno)); |
1174 | #endif | 1175 | #endif |
1175 | if (0 != CLOSE (client_socket)) | 1176 | if (0 != MHD_socket_close_ (client_socket)) |
1176 | MHD_PANIC ("close failed\n"); | 1177 | MHD_PANIC ("close failed\n"); |
1177 | MHD_ip_limit_del (daemon, addr, addrlen); | 1178 | MHD_ip_limit_del (daemon, addr, addrlen); |
1178 | MHD_pool_destroy (connection->pool); | 1179 | MHD_pool_destroy (connection->pool); |
@@ -1209,8 +1210,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1209 | { | 1210 | { |
1210 | #if HAVE_MESSAGES | 1211 | #if HAVE_MESSAGES |
1211 | MHD_DLOG (daemon, | 1212 | MHD_DLOG (daemon, |
1212 | "Failed to make socket %d non-blocking: %s\n", | 1213 | "Failed to make socket non-blocking: %s\n", |
1213 | connection->socket_fd, | ||
1214 | STRERROR (errno)); | 1214 | STRERROR (errno)); |
1215 | #endif | 1215 | #endif |
1216 | } | 1216 | } |
@@ -1252,7 +1252,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1252 | "Failed to setup TLS credentials: unknown credential type %d\n", | 1252 | "Failed to setup TLS credentials: unknown credential type %d\n", |
1253 | daemon->cred_type); | 1253 | daemon->cred_type); |
1254 | #endif | 1254 | #endif |
1255 | if (0 != CLOSE (client_socket)) | 1255 | if (0 != MHD_socket_close_ (client_socket)) |
1256 | MHD_PANIC ("close failed\n"); | 1256 | MHD_PANIC ("close failed\n"); |
1257 | MHD_ip_limit_del (daemon, addr, addrlen); | 1257 | MHD_ip_limit_del (daemon, addr, addrlen); |
1258 | free (connection->addr); | 1258 | free (connection->addr); |
@@ -1351,7 +1351,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
1351 | daemon->max_connections--; | 1351 | daemon->max_connections--; |
1352 | return MHD_YES; | 1352 | return MHD_YES; |
1353 | cleanup: | 1353 | cleanup: |
1354 | if (0 != CLOSE (client_socket)) | 1354 | if (0 != MHD_socket_close_ (client_socket)) |
1355 | MHD_PANIC ("close failed\n"); | 1355 | MHD_PANIC ("close failed\n"); |
1356 | MHD_ip_limit_del (daemon, addr, addrlen); | 1356 | MHD_ip_limit_del (daemon, addr, addrlen); |
1357 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 1357 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |
@@ -1721,7 +1721,7 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
1721 | #endif | 1721 | #endif |
1722 | if (MHD_INVALID_SOCKET != s) | 1722 | if (MHD_INVALID_SOCKET != s) |
1723 | { | 1723 | { |
1724 | if (0 != CLOSE (s)) | 1724 | if (0 != MHD_socket_close_ (s)) |
1725 | MHD_PANIC ("close failed\n"); | 1725 | MHD_PANIC ("close failed\n"); |
1726 | /* just in case */ | 1726 | /* just in case */ |
1727 | } | 1727 | } |
@@ -1816,7 +1816,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) | |||
1816 | #ifdef WINDOWS | 1816 | #ifdef WINDOWS |
1817 | SHUTDOWN (pos->socket_fd, SHUT_WR); | 1817 | SHUTDOWN (pos->socket_fd, SHUT_WR); |
1818 | #endif | 1818 | #endif |
1819 | if (0 != CLOSE (pos->socket_fd)) | 1819 | if (0 != MHD_socket_close_ (pos->socket_fd)) |
1820 | MHD_PANIC ("close failed\n"); | 1820 | MHD_PANIC ("close failed\n"); |
1821 | } | 1821 | } |
1822 | if (NULL != pos->addr) | 1822 | if (NULL != pos->addr) |
@@ -3530,7 +3530,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3530 | (unsigned int) port, | 3530 | (unsigned int) port, |
3531 | STRERROR (errno)); | 3531 | STRERROR (errno)); |
3532 | #endif | 3532 | #endif |
3533 | if (0 != CLOSE (socket_fd)) | 3533 | if (0 != MHD_socket_close_ (socket_fd)) |
3534 | MHD_PANIC ("close failed\n"); | 3534 | MHD_PANIC ("close failed\n"); |
3535 | goto free_and_fail; | 3535 | goto free_and_fail; |
3536 | } | 3536 | } |
@@ -3545,7 +3545,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3545 | "Failed to make listen socket non-blocking: %s\n", | 3545 | "Failed to make listen socket non-blocking: %s\n", |
3546 | STRERROR (errno)); | 3546 | STRERROR (errno)); |
3547 | #endif | 3547 | #endif |
3548 | if (0 != CLOSE (socket_fd)) | 3548 | if (0 != MHD_socket_close_ (socket_fd)) |
3549 | MHD_PANIC ("close failed\n"); | 3549 | MHD_PANIC ("close failed\n"); |
3550 | goto free_and_fail; | 3550 | goto free_and_fail; |
3551 | } | 3551 | } |
@@ -3559,7 +3559,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3559 | "Failed to listen for connections: %s\n", | 3559 | "Failed to listen for connections: %s\n", |
3560 | STRERROR (errno)); | 3560 | STRERROR (errno)); |
3561 | #endif | 3561 | #endif |
3562 | if (0 != CLOSE (socket_fd)) | 3562 | if (0 != MHD_socket_close_ (socket_fd)) |
3563 | MHD_PANIC ("close failed\n"); | 3563 | MHD_PANIC ("close failed\n"); |
3564 | goto free_and_fail; | 3564 | goto free_and_fail; |
3565 | } | 3565 | } |
@@ -3579,7 +3579,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3579 | socket_fd, | 3579 | socket_fd, |
3580 | FD_SETSIZE); | 3580 | FD_SETSIZE); |
3581 | #endif | 3581 | #endif |
3582 | if (0 != CLOSE (socket_fd)) | 3582 | if (0 != MHD_socket_close_ (socket_fd)) |
3583 | MHD_PANIC ("close failed\n"); | 3583 | MHD_PANIC ("close failed\n"); |
3584 | goto free_and_fail; | 3584 | goto free_and_fail; |
3585 | } | 3585 | } |
@@ -3592,7 +3592,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3592 | "MHD failed to initialize IP connection limit mutex\n"); | 3592 | "MHD failed to initialize IP connection limit mutex\n"); |
3593 | #endif | 3593 | #endif |
3594 | if ( (MHD_INVALID_SOCKET != socket_fd) && | 3594 | if ( (MHD_INVALID_SOCKET != socket_fd) && |
3595 | (0 != CLOSE (socket_fd)) ) | 3595 | (0 != MHD_socket_close_ (socket_fd)) ) |
3596 | MHD_PANIC ("close failed\n"); | 3596 | MHD_PANIC ("close failed\n"); |
3597 | goto free_and_fail; | 3597 | goto free_and_fail; |
3598 | } | 3598 | } |
@@ -3604,7 +3604,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3604 | #endif | 3604 | #endif |
3605 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); | 3605 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); |
3606 | if ( (MHD_INVALID_SOCKET != socket_fd) && | 3606 | if ( (MHD_INVALID_SOCKET != socket_fd) && |
3607 | (0 != CLOSE (socket_fd)) ) | 3607 | (0 != MHD_socket_close_ (socket_fd)) ) |
3608 | MHD_PANIC ("close failed\n"); | 3608 | MHD_PANIC ("close failed\n"); |
3609 | goto free_and_fail; | 3609 | goto free_and_fail; |
3610 | } | 3610 | } |
@@ -3618,7 +3618,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3618 | "Failed to initialize TLS support\n"); | 3618 | "Failed to initialize TLS support\n"); |
3619 | #endif | 3619 | #endif |
3620 | if ( (MHD_INVALID_SOCKET != socket_fd) && | 3620 | if ( (MHD_INVALID_SOCKET != socket_fd) && |
3621 | (0 != CLOSE (socket_fd)) ) | 3621 | (0 != MHD_socket_close_ (socket_fd)) ) |
3622 | MHD_PANIC ("close failed\n"); | 3622 | MHD_PANIC ("close failed\n"); |
3623 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); | 3623 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); |
3624 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); | 3624 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); |
@@ -3640,7 +3640,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
3640 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); | 3640 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); |
3641 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); | 3641 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); |
3642 | if ( (MHD_INVALID_SOCKET != socket_fd) && | 3642 | if ( (MHD_INVALID_SOCKET != socket_fd) && |
3643 | (0 != CLOSE (socket_fd)) ) | 3643 | (0 != MHD_socket_close_ (socket_fd)) ) |
3644 | MHD_PANIC ("close failed\n"); | 3644 | MHD_PANIC ("close failed\n"); |
3645 | goto free_and_fail; | 3645 | goto free_and_fail; |
3646 | } | 3646 | } |
@@ -3783,7 +3783,7 @@ thread_failed: | |||
3783 | if (0 == i) | 3783 | if (0 == i) |
3784 | { | 3784 | { |
3785 | if ( (MHD_INVALID_SOCKET != socket_fd) && | 3785 | if ( (MHD_INVALID_SOCKET != socket_fd) && |
3786 | (0 != CLOSE (socket_fd)) ) | 3786 | (0 != MHD_socket_close_ (socket_fd)) ) |
3787 | MHD_PANIC ("close failed\n"); | 3787 | MHD_PANIC ("close failed\n"); |
3788 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); | 3788 | pthread_mutex_destroy (&daemon->cleanup_connection_mutex); |
3789 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); | 3789 | pthread_mutex_destroy (&daemon->per_ip_connection_mutex); |
@@ -4001,7 +4001,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
4001 | pthread_mutex_destroy (&daemon->worker_pool[i].cleanup_connection_mutex); | 4001 | pthread_mutex_destroy (&daemon->worker_pool[i].cleanup_connection_mutex); |
4002 | #if EPOLL_SUPPORT | 4002 | #if EPOLL_SUPPORT |
4003 | if ( (-1 != daemon->worker_pool[i].epoll_fd) && | 4003 | if ( (-1 != daemon->worker_pool[i].epoll_fd) && |
4004 | (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) ) | 4004 | (0 != MHD_socket_close_ (daemon->worker_pool[i].epoll_fd)) ) |
4005 | MHD_PANIC ("close failed\n"); | 4005 | MHD_PANIC ("close failed\n"); |
4006 | #endif | 4006 | #endif |
4007 | if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) | 4007 | if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) |
@@ -4032,7 +4032,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
4032 | } | 4032 | } |
4033 | close_all_connections (daemon); | 4033 | close_all_connections (daemon); |
4034 | if ( (MHD_INVALID_SOCKET != fd) && | 4034 | if ( (MHD_INVALID_SOCKET != fd) && |
4035 | (0 != CLOSE (fd)) ) | 4035 | (0 != MHD_socket_close_ (fd)) ) |
4036 | MHD_PANIC ("close failed\n"); | 4036 | MHD_PANIC ("close failed\n"); |
4037 | 4037 | ||
4038 | /* TLS clean up */ | 4038 | /* TLS clean up */ |
@@ -4047,7 +4047,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
4047 | #if EPOLL_SUPPORT | 4047 | #if EPOLL_SUPPORT |
4048 | if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) && | 4048 | if ( (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) && |
4049 | (-1 != daemon->epoll_fd) && | 4049 | (-1 != daemon->epoll_fd) && |
4050 | (0 != CLOSE (daemon->epoll_fd)) ) | 4050 | (0 != MHD_socket_close_ (daemon->epoll_fd)) ) |
4051 | MHD_PANIC ("close failed\n"); | 4051 | MHD_PANIC ("close failed\n"); |
4052 | #endif | 4052 | #endif |
4053 | 4053 | ||
diff --git a/src/platform/platform_interface.h b/src/platform/platform_interface.h new file mode 100644 index 00000000..6e88be50 --- /dev/null +++ b/src/platform/platform_interface.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | (C) 2014 Karlson2k (Evgeny Grin) | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library. | ||
17 | If not, see <http://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | /** | ||
21 | * @file platform/platfrom_interface.h | ||
22 | * @brief internal platform abstraction functions | ||
23 | * @author Karlson2k (Evgeny Grin) | ||
24 | */ | ||
25 | |||
26 | #ifndef MHD_PLATFORM_INTERFACE_H | ||
27 | #define MHD_PLATFORM_INTERFACE_H | ||
28 | |||
29 | /* MHD_socket_close_(fd) close any FDs (non-W32) / close only socket FDs (W32) */ | ||
30 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
31 | #define MHD_socket_close_(fd) close((fd)) | ||
32 | #else | ||
33 | #define MHD_socket_close_(fd) closesocket((fd)) | ||
34 | #endif | ||
35 | |||
36 | #endif // MHD_PLATFORM_INTERFACE_H | ||
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am index 363b8c09..7ec4ff68 100644 --- a/src/testcurl/Makefile.am +++ b/src/testcurl/Makefile.am | |||
@@ -17,6 +17,7 @@ AM_CPPFLAGS = \ | |||
17 | -I$(top_srcdir) \ | 17 | -I$(top_srcdir) \ |
18 | -I$(top_srcdir)/src/microhttpd \ | 18 | -I$(top_srcdir)/src/microhttpd \ |
19 | -I$(top_srcdir)/src/include \ | 19 | -I$(top_srcdir)/src/include \ |
20 | -I$(top_srcdir)/src/platform \ | ||
20 | $(LIBCURL_CPPFLAGS) | 21 | $(LIBCURL_CPPFLAGS) |
21 | 22 | ||
22 | if !HAVE_W32 | 23 | if !HAVE_W32 |
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am index 2f05f57a..2051423d 100644 --- a/src/testcurl/https/Makefile.am +++ b/src/testcurl/https/Makefile.am | |||
@@ -12,6 +12,7 @@ AM_CPPFLAGS = \ | |||
12 | $(PLIBC_INCLUDE) \ | 12 | $(PLIBC_INCLUDE) \ |
13 | -I$(top_srcdir)/src/include \ | 13 | -I$(top_srcdir)/src/include \ |
14 | -I$(top_srcdir)/src/microhttpd \ | 14 | -I$(top_srcdir)/src/microhttpd \ |
15 | -I$(top_srcdir)/src/platform \ | ||
15 | $(LIBCURL_CPPFLAGS) | 16 | $(LIBCURL_CPPFLAGS) |
16 | 17 | ||
17 | check_PROGRAMS = \ | 18 | check_PROGRAMS = \ |
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c index 40920b36..855a0742 100644 --- a/src/testcurl/test_get.c +++ b/src/testcurl/test_get.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include "MHD_config.h" | 28 | #include "MHD_config.h" |
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | #include "platform_interface.h" | ||
30 | #include <curl/curl.h> | 31 | #include <curl/curl.h> |
31 | #include <microhttpd.h> | 32 | #include <microhttpd.h> |
32 | #include <stdlib.h> | 33 | #include <stdlib.h> |
@@ -472,7 +473,7 @@ testStopRace (int poll_flag) | |||
472 | if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0) | 473 | if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0) |
473 | { | 474 | { |
474 | fprintf(stderr, "connect: %m\n"); | 475 | fprintf(stderr, "connect: %m\n"); |
475 | CLOSE (fd); | 476 | MHD_socket_close_ (fd); |
476 | return 512; | 477 | return 512; |
477 | } | 478 | } |
478 | 479 | ||
@@ -483,7 +484,7 @@ testStopRace (int poll_flag) | |||
483 | /* printf("Stopping daemon\n"); */ | 484 | /* printf("Stopping daemon\n"); */ |
484 | MHD_stop_daemon (d); | 485 | MHD_stop_daemon (d); |
485 | 486 | ||
486 | CLOSE (fd); | 487 | MHD_socket_close_ (fd); |
487 | 488 | ||
488 | /* printf("good\n"); */ | 489 | /* printf("good\n"); */ |
489 | return 0; | 490 | return 0; |