passenger 5.0.8 → 5.0.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/.editorconfig +20 -0
- data/CHANGELOG +21 -0
- data/bin/passenger-install-apache2-module +3 -1
- data/build/agents.rb +7 -5
- data/build/basics.rb +3 -3
- data/build/common_library.rb +52 -30
- data/build/cxx_tests.rb +20 -13
- data/build/misc.rb +5 -5
- data/doc/Design and Architecture.html +1 -1
- data/doc/Design and Architecture.txt +1 -1
- data/doc/Packaging.html +4 -4
- data/doc/Packaging.txt.md +4 -4
- data/doc/Users guide Apache.html +22 -9
- data/doc/Users guide Apache.idmap.txt +4 -2
- data/doc/Users guide Apache.txt +2 -0
- data/doc/Users guide Nginx.html +22 -9
- data/doc/Users guide Nginx.idmap.txt +4 -2
- data/doc/Users guide Nginx.txt +2 -0
- data/doc/Users guide Standalone.html +14 -9
- data/doc/Users guide Standalone.idmap.txt +4 -2
- data/doc/users_guide_snippets/installation.txt +10 -6
- data/ext/apache2/Hooks.cpp +13 -2
- data/ext/common/ApplicationPool2/Pool/Inspection.h +8 -3
- data/ext/common/BackgroundEventLoop.cpp +249 -67
- data/ext/common/BackgroundEventLoop.h +5 -5
- data/ext/common/Constants.h +1 -1
- data/ext/common/InstanceDirectory.h +8 -6
- data/ext/common/ServerKit/Context.h +8 -2
- data/ext/common/ServerKit/FileBufferedChannel.h +262 -226
- data/ext/common/ServerKit/HeaderTable.h +28 -3
- data/ext/common/ServerKit/HttpHeaderParser.h +37 -13
- data/ext/common/ServerKit/HttpServer.h +17 -1
- data/ext/common/ServerKit/Implementation.cpp +2 -0
- data/ext/common/ServerKit/Server.h +25 -28
- data/ext/common/Utils/IOUtils.cpp +11 -0
- data/ext/common/Utils/ProcessMetricsCollector.h +4 -0
- data/ext/common/Utils/StrIntUtils.cpp +11 -7
- data/ext/common/Utils/StrIntUtils.h +1 -1
- data/ext/common/Utils/StrIntUtilsNoStrictAliasing.cpp +21 -16
- data/ext/common/agents/Base.cpp +6 -0
- data/ext/common/agents/Base.h +2 -0
- data/ext/common/agents/HelperAgent/AdminServer.h +25 -25
- data/ext/common/agents/HelperAgent/Main.cpp +37 -12
- data/ext/common/agents/HelperAgent/RequestHandler.h +18 -20
- data/ext/common/agents/HelperAgent/RequestHandler/AppResponse.h +4 -0
- data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +10 -6
- data/ext/common/agents/HelperAgent/RequestHandler/Hooks.cpp +2 -0
- data/ext/common/agents/HelperAgent/RequestHandler/InitRequest.cpp +1 -1
- data/ext/common/agents/HelperAgent/RequestHandler/SendRequest.cpp +1 -1
- data/ext/common/agents/HelperAgent/RequestHandler/Utils.cpp +9 -2
- data/ext/common/agents/HelperAgent/ResponseCache.h +11 -11
- data/ext/common/agents/LoggingAgent/AdminServer.h +8 -8
- data/ext/common/agents/LoggingAgent/Main.cpp +6 -5
- data/ext/common/agents/Watchdog/AdminServer.h +13 -13
- data/ext/common/agents/Watchdog/Main.cpp +8 -3
- data/ext/libuv/.gitignore +72 -0
- data/ext/libuv/AUTHORS +199 -0
- data/ext/libuv/ChangeLog +2023 -0
- data/ext/libuv/LICENSE +46 -0
- data/ext/libuv/Makefile.am +336 -0
- data/ext/libuv/README.md +197 -0
- data/ext/libuv/checksparse.sh +233 -0
- data/ext/libuv/common.gypi +210 -0
- data/ext/libuv/configure.ac +67 -0
- data/ext/libuv/gyp_uv.py +96 -0
- data/ext/libuv/include/android-ifaddrs.h +54 -0
- data/ext/libuv/include/pthread-fixes.h +72 -0
- data/ext/libuv/include/tree.h +768 -0
- data/ext/libuv/include/uv-aix.h +32 -0
- data/ext/libuv/include/uv-bsd.h +34 -0
- data/ext/libuv/include/uv-darwin.h +61 -0
- data/ext/libuv/include/uv-errno.h +418 -0
- data/ext/libuv/include/uv-linux.h +34 -0
- data/ext/libuv/include/uv-sunos.h +44 -0
- data/ext/libuv/include/uv-threadpool.h +37 -0
- data/ext/libuv/include/uv-unix.h +383 -0
- data/ext/libuv/include/uv-version.h +39 -0
- data/ext/libuv/include/uv.h +1455 -0
- data/ext/libuv/libuv.pc.in +11 -0
- data/ext/libuv/m4/.gitignore +4 -0
- data/ext/libuv/m4/as_case.m4 +21 -0
- data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
- data/ext/libuv/src/fs-poll.c +255 -0
- data/ext/libuv/src/heap-inl.h +245 -0
- data/ext/libuv/src/inet.c +313 -0
- data/ext/libuv/src/queue.h +92 -0
- data/ext/libuv/src/threadpool.c +303 -0
- data/ext/libuv/src/unix/aix.c +1240 -0
- data/ext/libuv/src/unix/android-ifaddrs.c +703 -0
- data/ext/libuv/src/unix/async.c +284 -0
- data/ext/libuv/src/unix/atomic-ops.h +60 -0
- data/ext/libuv/src/unix/core.c +985 -0
- data/ext/libuv/src/unix/darwin-proctitle.c +206 -0
- data/ext/libuv/src/unix/darwin.c +331 -0
- data/ext/libuv/src/unix/dl.c +83 -0
- data/ext/libuv/src/unix/freebsd.c +435 -0
- data/ext/libuv/src/unix/fs.c +1189 -0
- data/ext/libuv/src/unix/fsevents.c +899 -0
- data/ext/libuv/src/unix/getaddrinfo.c +202 -0
- data/ext/libuv/src/unix/getnameinfo.c +120 -0
- data/ext/libuv/src/unix/internal.h +314 -0
- data/ext/libuv/src/unix/kqueue.c +418 -0
- data/ext/libuv/src/unix/linux-core.c +876 -0
- data/ext/libuv/src/unix/linux-inotify.c +257 -0
- data/ext/libuv/src/unix/linux-syscalls.c +471 -0
- data/ext/libuv/src/unix/linux-syscalls.h +158 -0
- data/ext/libuv/src/unix/loop-watcher.c +63 -0
- data/ext/libuv/src/unix/loop.c +135 -0
- data/ext/libuv/src/unix/netbsd.c +368 -0
- data/ext/libuv/src/unix/openbsd.c +384 -0
- data/ext/libuv/src/unix/pipe.c +288 -0
- data/ext/libuv/src/unix/poll.c +113 -0
- data/ext/libuv/src/unix/process.c +551 -0
- data/ext/libuv/src/unix/proctitle.c +102 -0
- data/ext/libuv/src/unix/pthread-fixes.c +103 -0
- data/ext/libuv/src/unix/signal.c +465 -0
- data/ext/libuv/src/unix/spinlock.h +53 -0
- data/ext/libuv/src/unix/stream.c +1598 -0
- data/ext/libuv/src/unix/sunos.c +763 -0
- data/ext/libuv/src/unix/tcp.c +327 -0
- data/ext/libuv/src/unix/thread.c +519 -0
- data/ext/libuv/src/unix/timer.c +172 -0
- data/ext/libuv/src/unix/tty.c +265 -0
- data/ext/libuv/src/unix/udp.c +833 -0
- data/ext/libuv/src/uv-common.c +544 -0
- data/ext/libuv/src/uv-common.h +214 -0
- data/ext/libuv/src/version.c +49 -0
- data/ext/libuv/uv.gyp +487 -0
- data/ext/nginx/ContentHandler.c +21 -10
- data/ext/nginx/ngx_http_passenger_module.c +7 -0
- data/ext/oxt/implementation.cpp +9 -2
- data/ext/oxt/initialize.hpp +5 -1
- data/lib/phusion_passenger.rb +3 -3
- data/lib/phusion_passenger/admin_tools/instance.rb +10 -6
- data/lib/phusion_passenger/admin_tools/instance_registry.rb +6 -2
- data/lib/phusion_passenger/packaging.rb +3 -4
- data/lib/phusion_passenger/platform_info.rb +13 -1
- data/lib/phusion_passenger/platform_info/apache.rb +15 -4
- data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -1
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +184 -99
- data/lib/phusion_passenger/request_handler/thread_handler.rb +13 -6
- data/lib/phusion_passenger/standalone/start_command.rb +2 -2
- data/resources/templates/apache2/apache_install_broken.txt.erb +2 -1
- metadata +99 -22
- metadata.gz.asc +7 -7
- data/ext/libeio/Changes +0 -76
- data/ext/libeio/LICENSE +0 -36
- data/ext/libeio/Makefile.am +0 -15
- data/ext/libeio/Makefile.in +0 -694
- data/ext/libeio/aclocal.m4 +0 -9418
- data/ext/libeio/autogen.sh +0 -3
- data/ext/libeio/config.guess +0 -1540
- data/ext/libeio/config.h.in +0 -136
- data/ext/libeio/config.sub +0 -1779
- data/ext/libeio/configure +0 -14822
- data/ext/libeio/configure.ac +0 -22
- data/ext/libeio/demo.c +0 -194
- data/ext/libeio/ecb.h +0 -714
- data/ext/libeio/eio.c +0 -2818
- data/ext/libeio/eio.h +0 -414
- data/ext/libeio/install-sh +0 -520
- data/ext/libeio/libeio.m4 +0 -195
- data/ext/libeio/ltmain.sh +0 -9636
- data/ext/libeio/missing +0 -376
- data/ext/libeio/xthread.h +0 -166
@@ -0,0 +1,214 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
/*
|
23
|
+
* This file is private to libuv. It provides common functionality to both
|
24
|
+
* Windows and Unix backends.
|
25
|
+
*/
|
26
|
+
|
27
|
+
#ifndef UV_COMMON_H_
|
28
|
+
#define UV_COMMON_H_
|
29
|
+
|
30
|
+
#include <assert.h>
|
31
|
+
#include <stdarg.h>
|
32
|
+
#include <stddef.h>
|
33
|
+
|
34
|
+
#if defined(_MSC_VER) && _MSC_VER < 1600
|
35
|
+
# include "stdint-msvc2008.h"
|
36
|
+
#else
|
37
|
+
# include <stdint.h>
|
38
|
+
#endif
|
39
|
+
|
40
|
+
#include "uv.h"
|
41
|
+
#include "tree.h"
|
42
|
+
#include "queue.h"
|
43
|
+
|
44
|
+
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
45
|
+
|
46
|
+
#define container_of(ptr, type, member) \
|
47
|
+
((type *) ((char *) (ptr) - offsetof(type, member)))
|
48
|
+
|
49
|
+
#define STATIC_ASSERT(expr) \
|
50
|
+
void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
|
51
|
+
|
52
|
+
#ifndef _WIN32
|
53
|
+
enum {
|
54
|
+
UV__HANDLE_INTERNAL = 0x8000,
|
55
|
+
UV__HANDLE_ACTIVE = 0x4000,
|
56
|
+
UV__HANDLE_REF = 0x2000,
|
57
|
+
UV__HANDLE_CLOSING = 0 /* no-op on unix */
|
58
|
+
};
|
59
|
+
#else
|
60
|
+
# define UV__HANDLE_INTERNAL 0x80
|
61
|
+
# define UV__HANDLE_ACTIVE 0x40
|
62
|
+
# define UV__HANDLE_REF 0x20
|
63
|
+
# define UV__HANDLE_CLOSING 0x01
|
64
|
+
#endif
|
65
|
+
|
66
|
+
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
|
67
|
+
|
68
|
+
void uv__loop_close(uv_loop_t* loop);
|
69
|
+
|
70
|
+
int uv__tcp_bind(uv_tcp_t* tcp,
|
71
|
+
const struct sockaddr* addr,
|
72
|
+
unsigned int addrlen,
|
73
|
+
unsigned int flags);
|
74
|
+
|
75
|
+
int uv__tcp_connect(uv_connect_t* req,
|
76
|
+
uv_tcp_t* handle,
|
77
|
+
const struct sockaddr* addr,
|
78
|
+
unsigned int addrlen,
|
79
|
+
uv_connect_cb cb);
|
80
|
+
|
81
|
+
int uv__udp_bind(uv_udp_t* handle,
|
82
|
+
const struct sockaddr* addr,
|
83
|
+
unsigned int addrlen,
|
84
|
+
unsigned int flags);
|
85
|
+
|
86
|
+
int uv__udp_send(uv_udp_send_t* req,
|
87
|
+
uv_udp_t* handle,
|
88
|
+
const uv_buf_t bufs[],
|
89
|
+
unsigned int nbufs,
|
90
|
+
const struct sockaddr* addr,
|
91
|
+
unsigned int addrlen,
|
92
|
+
uv_udp_send_cb send_cb);
|
93
|
+
|
94
|
+
int uv__udp_try_send(uv_udp_t* handle,
|
95
|
+
const uv_buf_t bufs[],
|
96
|
+
unsigned int nbufs,
|
97
|
+
const struct sockaddr* addr,
|
98
|
+
unsigned int addrlen);
|
99
|
+
|
100
|
+
int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloccb,
|
101
|
+
uv_udp_recv_cb recv_cb);
|
102
|
+
|
103
|
+
int uv__udp_recv_stop(uv_udp_t* handle);
|
104
|
+
|
105
|
+
void uv__fs_poll_close(uv_fs_poll_t* handle);
|
106
|
+
|
107
|
+
int uv__getaddrinfo_translate_error(int sys_err); /* EAI_* error. */
|
108
|
+
|
109
|
+
void uv__work_submit(uv_loop_t* loop,
|
110
|
+
struct uv__work *w,
|
111
|
+
void (*work)(struct uv__work *w),
|
112
|
+
void (*done)(struct uv__work *w, int status));
|
113
|
+
|
114
|
+
void uv__work_done(uv_async_t* handle);
|
115
|
+
|
116
|
+
size_t uv__count_bufs(const uv_buf_t bufs[], unsigned int nbufs);
|
117
|
+
|
118
|
+
int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value);
|
119
|
+
|
120
|
+
void uv__fs_scandir_cleanup(uv_fs_t* req);
|
121
|
+
|
122
|
+
#define uv__has_active_reqs(loop) \
|
123
|
+
(QUEUE_EMPTY(&(loop)->active_reqs) == 0)
|
124
|
+
|
125
|
+
#define uv__req_register(loop, req) \
|
126
|
+
do { \
|
127
|
+
QUEUE_INSERT_TAIL(&(loop)->active_reqs, &(req)->active_queue); \
|
128
|
+
} \
|
129
|
+
while (0)
|
130
|
+
|
131
|
+
#define uv__req_unregister(loop, req) \
|
132
|
+
do { \
|
133
|
+
assert(uv__has_active_reqs(loop)); \
|
134
|
+
QUEUE_REMOVE(&(req)->active_queue); \
|
135
|
+
} \
|
136
|
+
while (0)
|
137
|
+
|
138
|
+
#define uv__has_active_handles(loop) \
|
139
|
+
((loop)->active_handles > 0)
|
140
|
+
|
141
|
+
#define uv__active_handle_add(h) \
|
142
|
+
do { \
|
143
|
+
(h)->loop->active_handles++; \
|
144
|
+
} \
|
145
|
+
while (0)
|
146
|
+
|
147
|
+
#define uv__active_handle_rm(h) \
|
148
|
+
do { \
|
149
|
+
(h)->loop->active_handles--; \
|
150
|
+
} \
|
151
|
+
while (0)
|
152
|
+
|
153
|
+
#define uv__is_active(h) \
|
154
|
+
(((h)->flags & UV__HANDLE_ACTIVE) != 0)
|
155
|
+
|
156
|
+
#define uv__is_closing(h) \
|
157
|
+
(((h)->flags & (UV_CLOSING | UV_CLOSED)) != 0)
|
158
|
+
|
159
|
+
#define uv__handle_start(h) \
|
160
|
+
do { \
|
161
|
+
assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \
|
162
|
+
if (((h)->flags & UV__HANDLE_ACTIVE) != 0) break; \
|
163
|
+
(h)->flags |= UV__HANDLE_ACTIVE; \
|
164
|
+
if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_add(h); \
|
165
|
+
} \
|
166
|
+
while (0)
|
167
|
+
|
168
|
+
#define uv__handle_stop(h) \
|
169
|
+
do { \
|
170
|
+
assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \
|
171
|
+
if (((h)->flags & UV__HANDLE_ACTIVE) == 0) break; \
|
172
|
+
(h)->flags &= ~UV__HANDLE_ACTIVE; \
|
173
|
+
if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_rm(h); \
|
174
|
+
} \
|
175
|
+
while (0)
|
176
|
+
|
177
|
+
#define uv__handle_ref(h) \
|
178
|
+
do { \
|
179
|
+
if (((h)->flags & UV__HANDLE_REF) != 0) break; \
|
180
|
+
(h)->flags |= UV__HANDLE_REF; \
|
181
|
+
if (((h)->flags & UV__HANDLE_CLOSING) != 0) break; \
|
182
|
+
if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_add(h); \
|
183
|
+
} \
|
184
|
+
while (0)
|
185
|
+
|
186
|
+
#define uv__handle_unref(h) \
|
187
|
+
do { \
|
188
|
+
if (((h)->flags & UV__HANDLE_REF) == 0) break; \
|
189
|
+
(h)->flags &= ~UV__HANDLE_REF; \
|
190
|
+
if (((h)->flags & UV__HANDLE_CLOSING) != 0) break; \
|
191
|
+
if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_rm(h); \
|
192
|
+
} \
|
193
|
+
while (0)
|
194
|
+
|
195
|
+
#define uv__has_ref(h) \
|
196
|
+
(((h)->flags & UV__HANDLE_REF) != 0)
|
197
|
+
|
198
|
+
#if defined(_WIN32)
|
199
|
+
# define uv__handle_platform_init(h)
|
200
|
+
#else
|
201
|
+
# define uv__handle_platform_init(h) ((h)->next_closing = NULL)
|
202
|
+
#endif
|
203
|
+
|
204
|
+
#define uv__handle_init(loop_, h, type_) \
|
205
|
+
do { \
|
206
|
+
(h)->loop = (loop_); \
|
207
|
+
(h)->type = (type_); \
|
208
|
+
(h)->flags = UV__HANDLE_REF; /* Ref the loop when active. */ \
|
209
|
+
QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue); \
|
210
|
+
uv__handle_platform_init(h); \
|
211
|
+
} \
|
212
|
+
while (0)
|
213
|
+
|
214
|
+
#endif /* UV_COMMON_H_ */
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include "uv.h"
|
23
|
+
|
24
|
+
#define UV_VERSION ((UV_VERSION_MAJOR << 16) | \
|
25
|
+
(UV_VERSION_MINOR << 8) | \
|
26
|
+
(UV_VERSION_PATCH))
|
27
|
+
|
28
|
+
#define UV_STRINGIFY(v) UV_STRINGIFY_HELPER(v)
|
29
|
+
#define UV_STRINGIFY_HELPER(v) #v
|
30
|
+
|
31
|
+
#define UV_VERSION_STRING_BASE UV_STRINGIFY(UV_VERSION_MAJOR) "." \
|
32
|
+
UV_STRINGIFY(UV_VERSION_MINOR) "." \
|
33
|
+
UV_STRINGIFY(UV_VERSION_PATCH)
|
34
|
+
|
35
|
+
#if UV_VERSION_IS_RELEASE
|
36
|
+
# define UV_VERSION_STRING UV_VERSION_STRING_BASE
|
37
|
+
#else
|
38
|
+
# define UV_VERSION_STRING UV_VERSION_STRING_BASE "-" UV_VERSION_SUFFIX
|
39
|
+
#endif
|
40
|
+
|
41
|
+
|
42
|
+
unsigned int uv_version(void) {
|
43
|
+
return UV_VERSION;
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
const char* uv_version_string(void) {
|
48
|
+
return UV_VERSION_STRING;
|
49
|
+
}
|
data/ext/libuv/uv.gyp
ADDED
@@ -0,0 +1,487 @@
|
|
1
|
+
{
|
2
|
+
'target_defaults': {
|
3
|
+
'conditions': [
|
4
|
+
['OS != "win"', {
|
5
|
+
'defines': [
|
6
|
+
'_LARGEFILE_SOURCE',
|
7
|
+
'_FILE_OFFSET_BITS=64',
|
8
|
+
],
|
9
|
+
'conditions': [
|
10
|
+
['OS=="solaris"', {
|
11
|
+
'cflags': [ '-pthreads' ],
|
12
|
+
}],
|
13
|
+
['OS not in "solaris android"', {
|
14
|
+
'cflags': [ '-pthread' ],
|
15
|
+
}],
|
16
|
+
],
|
17
|
+
}],
|
18
|
+
],
|
19
|
+
'xcode_settings': {
|
20
|
+
'WARNING_CFLAGS': [ '-Wall', '-Wextra', '-Wno-unused-parameter' ],
|
21
|
+
'OTHER_CFLAGS': [ '-g', '--std=gnu89', '-pedantic' ],
|
22
|
+
}
|
23
|
+
},
|
24
|
+
|
25
|
+
'targets': [
|
26
|
+
{
|
27
|
+
'target_name': 'libuv',
|
28
|
+
'type': '<(uv_library)',
|
29
|
+
'include_dirs': [
|
30
|
+
'include',
|
31
|
+
'src/',
|
32
|
+
],
|
33
|
+
'direct_dependent_settings': {
|
34
|
+
'include_dirs': [ 'include' ],
|
35
|
+
'conditions': [
|
36
|
+
['OS != "win"', {
|
37
|
+
'defines': [
|
38
|
+
'_LARGEFILE_SOURCE',
|
39
|
+
'_FILE_OFFSET_BITS=64',
|
40
|
+
],
|
41
|
+
}],
|
42
|
+
['OS in "mac ios"', {
|
43
|
+
'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ],
|
44
|
+
}],
|
45
|
+
['OS == "linux"', {
|
46
|
+
'defines': [ '_POSIX_C_SOURCE=200112' ],
|
47
|
+
}],
|
48
|
+
],
|
49
|
+
},
|
50
|
+
'sources': [
|
51
|
+
'common.gypi',
|
52
|
+
'include/uv.h',
|
53
|
+
'include/tree.h',
|
54
|
+
'include/uv-errno.h',
|
55
|
+
'include/uv-threadpool.h',
|
56
|
+
'include/uv-version.h',
|
57
|
+
'src/fs-poll.c',
|
58
|
+
'src/heap-inl.h',
|
59
|
+
'src/inet.c',
|
60
|
+
'src/queue.h',
|
61
|
+
'src/threadpool.c',
|
62
|
+
'src/uv-common.c',
|
63
|
+
'src/uv-common.h',
|
64
|
+
'src/version.c'
|
65
|
+
],
|
66
|
+
'conditions': [
|
67
|
+
[ 'OS=="win"', {
|
68
|
+
'defines': [
|
69
|
+
'_WIN32_WINNT=0x0600',
|
70
|
+
'_GNU_SOURCE',
|
71
|
+
],
|
72
|
+
'sources': [
|
73
|
+
'include/uv-win.h',
|
74
|
+
'src/win/async.c',
|
75
|
+
'src/win/atomicops-inl.h',
|
76
|
+
'src/win/core.c',
|
77
|
+
'src/win/dl.c',
|
78
|
+
'src/win/error.c',
|
79
|
+
'src/win/fs.c',
|
80
|
+
'src/win/fs-event.c',
|
81
|
+
'src/win/getaddrinfo.c',
|
82
|
+
'src/win/getnameinfo.c',
|
83
|
+
'src/win/handle.c',
|
84
|
+
'src/win/handle-inl.h',
|
85
|
+
'src/win/internal.h',
|
86
|
+
'src/win/loop-watcher.c',
|
87
|
+
'src/win/pipe.c',
|
88
|
+
'src/win/thread.c',
|
89
|
+
'src/win/poll.c',
|
90
|
+
'src/win/process.c',
|
91
|
+
'src/win/process-stdio.c',
|
92
|
+
'src/win/req.c',
|
93
|
+
'src/win/req-inl.h',
|
94
|
+
'src/win/signal.c',
|
95
|
+
'src/win/stream.c',
|
96
|
+
'src/win/stream-inl.h',
|
97
|
+
'src/win/tcp.c',
|
98
|
+
'src/win/tty.c',
|
99
|
+
'src/win/timer.c',
|
100
|
+
'src/win/udp.c',
|
101
|
+
'src/win/util.c',
|
102
|
+
'src/win/winapi.c',
|
103
|
+
'src/win/winapi.h',
|
104
|
+
'src/win/winsock.c',
|
105
|
+
'src/win/winsock.h',
|
106
|
+
],
|
107
|
+
'link_settings': {
|
108
|
+
'libraries': [
|
109
|
+
'-ladvapi32',
|
110
|
+
'-liphlpapi',
|
111
|
+
'-lpsapi',
|
112
|
+
'-lshell32',
|
113
|
+
'-lws2_32'
|
114
|
+
],
|
115
|
+
},
|
116
|
+
}, { # Not Windows i.e. POSIX
|
117
|
+
'cflags': [
|
118
|
+
'-g',
|
119
|
+
'--std=gnu89',
|
120
|
+
'-pedantic',
|
121
|
+
'-Wall',
|
122
|
+
'-Wextra',
|
123
|
+
'-Wno-unused-parameter',
|
124
|
+
],
|
125
|
+
'sources': [
|
126
|
+
'include/uv-unix.h',
|
127
|
+
'include/uv-linux.h',
|
128
|
+
'include/uv-sunos.h',
|
129
|
+
'include/uv-darwin.h',
|
130
|
+
'include/uv-bsd.h',
|
131
|
+
'include/uv-aix.h',
|
132
|
+
'src/unix/async.c',
|
133
|
+
'src/unix/atomic-ops.h',
|
134
|
+
'src/unix/core.c',
|
135
|
+
'src/unix/dl.c',
|
136
|
+
'src/unix/fs.c',
|
137
|
+
'src/unix/getaddrinfo.c',
|
138
|
+
'src/unix/getnameinfo.c',
|
139
|
+
'src/unix/internal.h',
|
140
|
+
'src/unix/loop.c',
|
141
|
+
'src/unix/loop-watcher.c',
|
142
|
+
'src/unix/pipe.c',
|
143
|
+
'src/unix/poll.c',
|
144
|
+
'src/unix/process.c',
|
145
|
+
'src/unix/signal.c',
|
146
|
+
'src/unix/spinlock.h',
|
147
|
+
'src/unix/stream.c',
|
148
|
+
'src/unix/tcp.c',
|
149
|
+
'src/unix/thread.c',
|
150
|
+
'src/unix/timer.c',
|
151
|
+
'src/unix/tty.c',
|
152
|
+
'src/unix/udp.c',
|
153
|
+
],
|
154
|
+
'link_settings': {
|
155
|
+
'libraries': [ '-lm' ],
|
156
|
+
'conditions': [
|
157
|
+
['OS=="solaris"', {
|
158
|
+
'ldflags': [ '-pthreads' ],
|
159
|
+
}],
|
160
|
+
['OS != "solaris" and OS != "android"', {
|
161
|
+
'ldflags': [ '-pthread' ],
|
162
|
+
}],
|
163
|
+
],
|
164
|
+
},
|
165
|
+
'conditions': [
|
166
|
+
['uv_library=="shared_library"', {
|
167
|
+
'cflags': [ '-fPIC' ],
|
168
|
+
}],
|
169
|
+
['uv_library=="shared_library" and OS!="mac"', {
|
170
|
+
# This will cause gyp to set soname
|
171
|
+
# Must correspond with UV_VERSION_MAJOR
|
172
|
+
# in include/uv-version.h
|
173
|
+
'product_extension': 'so.1',
|
174
|
+
}],
|
175
|
+
],
|
176
|
+
}],
|
177
|
+
[ 'OS in "linux mac ios android"', {
|
178
|
+
'sources': [ 'src/unix/proctitle.c' ],
|
179
|
+
}],
|
180
|
+
[ 'OS in "mac ios"', {
|
181
|
+
'sources': [
|
182
|
+
'src/unix/darwin.c',
|
183
|
+
'src/unix/fsevents.c',
|
184
|
+
'src/unix/darwin-proctitle.c',
|
185
|
+
],
|
186
|
+
'defines': [
|
187
|
+
'_DARWIN_USE_64_BIT_INODE=1',
|
188
|
+
'_DARWIN_UNLIMITED_SELECT=1',
|
189
|
+
]
|
190
|
+
}],
|
191
|
+
[ 'OS!="mac"', {
|
192
|
+
# Enable on all platforms except OS X. The antique gcc/clang that
|
193
|
+
# ships with Xcode emits waaaay too many false positives.
|
194
|
+
'cflags': [ '-Wstrict-aliasing' ],
|
195
|
+
}],
|
196
|
+
[ 'OS=="linux"', {
|
197
|
+
'defines': [ '_GNU_SOURCE' ],
|
198
|
+
'sources': [
|
199
|
+
'src/unix/linux-core.c',
|
200
|
+
'src/unix/linux-inotify.c',
|
201
|
+
'src/unix/linux-syscalls.c',
|
202
|
+
'src/unix/linux-syscalls.h',
|
203
|
+
],
|
204
|
+
'link_settings': {
|
205
|
+
'libraries': [ '-ldl', '-lrt' ],
|
206
|
+
},
|
207
|
+
}],
|
208
|
+
[ 'OS=="android"', {
|
209
|
+
'sources': [
|
210
|
+
'src/unix/linux-core.c',
|
211
|
+
'src/unix/linux-inotify.c',
|
212
|
+
'src/unix/linux-syscalls.c',
|
213
|
+
'src/unix/linux-syscalls.h',
|
214
|
+
'src/unix/pthread-fixes.c',
|
215
|
+
'src/unix/android-ifaddrs.c'
|
216
|
+
],
|
217
|
+
'link_settings': {
|
218
|
+
'libraries': [ '-ldl' ],
|
219
|
+
},
|
220
|
+
}],
|
221
|
+
[ 'OS=="solaris"', {
|
222
|
+
'sources': [ 'src/unix/sunos.c' ],
|
223
|
+
'defines': [
|
224
|
+
'__EXTENSIONS__',
|
225
|
+
'_XOPEN_SOURCE=500',
|
226
|
+
],
|
227
|
+
'link_settings': {
|
228
|
+
'libraries': [
|
229
|
+
'-lkstat',
|
230
|
+
'-lnsl',
|
231
|
+
'-lsendfile',
|
232
|
+
'-lsocket',
|
233
|
+
],
|
234
|
+
},
|
235
|
+
}],
|
236
|
+
[ 'OS=="aix"', {
|
237
|
+
'sources': [ 'src/unix/aix.c' ],
|
238
|
+
'defines': [
|
239
|
+
'_ALL_SOURCE',
|
240
|
+
'_XOPEN_SOURCE=500',
|
241
|
+
'_LINUX_SOURCE_COMPAT',
|
242
|
+
],
|
243
|
+
'link_settings': {
|
244
|
+
'libraries': [
|
245
|
+
'-lperfstat',
|
246
|
+
],
|
247
|
+
},
|
248
|
+
}],
|
249
|
+
[ 'OS=="freebsd" or OS=="dragonflybsd"', {
|
250
|
+
'sources': [ 'src/unix/freebsd.c' ],
|
251
|
+
}],
|
252
|
+
[ 'OS=="openbsd"', {
|
253
|
+
'sources': [ 'src/unix/openbsd.c' ],
|
254
|
+
}],
|
255
|
+
[ 'OS=="netbsd"', {
|
256
|
+
'sources': [ 'src/unix/netbsd.c' ],
|
257
|
+
}],
|
258
|
+
[ 'OS in "freebsd dragonflybsd openbsd netbsd".split()', {
|
259
|
+
'link_settings': {
|
260
|
+
'libraries': [ '-lkvm' ],
|
261
|
+
},
|
262
|
+
}],
|
263
|
+
[ 'OS in "ios mac freebsd dragonflybsd openbsd netbsd".split()', {
|
264
|
+
'sources': [ 'src/unix/kqueue.c' ],
|
265
|
+
}],
|
266
|
+
['uv_library=="shared_library"', {
|
267
|
+
'defines': [ 'BUILDING_UV_SHARED=1' ]
|
268
|
+
}],
|
269
|
+
]
|
270
|
+
},
|
271
|
+
|
272
|
+
{
|
273
|
+
'target_name': 'run-tests',
|
274
|
+
'type': 'executable',
|
275
|
+
'dependencies': [ 'libuv' ],
|
276
|
+
'sources': [
|
277
|
+
'test/blackhole-server.c',
|
278
|
+
'test/echo-server.c',
|
279
|
+
'test/run-tests.c',
|
280
|
+
'test/runner.c',
|
281
|
+
'test/runner.h',
|
282
|
+
'test/test-get-loadavg.c',
|
283
|
+
'test/task.h',
|
284
|
+
'test/test-active.c',
|
285
|
+
'test/test-async.c',
|
286
|
+
'test/test-async-null-cb.c',
|
287
|
+
'test/test-callback-stack.c',
|
288
|
+
'test/test-callback-order.c',
|
289
|
+
'test/test-close-fd.c',
|
290
|
+
'test/test-close-order.c',
|
291
|
+
'test/test-connection-fail.c',
|
292
|
+
'test/test-cwd-and-chdir.c',
|
293
|
+
'test/test-default-loop-close.c',
|
294
|
+
'test/test-delayed-accept.c',
|
295
|
+
'test/test-error.c',
|
296
|
+
'test/test-embed.c',
|
297
|
+
'test/test-emfile.c',
|
298
|
+
'test/test-fail-always.c',
|
299
|
+
'test/test-fs.c',
|
300
|
+
'test/test-fs-event.c',
|
301
|
+
'test/test-get-currentexe.c',
|
302
|
+
'test/test-get-memory.c',
|
303
|
+
'test/test-getaddrinfo.c',
|
304
|
+
'test/test-getnameinfo.c',
|
305
|
+
'test/test-getsockname.c',
|
306
|
+
'test/test-handle-fileno.c',
|
307
|
+
'test/test-hrtime.c',
|
308
|
+
'test/test-idle.c',
|
309
|
+
'test/test-ip6-addr.c',
|
310
|
+
'test/test-ipc.c',
|
311
|
+
'test/test-ipc-send-recv.c',
|
312
|
+
'test/test-list.h',
|
313
|
+
'test/test-loop-handles.c',
|
314
|
+
'test/test-loop-alive.c',
|
315
|
+
'test/test-loop-close.c',
|
316
|
+
'test/test-loop-stop.c',
|
317
|
+
'test/test-loop-time.c',
|
318
|
+
'test/test-loop-configure.c',
|
319
|
+
'test/test-walk-handles.c',
|
320
|
+
'test/test-watcher-cross-stop.c',
|
321
|
+
'test/test-multiple-listen.c',
|
322
|
+
'test/test-osx-select.c',
|
323
|
+
'test/test-pass-always.c',
|
324
|
+
'test/test-ping-pong.c',
|
325
|
+
'test/test-pipe-bind-error.c',
|
326
|
+
'test/test-pipe-connect-error.c',
|
327
|
+
'test/test-pipe-getsockname.c',
|
328
|
+
'test/test-pipe-sendmsg.c',
|
329
|
+
'test/test-pipe-server-close.c',
|
330
|
+
'test/test-pipe-close-stdout-read-stdin.c',
|
331
|
+
'test/test-pipe-set-non-blocking.c',
|
332
|
+
'test/test-platform-output.c',
|
333
|
+
'test/test-poll.c',
|
334
|
+
'test/test-poll-close.c',
|
335
|
+
'test/test-poll-close-doesnt-corrupt-stack.c',
|
336
|
+
'test/test-poll-closesocket.c',
|
337
|
+
'test/test-process-title.c',
|
338
|
+
'test/test-ref.c',
|
339
|
+
'test/test-run-nowait.c',
|
340
|
+
'test/test-run-once.c',
|
341
|
+
'test/test-semaphore.c',
|
342
|
+
'test/test-shutdown-close.c',
|
343
|
+
'test/test-shutdown-eof.c',
|
344
|
+
'test/test-shutdown-twice.c',
|
345
|
+
'test/test-signal.c',
|
346
|
+
'test/test-signal-multiple-loops.c',
|
347
|
+
'test/test-socket-buffer-size.c',
|
348
|
+
'test/test-spawn.c',
|
349
|
+
'test/test-fs-poll.c',
|
350
|
+
'test/test-stdio-over-pipes.c',
|
351
|
+
'test/test-tcp-bind-error.c',
|
352
|
+
'test/test-tcp-bind6-error.c',
|
353
|
+
'test/test-tcp-close.c',
|
354
|
+
'test/test-tcp-close-accept.c',
|
355
|
+
'test/test-tcp-close-while-connecting.c',
|
356
|
+
'test/test-tcp-connect-error-after-write.c',
|
357
|
+
'test/test-tcp-shutdown-after-write.c',
|
358
|
+
'test/test-tcp-flags.c',
|
359
|
+
'test/test-tcp-connect-error.c',
|
360
|
+
'test/test-tcp-connect-timeout.c',
|
361
|
+
'test/test-tcp-connect6-error.c',
|
362
|
+
'test/test-tcp-open.c',
|
363
|
+
'test/test-tcp-write-to-half-open-connection.c',
|
364
|
+
'test/test-tcp-write-after-connect.c',
|
365
|
+
'test/test-tcp-writealot.c',
|
366
|
+
'test/test-tcp-write-fail.c',
|
367
|
+
'test/test-tcp-try-write.c',
|
368
|
+
'test/test-tcp-unexpected-read.c',
|
369
|
+
'test/test-tcp-oob.c',
|
370
|
+
'test/test-tcp-read-stop.c',
|
371
|
+
'test/test-tcp-write-queue-order.c',
|
372
|
+
'test/test-threadpool.c',
|
373
|
+
'test/test-threadpool-cancel.c',
|
374
|
+
'test/test-thread-equal.c',
|
375
|
+
'test/test-mutexes.c',
|
376
|
+
'test/test-thread.c',
|
377
|
+
'test/test-barrier.c',
|
378
|
+
'test/test-condvar.c',
|
379
|
+
'test/test-timer-again.c',
|
380
|
+
'test/test-timer-from-check.c',
|
381
|
+
'test/test-timer.c',
|
382
|
+
'test/test-tty.c',
|
383
|
+
'test/test-udp-bind.c',
|
384
|
+
'test/test-udp-dgram-too-big.c',
|
385
|
+
'test/test-udp-ipv6.c',
|
386
|
+
'test/test-udp-open.c',
|
387
|
+
'test/test-udp-options.c',
|
388
|
+
'test/test-udp-send-and-recv.c',
|
389
|
+
'test/test-udp-send-immediate.c',
|
390
|
+
'test/test-udp-send-unreachable.c',
|
391
|
+
'test/test-udp-multicast-join.c',
|
392
|
+
'test/test-udp-multicast-join6.c',
|
393
|
+
'test/test-dlerror.c',
|
394
|
+
'test/test-udp-multicast-ttl.c',
|
395
|
+
'test/test-ip4-addr.c',
|
396
|
+
'test/test-ip6-addr.c',
|
397
|
+
'test/test-udp-multicast-interface.c',
|
398
|
+
'test/test-udp-multicast-interface6.c',
|
399
|
+
'test/test-udp-try-send.c',
|
400
|
+
],
|
401
|
+
'conditions': [
|
402
|
+
[ 'OS=="win"', {
|
403
|
+
'sources': [
|
404
|
+
'test/runner-win.c',
|
405
|
+
'test/runner-win.h'
|
406
|
+
],
|
407
|
+
'libraries': [ '-lws2_32' ]
|
408
|
+
}, { # POSIX
|
409
|
+
'defines': [ '_GNU_SOURCE' ],
|
410
|
+
'sources': [
|
411
|
+
'test/runner-unix.c',
|
412
|
+
'test/runner-unix.h',
|
413
|
+
],
|
414
|
+
}],
|
415
|
+
[ 'OS=="solaris"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
|
416
|
+
'defines': [
|
417
|
+
'__EXTENSIONS__',
|
418
|
+
'_XOPEN_SOURCE=500',
|
419
|
+
],
|
420
|
+
}],
|
421
|
+
[ 'OS=="aix"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
|
422
|
+
'defines': [
|
423
|
+
'_ALL_SOURCE',
|
424
|
+
'_XOPEN_SOURCE=500',
|
425
|
+
],
|
426
|
+
}],
|
427
|
+
],
|
428
|
+
'msvs-settings': {
|
429
|
+
'VCLinkerTool': {
|
430
|
+
'SubSystem': 1, # /subsystem:console
|
431
|
+
},
|
432
|
+
},
|
433
|
+
},
|
434
|
+
|
435
|
+
{
|
436
|
+
'target_name': 'run-benchmarks',
|
437
|
+
'type': 'executable',
|
438
|
+
'dependencies': [ 'libuv' ],
|
439
|
+
'sources': [
|
440
|
+
'test/benchmark-async.c',
|
441
|
+
'test/benchmark-async-pummel.c',
|
442
|
+
'test/benchmark-fs-stat.c',
|
443
|
+
'test/benchmark-getaddrinfo.c',
|
444
|
+
'test/benchmark-list.h',
|
445
|
+
'test/benchmark-loop-count.c',
|
446
|
+
'test/benchmark-million-async.c',
|
447
|
+
'test/benchmark-million-timers.c',
|
448
|
+
'test/benchmark-multi-accept.c',
|
449
|
+
'test/benchmark-ping-pongs.c',
|
450
|
+
'test/benchmark-pound.c',
|
451
|
+
'test/benchmark-pump.c',
|
452
|
+
'test/benchmark-sizes.c',
|
453
|
+
'test/benchmark-spawn.c',
|
454
|
+
'test/benchmark-thread.c',
|
455
|
+
'test/benchmark-tcp-write-batch.c',
|
456
|
+
'test/benchmark-udp-pummel.c',
|
457
|
+
'test/dns-server.c',
|
458
|
+
'test/echo-server.c',
|
459
|
+
'test/blackhole-server.c',
|
460
|
+
'test/run-benchmarks.c',
|
461
|
+
'test/runner.c',
|
462
|
+
'test/runner.h',
|
463
|
+
'test/task.h',
|
464
|
+
],
|
465
|
+
'conditions': [
|
466
|
+
[ 'OS=="win"', {
|
467
|
+
'sources': [
|
468
|
+
'test/runner-win.c',
|
469
|
+
'test/runner-win.h',
|
470
|
+
],
|
471
|
+
'libraries': [ '-lws2_32' ]
|
472
|
+
}, { # POSIX
|
473
|
+
'defines': [ '_GNU_SOURCE' ],
|
474
|
+
'sources': [
|
475
|
+
'test/runner-unix.c',
|
476
|
+
'test/runner-unix.h',
|
477
|
+
]
|
478
|
+
}]
|
479
|
+
],
|
480
|
+
'msvs-settings': {
|
481
|
+
'VCLinkerTool': {
|
482
|
+
'SubSystem': 1, # /subsystem:console
|
483
|
+
},
|
484
|
+
},
|
485
|
+
},
|
486
|
+
]
|
487
|
+
}
|