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,34 @@
|
|
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
|
+
#ifndef UV_LINUX_H
|
23
|
+
#define UV_LINUX_H
|
24
|
+
|
25
|
+
#define UV_PLATFORM_LOOP_FIELDS \
|
26
|
+
uv__io_t inotify_read_watcher; \
|
27
|
+
void* inotify_watchers; \
|
28
|
+
int inotify_fd; \
|
29
|
+
|
30
|
+
#define UV_PLATFORM_FS_EVENT_FIELDS \
|
31
|
+
void* watchers[2]; \
|
32
|
+
int wd; \
|
33
|
+
|
34
|
+
#endif /* UV_LINUX_H */
|
@@ -0,0 +1,44 @@
|
|
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
|
+
#ifndef UV_SUNOS_H
|
23
|
+
#define UV_SUNOS_H
|
24
|
+
|
25
|
+
#include <sys/port.h>
|
26
|
+
#include <port.h>
|
27
|
+
|
28
|
+
/* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c,
|
29
|
+
* add the fs_event fields even when this version of SunOS doesn't support
|
30
|
+
* file watching.
|
31
|
+
*/
|
32
|
+
#define UV_PLATFORM_LOOP_FIELDS \
|
33
|
+
uv__io_t fs_event_watcher; \
|
34
|
+
int fs_fd; \
|
35
|
+
|
36
|
+
#if defined(PORT_SOURCE_FILE)
|
37
|
+
|
38
|
+
# define UV_PLATFORM_FS_EVENT_FIELDS \
|
39
|
+
file_obj_t fo; \
|
40
|
+
int fd; \
|
41
|
+
|
42
|
+
#endif /* defined(PORT_SOURCE_FILE) */
|
43
|
+
|
44
|
+
#endif /* UV_SUNOS_H */
|
@@ -0,0 +1,37 @@
|
|
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_THREADPOOL_H_
|
28
|
+
#define UV_THREADPOOL_H_
|
29
|
+
|
30
|
+
struct uv__work {
|
31
|
+
void (*work)(struct uv__work *w);
|
32
|
+
void (*done)(struct uv__work *w, int status);
|
33
|
+
struct uv_loop_s* loop;
|
34
|
+
void* wq[2];
|
35
|
+
};
|
36
|
+
|
37
|
+
#endif /* UV_THREADPOOL_H_ */
|
@@ -0,0 +1,383 @@
|
|
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
|
+
#ifndef UV_UNIX_H
|
23
|
+
#define UV_UNIX_H
|
24
|
+
|
25
|
+
#include <sys/types.h>
|
26
|
+
#include <sys/stat.h>
|
27
|
+
#include <fcntl.h>
|
28
|
+
#include <dirent.h>
|
29
|
+
|
30
|
+
#include <sys/socket.h>
|
31
|
+
#include <netinet/in.h>
|
32
|
+
#include <netinet/tcp.h>
|
33
|
+
#include <arpa/inet.h>
|
34
|
+
#include <netdb.h>
|
35
|
+
|
36
|
+
#include <termios.h>
|
37
|
+
#include <pwd.h>
|
38
|
+
|
39
|
+
#include <semaphore.h>
|
40
|
+
#include <pthread.h>
|
41
|
+
#ifdef __ANDROID__
|
42
|
+
#include "pthread-fixes.h"
|
43
|
+
#endif
|
44
|
+
#include <signal.h>
|
45
|
+
|
46
|
+
#include "uv-threadpool.h"
|
47
|
+
|
48
|
+
#if defined(__linux__)
|
49
|
+
# include "uv-linux.h"
|
50
|
+
#elif defined(_AIX)
|
51
|
+
# include "uv-aix.h"
|
52
|
+
#elif defined(__sun)
|
53
|
+
# include "uv-sunos.h"
|
54
|
+
#elif defined(__APPLE__)
|
55
|
+
# include "uv-darwin.h"
|
56
|
+
#elif defined(__DragonFly__) || \
|
57
|
+
defined(__FreeBSD__) || \
|
58
|
+
defined(__OpenBSD__) || \
|
59
|
+
defined(__NetBSD__)
|
60
|
+
# include "uv-bsd.h"
|
61
|
+
#endif
|
62
|
+
|
63
|
+
#ifndef NI_MAXHOST
|
64
|
+
# define NI_MAXHOST 1025
|
65
|
+
#endif
|
66
|
+
|
67
|
+
#ifndef NI_MAXSERV
|
68
|
+
# define NI_MAXSERV 32
|
69
|
+
#endif
|
70
|
+
|
71
|
+
#ifndef UV_IO_PRIVATE_PLATFORM_FIELDS
|
72
|
+
# define UV_IO_PRIVATE_PLATFORM_FIELDS /* empty */
|
73
|
+
#endif
|
74
|
+
|
75
|
+
struct uv__io_s;
|
76
|
+
struct uv__async;
|
77
|
+
struct uv_loop_s;
|
78
|
+
|
79
|
+
typedef void (*uv__io_cb)(struct uv_loop_s* loop,
|
80
|
+
struct uv__io_s* w,
|
81
|
+
unsigned int events);
|
82
|
+
typedef struct uv__io_s uv__io_t;
|
83
|
+
|
84
|
+
struct uv__io_s {
|
85
|
+
uv__io_cb cb;
|
86
|
+
void* pending_queue[2];
|
87
|
+
void* watcher_queue[2];
|
88
|
+
unsigned int pevents; /* Pending event mask i.e. mask at next tick. */
|
89
|
+
unsigned int events; /* Current event mask. */
|
90
|
+
int fd;
|
91
|
+
UV_IO_PRIVATE_PLATFORM_FIELDS
|
92
|
+
};
|
93
|
+
|
94
|
+
typedef void (*uv__async_cb)(struct uv_loop_s* loop,
|
95
|
+
struct uv__async* w,
|
96
|
+
unsigned int nevents);
|
97
|
+
|
98
|
+
struct uv__async {
|
99
|
+
uv__async_cb cb;
|
100
|
+
uv__io_t io_watcher;
|
101
|
+
int wfd;
|
102
|
+
};
|
103
|
+
|
104
|
+
#ifndef UV_PLATFORM_SEM_T
|
105
|
+
# define UV_PLATFORM_SEM_T sem_t
|
106
|
+
#endif
|
107
|
+
|
108
|
+
#ifndef UV_PLATFORM_LOOP_FIELDS
|
109
|
+
# define UV_PLATFORM_LOOP_FIELDS /* empty */
|
110
|
+
#endif
|
111
|
+
|
112
|
+
#ifndef UV_PLATFORM_FS_EVENT_FIELDS
|
113
|
+
# define UV_PLATFORM_FS_EVENT_FIELDS /* empty */
|
114
|
+
#endif
|
115
|
+
|
116
|
+
#ifndef UV_STREAM_PRIVATE_PLATFORM_FIELDS
|
117
|
+
# define UV_STREAM_PRIVATE_PLATFORM_FIELDS /* empty */
|
118
|
+
#endif
|
119
|
+
|
120
|
+
/* Note: May be cast to struct iovec. See writev(2). */
|
121
|
+
typedef struct uv_buf_t {
|
122
|
+
char* base;
|
123
|
+
size_t len;
|
124
|
+
} uv_buf_t;
|
125
|
+
|
126
|
+
typedef int uv_file;
|
127
|
+
typedef int uv_os_sock_t;
|
128
|
+
typedef int uv_os_fd_t;
|
129
|
+
|
130
|
+
#define UV_ONCE_INIT PTHREAD_ONCE_INIT
|
131
|
+
|
132
|
+
typedef pthread_once_t uv_once_t;
|
133
|
+
typedef pthread_t uv_thread_t;
|
134
|
+
typedef pthread_mutex_t uv_mutex_t;
|
135
|
+
typedef pthread_rwlock_t uv_rwlock_t;
|
136
|
+
typedef UV_PLATFORM_SEM_T uv_sem_t;
|
137
|
+
typedef pthread_cond_t uv_cond_t;
|
138
|
+
typedef pthread_key_t uv_key_t;
|
139
|
+
|
140
|
+
#if defined(__APPLE__) && defined(__MACH__)
|
141
|
+
|
142
|
+
typedef struct {
|
143
|
+
unsigned int n;
|
144
|
+
unsigned int count;
|
145
|
+
uv_mutex_t mutex;
|
146
|
+
uv_sem_t turnstile1;
|
147
|
+
uv_sem_t turnstile2;
|
148
|
+
} uv_barrier_t;
|
149
|
+
|
150
|
+
#else /* defined(__APPLE__) && defined(__MACH__) */
|
151
|
+
|
152
|
+
typedef pthread_barrier_t uv_barrier_t;
|
153
|
+
|
154
|
+
#endif /* defined(__APPLE__) && defined(__MACH__) */
|
155
|
+
|
156
|
+
/* Platform-specific definitions for uv_spawn support. */
|
157
|
+
typedef gid_t uv_gid_t;
|
158
|
+
typedef uid_t uv_uid_t;
|
159
|
+
|
160
|
+
typedef struct dirent uv__dirent_t;
|
161
|
+
|
162
|
+
#if defined(DT_UNKNOWN)
|
163
|
+
# define HAVE_DIRENT_TYPES
|
164
|
+
# if defined(DT_REG)
|
165
|
+
# define UV__DT_FILE DT_REG
|
166
|
+
# else
|
167
|
+
# define UV__DT_FILE -1
|
168
|
+
# endif
|
169
|
+
# if defined(DT_DIR)
|
170
|
+
# define UV__DT_DIR DT_DIR
|
171
|
+
# else
|
172
|
+
# define UV__DT_DIR -2
|
173
|
+
# endif
|
174
|
+
# if defined(DT_LNK)
|
175
|
+
# define UV__DT_LINK DT_LNK
|
176
|
+
# else
|
177
|
+
# define UV__DT_LINK -3
|
178
|
+
# endif
|
179
|
+
# if defined(DT_FIFO)
|
180
|
+
# define UV__DT_FIFO DT_FIFO
|
181
|
+
# else
|
182
|
+
# define UV__DT_FIFO -4
|
183
|
+
# endif
|
184
|
+
# if defined(DT_SOCK)
|
185
|
+
# define UV__DT_SOCKET DT_SOCK
|
186
|
+
# else
|
187
|
+
# define UV__DT_SOCKET -5
|
188
|
+
# endif
|
189
|
+
# if defined(DT_CHR)
|
190
|
+
# define UV__DT_CHAR DT_CHR
|
191
|
+
# else
|
192
|
+
# define UV__DT_CHAR -6
|
193
|
+
# endif
|
194
|
+
# if defined(DT_BLK)
|
195
|
+
# define UV__DT_BLOCK DT_BLK
|
196
|
+
# else
|
197
|
+
# define UV__DT_BLOCK -7
|
198
|
+
# endif
|
199
|
+
#endif
|
200
|
+
|
201
|
+
/* Platform-specific definitions for uv_dlopen support. */
|
202
|
+
#define UV_DYNAMIC /* empty */
|
203
|
+
|
204
|
+
typedef struct {
|
205
|
+
void* handle;
|
206
|
+
char* errmsg;
|
207
|
+
} uv_lib_t;
|
208
|
+
|
209
|
+
#define UV_LOOP_PRIVATE_FIELDS \
|
210
|
+
unsigned long flags; \
|
211
|
+
int backend_fd; \
|
212
|
+
void* pending_queue[2]; \
|
213
|
+
void* watcher_queue[2]; \
|
214
|
+
uv__io_t** watchers; \
|
215
|
+
unsigned int nwatchers; \
|
216
|
+
unsigned int nfds; \
|
217
|
+
void* wq[2]; \
|
218
|
+
uv_mutex_t wq_mutex; \
|
219
|
+
uv_async_t wq_async; \
|
220
|
+
uv_rwlock_t cloexec_lock; \
|
221
|
+
uv_handle_t* closing_handles; \
|
222
|
+
void* process_handles[2]; \
|
223
|
+
void* prepare_handles[2]; \
|
224
|
+
void* check_handles[2]; \
|
225
|
+
void* idle_handles[2]; \
|
226
|
+
void* async_handles[2]; \
|
227
|
+
struct uv__async async_watcher; \
|
228
|
+
struct { \
|
229
|
+
void* min; \
|
230
|
+
unsigned int nelts; \
|
231
|
+
} timer_heap; \
|
232
|
+
uint64_t timer_counter; \
|
233
|
+
uint64_t time; \
|
234
|
+
int signal_pipefd[2]; \
|
235
|
+
uv__io_t signal_io_watcher; \
|
236
|
+
uv_signal_t child_watcher; \
|
237
|
+
int emfile_fd; \
|
238
|
+
UV_PLATFORM_LOOP_FIELDS \
|
239
|
+
|
240
|
+
#define UV_REQ_TYPE_PRIVATE /* empty */
|
241
|
+
|
242
|
+
#define UV_REQ_PRIVATE_FIELDS /* empty */
|
243
|
+
|
244
|
+
#define UV_PRIVATE_REQ_TYPES /* empty */
|
245
|
+
|
246
|
+
#define UV_WRITE_PRIVATE_FIELDS \
|
247
|
+
void* queue[2]; \
|
248
|
+
unsigned int write_index; \
|
249
|
+
uv_buf_t* bufs; \
|
250
|
+
unsigned int nbufs; \
|
251
|
+
int error; \
|
252
|
+
uv_buf_t bufsml[4]; \
|
253
|
+
|
254
|
+
#define UV_CONNECT_PRIVATE_FIELDS \
|
255
|
+
void* queue[2]; \
|
256
|
+
|
257
|
+
#define UV_SHUTDOWN_PRIVATE_FIELDS /* empty */
|
258
|
+
|
259
|
+
#define UV_UDP_SEND_PRIVATE_FIELDS \
|
260
|
+
void* queue[2]; \
|
261
|
+
struct sockaddr_storage addr; \
|
262
|
+
unsigned int nbufs; \
|
263
|
+
uv_buf_t* bufs; \
|
264
|
+
ssize_t status; \
|
265
|
+
uv_udp_send_cb send_cb; \
|
266
|
+
uv_buf_t bufsml[4]; \
|
267
|
+
|
268
|
+
#define UV_HANDLE_PRIVATE_FIELDS \
|
269
|
+
uv_handle_t* next_closing; \
|
270
|
+
unsigned int flags; \
|
271
|
+
|
272
|
+
#define UV_STREAM_PRIVATE_FIELDS \
|
273
|
+
uv_connect_t *connect_req; \
|
274
|
+
uv_shutdown_t *shutdown_req; \
|
275
|
+
uv__io_t io_watcher; \
|
276
|
+
void* write_queue[2]; \
|
277
|
+
void* write_completed_queue[2]; \
|
278
|
+
uv_connection_cb connection_cb; \
|
279
|
+
int delayed_error; \
|
280
|
+
int accepted_fd; \
|
281
|
+
void* queued_fds; \
|
282
|
+
UV_STREAM_PRIVATE_PLATFORM_FIELDS \
|
283
|
+
|
284
|
+
#define UV_TCP_PRIVATE_FIELDS /* empty */
|
285
|
+
|
286
|
+
#define UV_UDP_PRIVATE_FIELDS \
|
287
|
+
uv_alloc_cb alloc_cb; \
|
288
|
+
uv_udp_recv_cb recv_cb; \
|
289
|
+
uv__io_t io_watcher; \
|
290
|
+
void* write_queue[2]; \
|
291
|
+
void* write_completed_queue[2]; \
|
292
|
+
|
293
|
+
#define UV_PIPE_PRIVATE_FIELDS \
|
294
|
+
const char* pipe_fname; /* strdup'ed */
|
295
|
+
|
296
|
+
#define UV_POLL_PRIVATE_FIELDS \
|
297
|
+
uv__io_t io_watcher;
|
298
|
+
|
299
|
+
#define UV_PREPARE_PRIVATE_FIELDS \
|
300
|
+
uv_prepare_cb prepare_cb; \
|
301
|
+
void* queue[2]; \
|
302
|
+
|
303
|
+
#define UV_CHECK_PRIVATE_FIELDS \
|
304
|
+
uv_check_cb check_cb; \
|
305
|
+
void* queue[2]; \
|
306
|
+
|
307
|
+
#define UV_IDLE_PRIVATE_FIELDS \
|
308
|
+
uv_idle_cb idle_cb; \
|
309
|
+
void* queue[2]; \
|
310
|
+
|
311
|
+
#define UV_ASYNC_PRIVATE_FIELDS \
|
312
|
+
uv_async_cb async_cb; \
|
313
|
+
void* queue[2]; \
|
314
|
+
int pending; \
|
315
|
+
|
316
|
+
#define UV_TIMER_PRIVATE_FIELDS \
|
317
|
+
uv_timer_cb timer_cb; \
|
318
|
+
void* heap_node[3]; \
|
319
|
+
uint64_t timeout; \
|
320
|
+
uint64_t repeat; \
|
321
|
+
uint64_t start_id;
|
322
|
+
|
323
|
+
#define UV_GETADDRINFO_PRIVATE_FIELDS \
|
324
|
+
struct uv__work work_req; \
|
325
|
+
uv_getaddrinfo_cb cb; \
|
326
|
+
struct addrinfo* hints; \
|
327
|
+
char* hostname; \
|
328
|
+
char* service; \
|
329
|
+
struct addrinfo* addrinfo; \
|
330
|
+
int retcode;
|
331
|
+
|
332
|
+
#define UV_GETNAMEINFO_PRIVATE_FIELDS \
|
333
|
+
struct uv__work work_req; \
|
334
|
+
uv_getnameinfo_cb getnameinfo_cb; \
|
335
|
+
struct sockaddr_storage storage; \
|
336
|
+
int flags; \
|
337
|
+
char host[NI_MAXHOST]; \
|
338
|
+
char service[NI_MAXSERV]; \
|
339
|
+
int retcode;
|
340
|
+
|
341
|
+
#define UV_PROCESS_PRIVATE_FIELDS \
|
342
|
+
void* queue[2]; \
|
343
|
+
int status; \
|
344
|
+
|
345
|
+
#define UV_FS_PRIVATE_FIELDS \
|
346
|
+
const char *new_path; \
|
347
|
+
uv_file file; \
|
348
|
+
int flags; \
|
349
|
+
mode_t mode; \
|
350
|
+
unsigned int nbufs; \
|
351
|
+
uv_buf_t* bufs; \
|
352
|
+
off_t off; \
|
353
|
+
uv_uid_t uid; \
|
354
|
+
uv_gid_t gid; \
|
355
|
+
double atime; \
|
356
|
+
double mtime; \
|
357
|
+
struct uv__work work_req; \
|
358
|
+
uv_buf_t bufsml[4]; \
|
359
|
+
|
360
|
+
#define UV_WORK_PRIVATE_FIELDS \
|
361
|
+
struct uv__work work_req;
|
362
|
+
|
363
|
+
#define UV_TTY_PRIVATE_FIELDS \
|
364
|
+
struct termios orig_termios; \
|
365
|
+
int mode;
|
366
|
+
|
367
|
+
#define UV_SIGNAL_PRIVATE_FIELDS \
|
368
|
+
/* RB_ENTRY(uv_signal_s) tree_entry; */ \
|
369
|
+
struct { \
|
370
|
+
struct uv_signal_s* rbe_left; \
|
371
|
+
struct uv_signal_s* rbe_right; \
|
372
|
+
struct uv_signal_s* rbe_parent; \
|
373
|
+
int rbe_color; \
|
374
|
+
} tree_entry; \
|
375
|
+
/* Use two counters here so we don have to fiddle with atomics. */ \
|
376
|
+
unsigned int caught_signals; \
|
377
|
+
unsigned int dispatched_signals;
|
378
|
+
|
379
|
+
#define UV_FS_EVENT_PRIVATE_FIELDS \
|
380
|
+
uv_fs_event_cb cb; \
|
381
|
+
UV_PLATFORM_FS_EVENT_FIELDS \
|
382
|
+
|
383
|
+
#endif /* UV_UNIX_H */
|