diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/platform.h | 14 | ||||
-rw-r--r-- | src/include/platform_interface.h | 60 | ||||
-rw-r--r-- | src/include/w32functions.h | 7 |
3 files changed, 0 insertions, 81 deletions
diff --git a/src/include/platform.h b/src/include/platform.h index e9c2fa12..6d51747d 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -124,20 +124,6 @@ typedef time_t _MHD_TIMEVAL_TV_SEC_TYPE; | |||
124 | typedef long _MHD_TIMEVAL_TV_SEC_TYPE; | 124 | typedef long _MHD_TIMEVAL_TV_SEC_TYPE; |
125 | #endif /* _WIN32 */ | 125 | #endif /* _WIN32 */ |
126 | 126 | ||
127 | /* TODO: remove include when pipes implementation is moved to other file */ | ||
128 | #include "../microhttpd/mhd_sockets.h" | ||
129 | /* Force don't use pipes on W32 */ | ||
130 | #if defined(_WIN32) && !defined(MHD_DONT_USE_PIPES) | ||
131 | #define MHD_DONT_USE_PIPES 1 | ||
132 | #endif /* defined(_WIN32) && !defined(MHD_DONT_USE_PIPES) */ | ||
133 | |||
134 | /* MHD_pipe is type for pipe FDs*/ | ||
135 | #ifndef MHD_DONT_USE_PIPES | ||
136 | typedef int MHD_pipe; | ||
137 | #else /* ! MHD_DONT_USE_PIPES */ | ||
138 | typedef MHD_socket MHD_pipe; | ||
139 | #endif /* ! MHD_DONT_USE_PIPES */ | ||
140 | |||
141 | #if !defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501 | 127 | #if !defined(IPPROTO_IPV6) && defined(_MSC_FULL_VER) && _WIN32_WINNT >= 0x0501 |
142 | /* VC use IPPROTO_IPV6 as part of enum */ | 128 | /* VC use IPPROTO_IPV6 as part of enum */ |
143 | #define IPPROTO_IPV6 IPPROTO_IPV6 | 129 | #define IPPROTO_IPV6 IPPROTO_IPV6 |
diff --git a/src/include/platform_interface.h b/src/include/platform_interface.h index fa84bcd5..b641a002 100644 --- a/src/include/platform_interface.h +++ b/src/include/platform_interface.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #define MHD_PLATFORM_INTERFACE_H | 27 | #define MHD_PLATFORM_INTERFACE_H |
28 | 28 | ||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | #include "../microhttpd/mhd_sockets.h" | ||
31 | #if defined(_WIN32) && !defined(__CYGWIN__) | 30 | #if defined(_WIN32) && !defined(__CYGWIN__) |
32 | #include "w32functions.h" | 31 | #include "w32functions.h" |
33 | #endif | 32 | #endif |
@@ -47,65 +46,6 @@ | |||
47 | #endif /* ! _WIN32*/ | 46 | #endif /* ! _WIN32*/ |
48 | #endif /* ! HAVE_SNPRINTF */ | 47 | #endif /* ! HAVE_SNPRINTF */ |
49 | 48 | ||
50 | /* MHD_pipe_ create pipe (!MHD_DONT_USE_PIPES) / | ||
51 | * create two connected sockets (MHD_DONT_USE_PIPES) */ | ||
52 | #ifndef MHD_DONT_USE_PIPES | ||
53 | #define MHD_pipe_(fdarr) pipe((fdarr)) | ||
54 | #else /* MHD_DONT_USE_PIPES */ | ||
55 | #if !defined(_WIN32) || defined(__CYGWIN__) | ||
56 | #define MHD_pipe_(fdarr) socketpair(AF_LOCAL, SOCK_STREAM, 0, (fdarr)) | ||
57 | #else /* !defined(_WIN32) || defined(__CYGWIN__) */ | ||
58 | #define MHD_pipe_(fdarr) MHD_W32_pair_of_sockets_((fdarr)) | ||
59 | #endif /* !defined(_WIN32) || defined(__CYGWIN__) */ | ||
60 | #endif /* MHD_DONT_USE_PIPES */ | ||
61 | |||
62 | /* MHD_pipe_errno_ is errno of last function (!MHD_DONT_USE_PIPES) / | ||
63 | * errno of last emulated pipe function (MHD_DONT_USE_PIPES) */ | ||
64 | #ifndef MHD_DONT_USE_PIPES | ||
65 | #define MHD_pipe_errno_ errno | ||
66 | #else | ||
67 | #define MHD_pipe_errno_ MHD_socket_errno_ | ||
68 | #endif | ||
69 | |||
70 | /* MHD_pipe_last_strerror_ is description string of last errno (!MHD_DONT_USE_PIPES) / | ||
71 | * description string of last pipe error (MHD_DONT_USE_PIPES) */ | ||
72 | #ifndef MHD_DONT_USE_PIPES | ||
73 | #define MHD_pipe_last_strerror_() strerror(errno) | ||
74 | #else | ||
75 | #define MHD_pipe_last_strerror_() MHD_socket_last_strerr_() | ||
76 | #endif | ||
77 | |||
78 | /* MHD_pipe_write_ write data to real pipe (!MHD_DONT_USE_PIPES) / | ||
79 | * write data to emulated pipe (MHD_DONT_USE_PIPES) */ | ||
80 | #ifndef MHD_DONT_USE_PIPES | ||
81 | #define MHD_pipe_write_(fd, ptr, sz) write((fd), (const void*)(ptr), (sz)) | ||
82 | #else | ||
83 | #define MHD_pipe_write_(fd, ptr, sz) send((fd), (const char*)(ptr), (sz), 0) | ||
84 | #endif | ||
85 | |||
86 | /* MHD_pipe_drain_ drain data from real pipe (!MHD_DONT_USE_PIPES) / | ||
87 | * drain data from emulated pipe (MHD_DONT_USE_PIPES) */ | ||
88 | #ifndef MHD_DONT_USE_PIPES | ||
89 | #define MHD_pipe_drain_(fd) do { long tmp; while (0 < read((fd), (void*)&tmp, sizeof (tmp))) ; } while (0) | ||
90 | #else | ||
91 | #define MHD_pipe_drain_(fd) do { long tmp; while (0 < recv((fd), (void*)&tmp, sizeof (tmp), 0)) ; } while (0) | ||
92 | #endif | ||
93 | |||
94 | /* MHD_pipe_close_(fd) close any FDs (non-W32) / | ||
95 | * close emulated pipe FDs (W32) */ | ||
96 | #ifndef MHD_DONT_USE_PIPES | ||
97 | #define MHD_pipe_close_(fd) close((fd)) | ||
98 | #else | ||
99 | #define MHD_pipe_close_(fd) MHD_socket_close_((fd)) | ||
100 | #endif | ||
101 | |||
102 | /* MHD_INVALID_PIPE_ is a value of bad pipe FD */ | ||
103 | #ifndef MHD_DONT_USE_PIPES | ||
104 | #define MHD_INVALID_PIPE_ (-1) | ||
105 | #else | ||
106 | #define MHD_INVALID_PIPE_ MHD_INVALID_SOCKET | ||
107 | #endif | ||
108 | |||
109 | #if !defined(_WIN32) || defined(__CYGWIN__) | 49 | #if !defined(_WIN32) || defined(__CYGWIN__) |
110 | #define MHD_random_() random() | 50 | #define MHD_random_() random() |
111 | #else | 51 | #else |
diff --git a/src/include/w32functions.h b/src/include/w32functions.h index f8445f30..0694a381 100644 --- a/src/include/w32functions.h +++ b/src/include/w32functions.h | |||
@@ -40,13 +40,6 @@ extern "C" | |||
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Create pair of mutually connected TCP/IP sockets on loopback address | ||
44 | * @param sockets_pair array to receive resulted sockets | ||
45 | * @return zero on success, -1 otherwise | ||
46 | */ | ||
47 | int MHD_W32_pair_of_sockets_(SOCKET sockets_pair[2]); | ||
48 | |||
49 | /** | ||
50 | * Generate 31-bit pseudo random number. | 43 | * Generate 31-bit pseudo random number. |
51 | * Function initialize itself at first call to current time. | 44 | * Function initialize itself at first call to current time. |
52 | * @return 31-bit pseudo random number. | 45 | * @return 31-bit pseudo random number. |