passenger 5.0.15 → 5.0.16
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/CHANGELOG +13 -0
- data/bin/passenger-install-apache2-module +8 -0
- data/build/agents.rb +8 -9
- data/build/cxx_tests.rb +1 -1
- data/build/misc.rb +2 -2
- data/doc/Users guide Apache.html +1 -1
- data/doc/Users guide Apache.txt +1 -1
- data/doc/Users guide Nginx.html +1 -1
- data/doc/Users guide Nginx.txt +1 -1
- data/doc/Users guide.html +1 -1
- data/doc/Users guide.txt +1 -1
- data/ext/common/ApplicationPool2/Group/InitializationAndShutdown.cpp +3 -3
- data/ext/common/ApplicationPool2/Group/LifetimeAndBasics.cpp +1 -1
- data/ext/common/ApplicationPool2/Options.h +1 -1
- data/ext/common/Constants.h +1 -1
- data/ext/common/MemoryKit/mbuf.cpp +9 -124
- data/ext/common/MemoryKit/mbuf.h +3 -13
- data/ext/common/UnionStation/{ScopeLog.h → StopwatchLog.h} +8 -8
- data/ext/common/agent/{Main.cpp → AgentMain.cpp} +0 -0
- data/ext/common/agent/Core/{Main.cpp → CoreMain.cpp} +1 -1
- data/ext/common/agent/Core/RequestHandler/BufferBody.cpp +2 -2
- data/ext/common/agent/Core/RequestHandler/CheckoutSession.cpp +4 -4
- data/ext/common/agent/Core/RequestHandler/ForwardResponse.cpp +16 -3
- data/ext/common/agent/Core/RequestHandler/Hooks.cpp +4 -4
- data/ext/common/agent/Core/RequestHandler/InitRequest.cpp +1 -1
- data/ext/common/agent/Core/RequestHandler/Request.h +14 -14
- data/ext/common/agent/Core/RequestHandler/SendRequest.cpp +2 -1
- data/ext/common/agent/SpawnPreparer/{Main.cpp → SpawnPreparerMain.cpp} +0 -0
- data/ext/common/agent/SystemMetrics/{Main.cpp → SystemMetricsMain.cpp} +0 -0
- data/ext/common/agent/TempDirToucher/{Main.cpp → TempDirToucherMain.cpp} +0 -0
- data/ext/common/agent/UstRouter/{Main.cpp → UstRouterMain.cpp} +0 -0
- data/ext/common/agent/Watchdog/{Main.cpp → WatchdogMain.cpp} +0 -0
- data/helper-scripts/node-loader.js +2 -2
- data/lib/phusion_passenger.rb +1 -1
- data/lib/phusion_passenger/config/about_command.rb +3 -0
- data/lib/phusion_passenger/config/reopen_logs_command.rb +4 -4
- data/lib/phusion_passenger/platform_info.rb +10 -0
- data/lib/phusion_passenger/platform_info/apache.rb +14 -10
- data/lib/phusion_passenger/utils/tee_input.rb +10 -0
- data/resources/templates/standalone/config.erb +7 -3
- metadata +10 -17
- metadata.gz.asc +7 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDgwN2RlMjY2MzQ4NWZkZmMwY2ZhYjUwYTVlZjJiNWRiODY3YmZkZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTZhZDg3NGMzMDUyNjgwNTY1Y2I2MmNmZDIwZDMzNTU4ZmZjYmJkZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzMwMTBhYmQzMTQ4YWYwNDk4ZjYyZmVlYjBhZmZjY2NhY2MxZjYxMGQzODVl
|
10
|
+
ODIyMmQ1MTlkNjVlNjU3MzgyYzNmYmNhOGQxNDQzYjJiMTUwOWY5MGRkYmNh
|
11
|
+
NWE1YTZhOWRiYTFlMDEyZGRiNmJmNGMxNGM5NWQ5YjM1M2QxYjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjZlNzVmY2EwYzgyYjVkNTY5YTk4ZWRhYjRmNjM2MTA2NjQ2ZWY1NTZlM2I2
|
14
|
+
Y2VmODIwMDg1ODdkZDE5NjljOWUxMzVmM2I4N2M0N2MyZDU1YWNmN2RhOGQx
|
15
|
+
Y2U2MDJmZmRjNWQ4MDU1NzYyOGU4OTAyZjkzYzFlMTJiYzNlNWE=
|
checksums.yaml.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJV2sAHAAoJECrHRaUKISqM6SQH/jeVr+ImP7XMpKXQa4N1dP44
|
6
|
+
W98ONW4xh4fbtj30M6MXn6NToQQsTRtY+zlOIoJgRnv7z3PaVvZ2gSbpH0d7/LdS
|
7
|
+
yreVlchOjFzNE6wMDOTkM6AZAZVW9kBODvUTJenyophe08fqi7fZv6BrD8SLbrJH
|
8
|
+
FausNhLMwdeA6MDQi1sW6uPXIml5B4shVPeKnF+MKmbI/UGykIESTZROQ5XiQxVo
|
9
|
+
kWcMQDsa5D9Q8nP8xbyR3M2qzFpQ/muRXx1GC2dL+zlbUismCCgoH6StjAu2FXex
|
10
|
+
d+mJ+5dUfNgmM7k8gIF057+AFkks94d4s/9YvftUpSWa94hqSyyDfX5K8An9Vmo=
|
11
|
+
=wJYU
|
12
12
|
-----END PGP SIGNATURE-----
|
data.tar.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJV2sAHAAoJECrHRaUKISqM84UIAIEpdsK4nlS/ZxJEF6JUlWDL
|
6
|
+
t6AMVofl4ySl2SI5baoSI4lLvDfxaAA0rnOXdgDa43sdFbDu4o1ClrqixAaYGVy+
|
7
|
+
WL9natVctyF1/HKnLz+k0NihAFWAogJ46/M6Wj6RBwm66sPIqM8h3FdPMIPIsiQz
|
8
|
+
Z9/MopM0LX32+8tSPRo3dpjZhSw8pwsX7VKrxpnaAR2thr7ZiNpeP6d0VYceIcf4
|
9
|
+
IYV2eDR3y47hzHcRPRkrauewHDOP1yW1xz3V7YIR/Azl2iMg3njS0Yojl2z4tBQN
|
10
|
+
4by87m9bLXj3H5WvYlPdgZQ8XoRaOnwnLxirHPlKQWSQgATigSQ/2r08BdJ+CXQ=
|
11
|
+
=Y7ud
|
12
12
|
-----END PGP SIGNATURE-----
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
Release 5.0.16
|
2
|
+
--------------
|
3
|
+
|
4
|
+
* Allows independent configuration of Union Station gateway address, port and certificate. Closes GH-1543.
|
5
|
+
* Supports seek() such that body.rewind works when using Rack middleware that uses Zlib::GzipReader (e.g. for compressed requests). Closes GH-1553.
|
6
|
+
* [Apache] Improves detection of Apache configuration file problems. Closes GH-1577.
|
7
|
+
* [Enterprise] Fixes installation of the Passenger Enterprise Apache module on Debian Testing.
|
8
|
+
* Fixes logging of HTTP response code for Union Station. This regression was introduced by Passenger 5. Closes GH-1581.
|
9
|
+
* Adds a new subcommand `passenger-config about support-binaries-dir`.
|
10
|
+
* Fixes a regression in the Node.js loader with regard to custom startup files. This bug was introduced in 5.0.14. Closes GH-1557 (again).
|
11
|
+
* Fixes a crash when a Ruby application is accessed through a sub-URI and a root virtual host at the same time.
|
12
|
+
|
13
|
+
|
1
14
|
Release 5.0.15
|
2
15
|
--------------
|
3
16
|
|
@@ -823,6 +823,14 @@ private
|
|
823
823
|
end
|
824
824
|
|
825
825
|
def validate_install
|
826
|
+
# By compiling Passenger, we may have changed Apache's state. For example,
|
827
|
+
# if 'apache2ctl -V' failed because it referenced an Apache module that
|
828
|
+
# didn't exist, then it may exist now, causing 'apache2ctl -V' to succeed.
|
829
|
+
# We want ValidateInstallCommand to reflect the current Apache state,
|
830
|
+
# not the one before compilation started, so we clear PlatformInfo
|
831
|
+
# memoizations here.
|
832
|
+
PlatformInfo.clear_memoizations
|
833
|
+
|
826
834
|
new_screen
|
827
835
|
puts "<banner>Validating installation...</banner>"
|
828
836
|
puts
|
data/build/agents.rb
CHANGED
@@ -23,8 +23,7 @@
|
|
23
23
|
|
24
24
|
AGENT_OBJECTS = {
|
25
25
|
'WatchdogMain.o' => [
|
26
|
-
'ext/common/agent/Watchdog/
|
27
|
-
'ext/common/agent/Watchdog/Main.cpp',
|
26
|
+
'ext/common/agent/Watchdog/WatchdogMain.cpp',
|
28
27
|
'ext/common/agent/Watchdog/AgentWatcher.cpp',
|
29
28
|
'ext/common/agent/Watchdog/CoreWatcher.cpp',
|
30
29
|
'ext/common/agent/Watchdog/UstRouterWatcher.cpp',
|
@@ -43,7 +42,7 @@ AGENT_OBJECTS = {
|
|
43
42
|
'ext/common/Utils/VariantMap.h'
|
44
43
|
],
|
45
44
|
'CoreMain.o' => [
|
46
|
-
'ext/common/agent/Core/
|
45
|
+
'ext/common/agent/Core/CoreMain.cpp',
|
47
46
|
'ext/common/agent/Core/OptionParser.h',
|
48
47
|
'ext/common/agent/Core/ApiServer.h',
|
49
48
|
'ext/common/agent/Core/ResponseCache.h',
|
@@ -85,7 +84,7 @@ AGENT_OBJECTS = {
|
|
85
84
|
'ext/common/Utils/VariantMap.h'
|
86
85
|
],
|
87
86
|
'UstRouterMain.o' => [
|
88
|
-
'ext/common/agent/UstRouter/
|
87
|
+
'ext/common/agent/UstRouter/UstRouterMain.cpp',
|
89
88
|
'ext/common/agent/UstRouter/OptionParser.h',
|
90
89
|
'ext/common/agent/UstRouter/ApiServer.h',
|
91
90
|
'ext/common/agent/UstRouter/LoggingServer.h',
|
@@ -105,14 +104,14 @@ AGENT_OBJECTS = {
|
|
105
104
|
'ext/common/Utils/BlockingQueue.h'
|
106
105
|
],
|
107
106
|
'SystemMetricsMain.o' => [
|
108
|
-
'ext/common/agent/SystemMetrics/
|
107
|
+
'ext/common/agent/SystemMetrics/SystemMetricsMain.cpp',
|
109
108
|
'ext/common/Utils/SystemMetricsCollector.h'
|
110
109
|
],
|
111
110
|
'TempDirToucherMain.o' => [
|
112
|
-
'ext/common/agent/TempDirToucher/
|
111
|
+
'ext/common/agent/TempDirToucher/TempDirToucherMain.cpp'
|
113
112
|
],
|
114
113
|
'SpawnPreparerMain.o' => [
|
115
|
-
'ext/common/agent/SpawnPreparer/
|
114
|
+
'ext/common/agent/SpawnPreparer/SpawnPreparerMain.cpp'
|
116
115
|
]
|
117
116
|
}
|
118
117
|
|
@@ -138,7 +137,7 @@ agent_libs = COMMON_LIBRARY.
|
|
138
137
|
agent_objects = AGENT_OBJECTS.keys.map { |x| "#{AGENT_OUTPUT_DIR}#{x}" }
|
139
138
|
dependencies = agent_objects + [
|
140
139
|
'ext/common/Constants.h',
|
141
|
-
'ext/common/agent/
|
140
|
+
'ext/common/agent/AgentMain.cpp',
|
142
141
|
LIBBOOST_OXT,
|
143
142
|
agent_libs.link_objects,
|
144
143
|
LIBEV_TARGET,
|
@@ -147,7 +146,7 @@ dependencies = agent_objects + [
|
|
147
146
|
file AGENT_OUTPUT_DIR + AGENT_EXE => dependencies do
|
148
147
|
agent_objects_as_string = agent_objects.join(" ")
|
149
148
|
sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
|
150
|
-
compile_cxx("ext/common/agent/
|
149
|
+
compile_cxx("ext/common/agent/AgentMain.cpp",
|
151
150
|
"-o #{AGENT_OUTPUT_DIR}#{AGENT_EXE}.o " <<
|
152
151
|
"#{EXTRA_PRE_CXXFLAGS} " <<
|
153
152
|
"-Iext -Iext/common " <<
|
data/build/cxx_tests.rb
CHANGED
@@ -197,7 +197,7 @@ TEST_CXX_OBJECTS = {
|
|
197
197
|
# ext/common/UnionStation/Connection.h
|
198
198
|
# ext/common/UnionStation/Core.h
|
199
199
|
# ext/common/UnionStation/Transaction.h
|
200
|
-
# ext/common/UnionStation/
|
200
|
+
# ext/common/UnionStation/StopwatchLog.h
|
201
201
|
# ext/common/ApplicationPool2/Pool.h
|
202
202
|
# ext/common/ApplicationPool2/SuperGroup.h
|
203
203
|
# ext/common/ApplicationPool2/Group.h
|
data/build/misc.rb
CHANGED
data/doc/Users guide Apache.html
CHANGED
@@ -1073,7 +1073,7 @@ pre {
|
|
1073
1073
|
<img src="images/phusion_banner.png" alt="images/phusion_banner.png">
|
1074
1074
|
</a>
|
1075
1075
|
</span></p></div>
|
1076
|
-
<div class="paragraph"><p>This is the old, deprecated Passenger
|
1076
|
+
<div class="paragraph"><p>This is the old, deprecated Passenger for Apache documentation. Please visit <a href="https://www.phusionpassenger.com/library/">https://www.phusionpassenger.com/library/</a> for the new documentation.</p></div>
|
1077
1077
|
</div>
|
1078
1078
|
</div>
|
1079
1079
|
<div id="toc">
|
data/doc/Users guide Apache.txt
CHANGED
@@ -3,7 +3,7 @@ Phusion Passenger users guide, Apache version
|
|
3
3
|
|
4
4
|
image:images/phusion_banner.png[link="http://www.phusion.nl/"]
|
5
5
|
|
6
|
-
This is the old, deprecated Passenger
|
6
|
+
This is the old, deprecated Passenger for Apache documentation. Please visit https://www.phusionpassenger.com/library/ for the new documentation.
|
7
7
|
|
8
8
|
|
9
9
|
== Support information
|
data/doc/Users guide Nginx.html
CHANGED
@@ -1073,7 +1073,7 @@ pre {
|
|
1073
1073
|
<img src="images/phusion_banner.png" alt="images/phusion_banner.png">
|
1074
1074
|
</a>
|
1075
1075
|
</span></p></div>
|
1076
|
-
<div class="paragraph"><p>This is the old, deprecated Passenger
|
1076
|
+
<div class="paragraph"><p>This is the old, deprecated Passenger for Nginx documentation. Please visit <a href="https://www.phusionpassenger.com/library/">https://www.phusionpassenger.com/library/</a> for the new documentation.</p></div>
|
1077
1077
|
</div>
|
1078
1078
|
</div>
|
1079
1079
|
<div id="toc">
|
data/doc/Users guide Nginx.txt
CHANGED
@@ -3,7 +3,7 @@ Phusion Passenger users guide, Nginx version
|
|
3
3
|
|
4
4
|
image:images/phusion_banner.png[link="http://www.phusion.nl/"]
|
5
5
|
|
6
|
-
This is the old, deprecated Passenger
|
6
|
+
This is the old, deprecated Passenger for Nginx documentation. Please visit https://www.phusionpassenger.com/library/ for the new documentation.
|
7
7
|
|
8
8
|
|
9
9
|
== Support information
|
data/doc/Users guide.html
CHANGED
@@ -1085,7 +1085,7 @@ pre {
|
|
1085
1085
|
<div class="sect1">
|
1086
1086
|
<span class="anchor_helper" id="_the_documentation_has_moved"></span><h2 data-anchor="_the_documentation_has_moved">1. The documentation has moved</h2>
|
1087
1087
|
<div class="sectionbody">
|
1088
|
-
<div class="paragraph"><p>This is the old, deprecated Passenger
|
1088
|
+
<div class="paragraph"><p>This is the old, deprecated Passenger documentation. Please visit <a href="https://www.phusionpassenger.com/library/">https://www.phusionpassenger.com/library/</a> for the new documentation.</p></div>
|
1089
1089
|
</div>
|
1090
1090
|
</div>
|
1091
1091
|
</div>
|
data/doc/Users guide.txt
CHANGED
@@ -5,4 +5,4 @@ image:images/phusion_banner.png[link="http://www.phusion.nl/"]
|
|
5
5
|
|
6
6
|
== The documentation has moved
|
7
7
|
|
8
|
-
This is the old, deprecated Passenger
|
8
|
+
This is the old, deprecated Passenger documentation. Please visit https://www.phusionpassenger.com/library/ for the new documentation.
|
@@ -58,7 +58,7 @@ Group::generateUuid(const Pool *pool) {
|
|
58
58
|
|
59
59
|
bool
|
60
60
|
Group::shutdownCanFinish() const {
|
61
|
-
LifeStatus lifeStatus = (LifeStatus) this->lifeStatus.load(boost::
|
61
|
+
LifeStatus lifeStatus = (LifeStatus) this->lifeStatus.load(boost::memory_order_seq_cst);
|
62
62
|
return lifeStatus == SHUTTING_DOWN
|
63
63
|
&& enabledCount == 0
|
64
64
|
&& disablingCount == 0
|
@@ -83,7 +83,7 @@ Group::finishShutdown(boost::container::vector<Callback> &postLockActions) {
|
|
83
83
|
}
|
84
84
|
postLockActions.push_back(boost::bind(interruptAndJoinAllThreads,
|
85
85
|
shared_from_this()));
|
86
|
-
this->lifeStatus.store(SHUT_DOWN, boost::
|
86
|
+
this->lifeStatus.store(SHUT_DOWN, boost::memory_order_seq_cst);
|
87
87
|
selfPointer.reset();
|
88
88
|
}
|
89
89
|
|
@@ -182,7 +182,7 @@ Group::shutdown(const Callback &callback,
|
|
182
182
|
spawner.reset();
|
183
183
|
selfPointer = shared_from_this();
|
184
184
|
assert(disableWaitlist.empty());
|
185
|
-
lifeStatus.store(SHUTTING_DOWN, boost::
|
185
|
+
lifeStatus.store(SHUTTING_DOWN, boost::memory_order_seq_cst);
|
186
186
|
}
|
187
187
|
|
188
188
|
|
@@ -55,7 +55,7 @@ Group::isAlive() const {
|
|
55
55
|
OXT_FORCE_INLINE
|
56
56
|
Group::LifeStatus
|
57
57
|
Group::getLifeStatus() const {
|
58
|
-
return (LifeStatus) lifeStatus.load(boost::
|
58
|
+
return (LifeStatus) lifeStatus.load(boost::memory_order_seq_cst);
|
59
59
|
}
|
60
60
|
|
61
61
|
StaticString
|
@@ -584,7 +584,7 @@ public:
|
|
584
584
|
appendKeyValue (vec, "app_group_name", getAppGroupName());
|
585
585
|
appendKeyValue (vec, "app_type", appType);
|
586
586
|
appendKeyValue (vec, "start_command", getStartCommand(resourceLocator));
|
587
|
-
appendKeyValue (vec, "startup_file", getStartupFile());
|
587
|
+
appendKeyValue (vec, "startup_file", absolutizePath(getStartupFile(), absolutizePath(appRoot)));
|
588
588
|
appendKeyValue (vec, "process_title", getProcessTitle());
|
589
589
|
appendKeyValue2(vec, "log_level", logLevel);
|
590
590
|
appendKeyValue3(vec, "start_timeout", startTimeout);
|
data/ext/common/Constants.h
CHANGED
@@ -60,13 +60,12 @@ _mbuf_block_get(struct mbuf_pool *pool)
|
|
60
60
|
* | mbuf_block data | mbuf_block header |
|
61
61
|
* | (mbuf_block_offset) | (struct mbuf_block) |
|
62
62
|
* +-------------------------------------------------------+
|
63
|
-
* ^
|
64
|
-
* |
|
65
|
-
* \
|
66
|
-
* block->start
|
67
|
-
*
|
68
|
-
*
|
69
|
-
* block->last (one byte past valid byte)
|
63
|
+
* ^ ^^
|
64
|
+
* | ||
|
65
|
+
* \ |\
|
66
|
+
* block->start | block->end (one byte past valid bound)
|
67
|
+
* \
|
68
|
+
* block
|
70
69
|
*
|
71
70
|
*/
|
72
71
|
mbuf_block = (struct mbuf_block *)(buf + pool->mbuf_block_offset);
|
@@ -104,9 +103,6 @@ mbuf_block_get(struct mbuf_pool *pool)
|
|
104
103
|
assert(mbuf_block->end - mbuf_block->start == (int)pool->mbuf_block_offset);
|
105
104
|
assert(mbuf_block->start < mbuf_block->end);
|
106
105
|
|
107
|
-
mbuf_block->pos = mbuf_block->start;
|
108
|
-
mbuf_block->last = mbuf_block->start;
|
109
|
-
|
110
106
|
#ifdef MBUF_DEBUG
|
111
107
|
printf("[%p] mbuf_block get %p\n", oxt::thread_signature, mbuf_block);
|
112
108
|
#endif
|
@@ -119,7 +115,7 @@ mbuf_block_free(struct mbuf_pool *pool, struct mbuf_block *mbuf_block)
|
|
119
115
|
{
|
120
116
|
char *buf;
|
121
117
|
|
122
|
-
//log_debug(LOG_VVERB, "put mbuf_block %p
|
118
|
+
//log_debug(LOG_VVERB, "put mbuf_block %p", mbuf_block);
|
123
119
|
|
124
120
|
assert(STAILQ_NEXT(mbuf_block, next) == NULL);
|
125
121
|
assert(mbuf_block->magic == MBUF_BLOCK_MAGIC);
|
@@ -157,129 +153,18 @@ mbuf_block_put(struct mbuf_block *mbuf_block)
|
|
157
153
|
#endif
|
158
154
|
}
|
159
155
|
|
160
|
-
/*
|
161
|
-
* Rewind the mbuf_block by discarding any of the read or unread data that it
|
162
|
-
* might hold.
|
163
|
-
*/
|
164
|
-
void
|
165
|
-
mbuf_block_rewind(struct mbuf_block *mbuf_block)
|
166
|
-
{
|
167
|
-
mbuf_block->pos = mbuf_block->start;
|
168
|
-
mbuf_block->last = mbuf_block->start;
|
169
|
-
}
|
170
|
-
|
171
|
-
/*
|
172
|
-
* Return the length of data in mbuf_block. Mbuf cannot contain more than
|
173
|
-
* 2^32 bytes (4G).
|
174
|
-
*/
|
175
|
-
uint32_t
|
176
|
-
mbuf_block_length(struct mbuf_block *mbuf_block)
|
177
|
-
{
|
178
|
-
assert(mbuf_block->last >= mbuf_block->pos);
|
179
|
-
|
180
|
-
return (uint32_t)(mbuf_block->last - mbuf_block->pos);
|
181
|
-
}
|
182
|
-
|
183
|
-
/*
|
184
|
-
* Return the remaining space size for any new data in mbuf_block. Mbuf cannot
|
185
|
-
* contain more than 2^32 bytes (4G).
|
186
|
-
*/
|
187
|
-
uint32_t
|
188
|
-
mbuf_block_size(struct mbuf_block *mbuf_block)
|
189
|
-
{
|
190
|
-
assert(mbuf_block->end >= mbuf_block->last);
|
191
|
-
|
192
|
-
return (uint32_t)(mbuf_block->end - mbuf_block->last);
|
193
|
-
}
|
194
|
-
|
195
|
-
/*
|
196
|
-
* Insert mbuf_block at the tail of the mhdr Q
|
197
|
-
*/
|
198
|
-
void
|
199
|
-
mbuf_block_insert(struct mhdr *mhdr, struct mbuf_block *mbuf_block)
|
200
|
-
{
|
201
|
-
STAILQ_INSERT_TAIL(mhdr, mbuf_block, next);
|
202
|
-
//log_debug(LOG_VVERB, "insert mbuf_block %p len %d", mbuf_block, mbuf_block->last - mbuf_block->pos);
|
203
|
-
}
|
204
|
-
|
205
156
|
/*
|
206
157
|
* Remove mbuf_block from the mhdr Q
|
207
158
|
*/
|
208
|
-
void
|
159
|
+
static void
|
209
160
|
mbuf_block_remove(struct mhdr *mhdr, struct mbuf_block *mbuf_block)
|
210
161
|
{
|
211
|
-
//log_debug(LOG_VVERB, "remove mbuf_block %p
|
162
|
+
//log_debug(LOG_VVERB, "remove mbuf_block %p", mbuf_block);
|
212
163
|
|
213
164
|
STAILQ_REMOVE(mhdr, mbuf_block, struct mbuf_block, next);
|
214
165
|
STAILQ_NEXT(mbuf_block, next) = NULL;
|
215
166
|
}
|
216
167
|
|
217
|
-
/*
|
218
|
-
* Copy n bytes from memory area pos to mbuf_block.
|
219
|
-
*
|
220
|
-
* The memory areas should not overlap and the mbuf_block should have
|
221
|
-
* enough space for n bytes.
|
222
|
-
*/
|
223
|
-
void
|
224
|
-
mbuf_block_copy(struct mbuf_block *mbuf_block, char *pos, size_t n)
|
225
|
-
{
|
226
|
-
if (n == 0) {
|
227
|
-
return;
|
228
|
-
}
|
229
|
-
|
230
|
-
/* mbuf_block has space for n bytes */
|
231
|
-
assert(!MBUF_BLOCK_FULL(mbuf_block) && n <= mbuf_block_size(mbuf_block));
|
232
|
-
|
233
|
-
/* no overlapping copy */
|
234
|
-
assert(pos < mbuf_block->start || pos >= mbuf_block->end);
|
235
|
-
|
236
|
-
memcpy(mbuf_block->last, pos, n);
|
237
|
-
mbuf_block->last += n;
|
238
|
-
}
|
239
|
-
|
240
|
-
/*
|
241
|
-
* Split mbuf_block h into h and t by copying data from h to t. Before
|
242
|
-
* the copy, we invoke a precopy handler cb that will copy a predefined
|
243
|
-
* string to the head of t.
|
244
|
-
*
|
245
|
-
* Return new mbuf_block t, if the split was successful.
|
246
|
-
*/
|
247
|
-
struct mbuf_block *
|
248
|
-
mbuf_block_split(struct mbuf_pool *pool, struct mhdr *h, char *pos,
|
249
|
-
mbuf_block_copy_t cb, void *cbarg)
|
250
|
-
{
|
251
|
-
struct mbuf_block *mbuf_block, *nbuf;
|
252
|
-
size_t size;
|
253
|
-
|
254
|
-
assert(!STAILQ_EMPTY(h));
|
255
|
-
|
256
|
-
mbuf_block = STAILQ_LAST(h, struct mbuf_block, next);
|
257
|
-
assert(pos >= mbuf_block->pos && pos <= mbuf_block->last);
|
258
|
-
|
259
|
-
nbuf = mbuf_block_get(pool);
|
260
|
-
if (nbuf == NULL) {
|
261
|
-
return NULL;
|
262
|
-
}
|
263
|
-
|
264
|
-
if (cb != NULL) {
|
265
|
-
/* precopy nbuf */
|
266
|
-
cb(nbuf, cbarg);
|
267
|
-
}
|
268
|
-
|
269
|
-
/* copy data from mbuf_block to nbuf */
|
270
|
-
size = (size_t)(mbuf_block->last - pos);
|
271
|
-
mbuf_block_copy(nbuf, pos, size);
|
272
|
-
|
273
|
-
/* adjust mbuf_block */
|
274
|
-
mbuf_block->last = pos;
|
275
|
-
|
276
|
-
//log_debug(LOG_VVERB, "split into mbuf_block %p len %"PRIu32" and nbuf %p len "
|
277
|
-
// "%"PRIu32" copied %zu bytes", mbuf_block, mbuf_block_length(mbuf_block), nbuf,
|
278
|
-
// mbuf_block_length(nbuf), size);
|
279
|
-
|
280
|
-
return nbuf;
|
281
|
-
}
|
282
|
-
|
283
168
|
void
|
284
169
|
mbuf_pool_init(struct mbuf_pool *pool)
|
285
170
|
{
|
data/ext/common/MemoryKit/mbuf.h
CHANGED
@@ -71,7 +71,7 @@ struct mhdr;
|
|
71
71
|
typedef void (*mbuf_block_copy_t)(struct mbuf_block *, void *);
|
72
72
|
|
73
73
|
struct mbuf_block {
|
74
|
-
uint32_t
|
74
|
+
boost::uint32_t magic; /* mbuf_block magic (const) */
|
75
75
|
STAILQ_ENTRY(struct mbuf_block) next; /* next free mbuf_block */
|
76
76
|
#ifdef MBUF_ENABLE_DEBUGGING
|
77
77
|
TAILQ_ENTRY(struct mbuf_block) active_q; /* prev and next active mbuf_block */
|
@@ -79,8 +79,6 @@ struct mbuf_block {
|
|
79
79
|
#ifdef MBUF_ENABLE_BACKTRACES
|
80
80
|
char *backtrace;
|
81
81
|
#endif
|
82
|
-
char *pos; /* read marker */
|
83
|
-
char *last; /* write marker */
|
84
82
|
char *start; /* start of buffer (const) */
|
85
83
|
char *end; /* end of buffer (const) */
|
86
84
|
struct mbuf_pool *pool; /* containing pool (const) */
|
@@ -93,8 +91,8 @@ STAILQ_HEAD(mhdr, struct mbuf_block);
|
|
93
91
|
#endif
|
94
92
|
|
95
93
|
struct mbuf_pool {
|
96
|
-
uint32_t nfree_mbuf_blockq; /* # free mbuf_block */
|
97
|
-
uint32_t nactive_mbuf_blockq; /* # active (non-free) mbuf_block */
|
94
|
+
boost::uint32_t nfree_mbuf_blockq; /* # free mbuf_block */
|
95
|
+
boost::uint32_t nactive_mbuf_blockq; /* # active (non-free) mbuf_block */
|
98
96
|
struct mhdr free_mbuf_blockq; /* free mbuf_block q */
|
99
97
|
#ifdef MBUF_ENABLE_DEBUGGING
|
100
98
|
struct active_mbuf_block_list active_mbuf_blockq; /* active mbuf_block q */
|
@@ -120,14 +118,6 @@ unsigned int mbuf_pool_compact(struct mbuf_pool *pool);
|
|
120
118
|
|
121
119
|
struct mbuf_block *mbuf_block_get(struct mbuf_pool *pool);
|
122
120
|
void mbuf_block_put(struct mbuf_block *mbuf_block);
|
123
|
-
void mbuf_block_rewind(struct mbuf_block *mbuf_block);
|
124
|
-
uint32_t mbuf_block_length(struct mbuf_block *mbuf_block);
|
125
|
-
uint32_t mbuf_block_size(struct mbuf_block *mbuf_block);
|
126
|
-
void mbuf_block_insert(struct mhdr *mhdr, struct mbuf_block *mbuf_block);
|
127
|
-
void mbuf_block_remove(struct mhdr *mhdr, struct mbuf_block *mbuf_block);
|
128
|
-
void mbuf_block_copy(struct mbuf_block *mbuf_block, char *pos, size_t n);
|
129
|
-
struct mbuf_block *mbuf_block_split(struct mbuf_pool *pool, struct mhdr *h,
|
130
|
-
char *pos, mbuf_block_copy_t cb, void *cbarg);
|
131
121
|
|
132
122
|
void mbuf_block_ref(struct mbuf_block *mbuf_block);
|
133
123
|
void mbuf_block_unref(struct mbuf_block *mbuf_block);
|
@@ -22,8 +22,8 @@
|
|
22
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
23
|
* THE SOFTWARE.
|
24
24
|
*/
|
25
|
-
#ifndef
|
26
|
-
#define
|
25
|
+
#ifndef _PASSENGER_UNION_STATION_STOPWATCH_LOG_H_
|
26
|
+
#define _PASSENGER_UNION_STATION_STOPWATCH_LOG_H_
|
27
27
|
|
28
28
|
#include <boost/noncopyable.hpp>
|
29
29
|
|
@@ -44,7 +44,7 @@ using namespace std;
|
|
44
44
|
using namespace boost;
|
45
45
|
|
46
46
|
|
47
|
-
class
|
47
|
+
class StopwatchLog: public noncopyable {
|
48
48
|
private:
|
49
49
|
Transaction * const transaction;
|
50
50
|
union {
|
@@ -72,11 +72,11 @@ private:
|
|
72
72
|
}
|
73
73
|
|
74
74
|
public:
|
75
|
-
|
75
|
+
StopwatchLog()
|
76
76
|
: transaction(NULL)
|
77
77
|
{ }
|
78
78
|
|
79
|
-
|
79
|
+
StopwatchLog(const TransactionPtr &_transaction, const char *name)
|
80
80
|
: transaction(_transaction.get())
|
81
81
|
{
|
82
82
|
type = NAME;
|
@@ -107,7 +107,7 @@ public:
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
|
110
|
-
|
110
|
+
StopwatchLog(const TransactionPtr &_transaction,
|
111
111
|
const char *beginMessage,
|
112
112
|
const char *endMessage,
|
113
113
|
const char *abortMessage = NULL)
|
@@ -122,7 +122,7 @@ public:
|
|
122
122
|
}
|
123
123
|
}
|
124
124
|
|
125
|
-
~
|
125
|
+
~StopwatchLog() {
|
126
126
|
if (transaction == NULL) {
|
127
127
|
return;
|
128
128
|
}
|
@@ -169,4 +169,4 @@ public:
|
|
169
169
|
} // namespace UnionStation
|
170
170
|
} // namespace Passenger
|
171
171
|
|
172
|
-
#endif /*
|
172
|
+
#endif /* _PASSENGER_UNION_STATION_STOPWATCH_LOG_H_ */
|
File without changes
|
@@ -250,7 +250,7 @@ initializeSingleAppMode() {
|
|
250
250
|
}
|
251
251
|
|
252
252
|
options.set("app_type", getAppTypeName(appType));
|
253
|
-
options.set("startup_file", getAppTypeStartupFile(appType));
|
253
|
+
options.set("startup_file", options.get("app_root") + "/" + getAppTypeStartupFile(appType));
|
254
254
|
}
|
255
255
|
|
256
256
|
P_NOTICE(SHORT_PROGRAM_NAME " core running in single-application mode.");
|
@@ -34,7 +34,7 @@ beginBufferingBody(Client *client, Request *req) {
|
|
34
34
|
req->bodyChannel.start();
|
35
35
|
req->bodyBuffer.reinitialize();
|
36
36
|
req->bodyBuffer.stop();
|
37
|
-
req->
|
37
|
+
req->beginStopwatchLog(&req->stopwatchLogs.bufferingRequestBody, "buffering request body");
|
38
38
|
}
|
39
39
|
|
40
40
|
Channel::Result
|
@@ -83,7 +83,7 @@ whenBufferingBody_onRequestBody(Client *client, Request *req,
|
|
83
83
|
req->headers.erase(HTTP_TRANSFER_ENCODING);
|
84
84
|
req->headers.insert(&header, req->pool);
|
85
85
|
}
|
86
|
-
req->
|
86
|
+
req->endStopwatchLog(&req->stopwatchLogs.bufferingRequestBody);
|
87
87
|
checkoutSession(client, req);
|
88
88
|
return Channel::Result(0, true);
|
89
89
|
} else {
|
@@ -35,7 +35,7 @@ checkoutSession(Client *client, Request *req) {
|
|
35
35
|
RH_BENCHMARK_POINT(client, req, BM_BEFORE_CHECKOUT);
|
36
36
|
SKC_TRACE(client, 2, "Checking out session: appRoot=" << options.appRoot);
|
37
37
|
req->state = Request::CHECKING_OUT_SESSION;
|
38
|
-
req->
|
38
|
+
req->beginStopwatchLog(&req->stopwatchLogs.getFromPool, "get from pool");
|
39
39
|
if (req->requestBodyBuffering) {
|
40
40
|
assert(!req->bodyBuffer.isStarted());
|
41
41
|
} else {
|
@@ -119,7 +119,7 @@ sessionCheckedOutFromEventLoopThread(Client *client, Request *req,
|
|
119
119
|
initiateSession(client, req);
|
120
120
|
} else {
|
121
121
|
UPDATE_TRACE_POINT();
|
122
|
-
req->
|
122
|
+
req->endStopwatchLog(&req->stopwatchLogs.getFromPool, false);
|
123
123
|
reportSessionCheckoutError(client, req, e);
|
124
124
|
}
|
125
125
|
}
|
@@ -171,11 +171,11 @@ initiateSession(Client *client, Request *req) {
|
|
171
171
|
|
172
172
|
UPDATE_TRACE_POINT();
|
173
173
|
if (req->useUnionStation()) {
|
174
|
-
req->
|
174
|
+
req->endStopwatchLog(&req->stopwatchLogs.getFromPool);
|
175
175
|
req->logMessage("Application PID: " +
|
176
176
|
toString(req->session->getPid()) +
|
177
177
|
" (GUPID: " + req->session->getGupid() + ")");
|
178
|
-
req->
|
178
|
+
req->beginStopwatchLog(&req->stopwatchLogs.requestProxying, "request proxying");
|
179
179
|
}
|
180
180
|
|
181
181
|
UPDATE_TRACE_POINT();
|
@@ -776,6 +776,7 @@ sendResponseHeaderWithWritev(Client *client, Request *req, ssize_t &bytesWritten
|
|
776
776
|
if (constructHeaderBuffersForResponse(req, buffers,
|
777
777
|
maxbuffers, nbuffers, dataSize, nCacheableBuffers))
|
778
778
|
{
|
779
|
+
SKC_TRACE(client, 2, "Sending response headers using writev()");
|
779
780
|
logResponseHeaders(client, req, buffers, nbuffers, dataSize);
|
780
781
|
markHeaderBuffersForTurboCaching(client, req, buffers, nCacheableBuffers);
|
781
782
|
|
@@ -815,11 +816,13 @@ sendResponseHeaderWithBuffering(Client *client, Request *req, unsigned int offse
|
|
815
816
|
MemoryKit::mbuf_pool &mbuf_pool = getContext()->mbuf_pool;
|
816
817
|
const unsigned int MBUF_MAX_SIZE = mbuf_pool_data_size(&mbuf_pool);
|
817
818
|
if (dataSize <= MBUF_MAX_SIZE) {
|
819
|
+
SKC_TRACE(client, 2, "Sending response headers using an mbuf");
|
818
820
|
MemoryKit::mbuf buffer(MemoryKit::mbuf_get(&mbuf_pool));
|
819
821
|
gatherBuffers(buffer.start, MBUF_MAX_SIZE, buffers, nbuffers);
|
820
822
|
buffer = MemoryKit::mbuf(buffer, offset, dataSize - offset);
|
821
823
|
writeResponse(client, buffer);
|
822
824
|
} else {
|
825
|
+
SKC_TRACE(client, 2, "Sending response headers using a psg_pool buffer");
|
823
826
|
char *buffer = (char *) psg_pnalloc(req->pool, dataSize);
|
824
827
|
gatherBuffers(buffer, dataSize, buffers, nbuffers);
|
825
828
|
writeResponse(client, buffer + offset, dataSize - offset);
|
@@ -836,6 +839,15 @@ logResponseHeaders(Client *client, Request *req, struct iovec *buffers,
|
|
836
839
|
SKC_TRACE(client, 3, "Sending response headers: \"" <<
|
837
840
|
cEscapeString(StaticString(buffer, dataSize)) << "\"");
|
838
841
|
}
|
842
|
+
|
843
|
+
if (req->useUnionStation()) {
|
844
|
+
const char *status = getStatusCodeAndReasonPhrase(req->appResponse.statusCode);
|
845
|
+
if (status != NULL) {
|
846
|
+
req->logMessage("Status: " + StaticString(status));
|
847
|
+
} else {
|
848
|
+
req->logMessage("Status: " + toString(req->appResponse.statusCode));
|
849
|
+
}
|
850
|
+
}
|
839
851
|
}
|
840
852
|
|
841
853
|
void
|
@@ -850,7 +862,7 @@ markHeaderBuffersForTurboCaching(Client *client, Request *req, struct iovec *buf
|
|
850
862
|
}
|
851
863
|
|
852
864
|
if (totalSize > ResponseCache<Request>::MAX_HEADER_SIZE) {
|
853
|
-
SKC_DEBUG(client, "Response
|
865
|
+
SKC_DEBUG(client, "Response headers larger than " <<
|
854
866
|
ResponseCache<Request>::MAX_HEADER_SIZE <<
|
855
867
|
" bytes, so response is not eligible for turbocaching");
|
856
868
|
// Decrease store success ratio.
|
@@ -992,6 +1004,7 @@ handleAppResponseBodyEnd(Client *client, Request *req) {
|
|
992
1004
|
keepAliveAppConnection(client, req);
|
993
1005
|
storeAppResponseInTurboCache(client, req);
|
994
1006
|
finalizeUnionStationWithSuccess(client, req);
|
1007
|
+
assert(!req->ended());
|
995
1008
|
}
|
996
1009
|
|
997
1010
|
OXT_FORCE_INLINE void
|
@@ -1038,6 +1051,6 @@ storeAppResponseInTurboCache(Client *client, Request *req) {
|
|
1038
1051
|
|
1039
1052
|
void
|
1040
1053
|
finalizeUnionStationWithSuccess(Client *client, Request *req) {
|
1041
|
-
req->
|
1042
|
-
req->
|
1054
|
+
req->endStopwatchLog(&req->stopwatchLogs.requestProcessing, true);
|
1055
|
+
req->endStopwatchLog(&req->stopwatchLogs.requestProxying, true);
|
1043
1056
|
}
|
@@ -109,10 +109,10 @@ virtual void reinitializeRequest(Client *client, Request *req) {
|
|
109
109
|
virtual void deinitializeRequest(Client *client, Request *req) {
|
110
110
|
req->session.reset();
|
111
111
|
|
112
|
-
req->
|
113
|
-
req->
|
114
|
-
req->
|
115
|
-
req->
|
112
|
+
req->endStopwatchLog(&req->stopwatchLogs.requestProxying, false);
|
113
|
+
req->endStopwatchLog(&req->stopwatchLogs.getFromPool, false);
|
114
|
+
req->endStopwatchLog(&req->stopwatchLogs.bufferingRequestBody, false);
|
115
|
+
req->endStopwatchLog(&req->stopwatchLogs.requestProcessing, false);
|
116
116
|
|
117
117
|
req->options.transaction.reset();
|
118
118
|
|
@@ -416,7 +416,7 @@ initializeUnionStation(Client *client, Request *req, RequestAnalysis &analysis)
|
|
416
416
|
options.unionStationKey = StaticString(key->start->data, key->size);
|
417
417
|
}
|
418
418
|
|
419
|
-
req->
|
419
|
+
req->beginStopwatchLog(&req->stopwatchLogs.requestProcessing, "request processing");
|
420
420
|
req->logMessage(string("Request method: ") + http_method_str(req->method));
|
421
421
|
req->logMessage("URI: " + StaticString(req->path.start->data, req->path.size));
|
422
422
|
}
|
@@ -35,7 +35,7 @@
|
|
35
35
|
#include <ApplicationPool2/Pool.h>
|
36
36
|
#include <UnionStation/Core.h>
|
37
37
|
#include <UnionStation/Transaction.h>
|
38
|
-
#include <UnionStation/
|
38
|
+
#include <UnionStation/StopwatchLog.h>
|
39
39
|
#include <agent/Core/RequestHandler/AppResponse.h>
|
40
40
|
#include <Logging.h>
|
41
41
|
|
@@ -84,11 +84,11 @@ public:
|
|
84
84
|
boost::uint64_t bodyBytesBuffered; // After dechunking
|
85
85
|
|
86
86
|
struct {
|
87
|
-
UnionStation::
|
88
|
-
UnionStation::
|
89
|
-
UnionStation::
|
90
|
-
UnionStation::
|
91
|
-
}
|
87
|
+
UnionStation::StopwatchLog *requestProcessing;
|
88
|
+
UnionStation::StopwatchLog *bufferingRequestBody;
|
89
|
+
UnionStation::StopwatchLog *getFromPool;
|
90
|
+
UnionStation::StopwatchLog *requestProxying;
|
91
|
+
} stopwatchLogs;
|
92
92
|
|
93
93
|
HashedStaticString cacheKey;
|
94
94
|
LString *cacheControl;
|
@@ -105,7 +105,7 @@ public:
|
|
105
105
|
Request()
|
106
106
|
: BaseHttpRequest()
|
107
107
|
{
|
108
|
-
memset(&
|
108
|
+
memset(&stopwatchLogs, 0, sizeof(stopwatchLogs));
|
109
109
|
}
|
110
110
|
|
111
111
|
const char *getStateString() const {
|
@@ -131,18 +131,18 @@ public:
|
|
131
131
|
return options.transaction != NULL;
|
132
132
|
}
|
133
133
|
|
134
|
-
void
|
134
|
+
void beginStopwatchLog(UnionStation::StopwatchLog **stopwatchLog, const char *name) {
|
135
135
|
if (options.transaction != NULL) {
|
136
|
-
*
|
136
|
+
*stopwatchLog = new UnionStation::StopwatchLog(options.transaction, name);
|
137
137
|
}
|
138
138
|
}
|
139
139
|
|
140
|
-
void
|
141
|
-
if (success && *
|
142
|
-
(*
|
140
|
+
void endStopwatchLog(UnionStation::StopwatchLog **stopwatchLog, bool success = true) {
|
141
|
+
if (success && *stopwatchLog != NULL) {
|
142
|
+
(*stopwatchLog)->success();
|
143
143
|
}
|
144
|
-
delete *
|
145
|
-
*
|
144
|
+
delete *stopwatchLog;
|
145
|
+
*stopwatchLog = NULL;
|
146
146
|
}
|
147
147
|
|
148
148
|
void logMessage(const StaticString &message) {
|
@@ -175,7 +175,8 @@ determineHeaderSizeForSessionProtocol(Request *req,
|
|
175
175
|
unsigned int dataSize = sizeof(boost::uint32_t);
|
176
176
|
|
177
177
|
state.path = req->getPathWithoutQueryString();
|
178
|
-
state.hasBaseURI = req->options.baseURI != P_STATIC_STRING("/")
|
178
|
+
state.hasBaseURI = req->options.baseURI != P_STATIC_STRING("/")
|
179
|
+
&& startsWith(state.path, req->options.baseURI);
|
179
180
|
if (state.hasBaseURI) {
|
180
181
|
state.path = state.path.substr(req->options.baseURI.size());
|
181
182
|
if (state.path.empty()) {
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -116,8 +116,8 @@ function configure(_options) {
|
|
116
116
|
|
117
117
|
function loadApplication() {
|
118
118
|
var appRoot = PhusionPassenger.options.app_root || process.cwd();
|
119
|
-
var startupFile = PhusionPassenger.options.startup_file || 'app.js';
|
120
|
-
require(
|
119
|
+
var startupFile = PhusionPassenger.options.startup_file || (appRoot + '/' + 'app.js');
|
120
|
+
require(startupFile);
|
121
121
|
}
|
122
122
|
|
123
123
|
function extractCallback(args) {
|
data/lib/phusion_passenger.rb
CHANGED
@@ -30,7 +30,7 @@ module PhusionPassenger
|
|
30
30
|
|
31
31
|
PACKAGE_NAME = 'passenger'
|
32
32
|
# Run 'rake ext/common/Constants.h' after changing this number.
|
33
|
-
VERSION_STRING = '5.0.
|
33
|
+
VERSION_STRING = '5.0.16'
|
34
34
|
|
35
35
|
PREFERRED_NGINX_VERSION = '1.8.0'
|
36
36
|
NGINX_SHA256_CHECKSUM = '23cca1239990c818d8f6da118320c4979aadf5386deda691b1b7c2c96b9df3d5'
|
@@ -40,6 +40,7 @@ module PhusionPassenger
|
|
40
40
|
puts " nginx-addon-dir Show #{PROGRAM_NAME}'s Nginx addon directory."
|
41
41
|
puts " nginx-libs Show Nginx runtime library flags."
|
42
42
|
puts " resourcesdir Show #{PROGRAM_NAME}'s resources directory."
|
43
|
+
puts " support-binaries-dir Show #{PROGRAM_NAME}'s support binaries dir."
|
43
44
|
puts " compiled Check whether runtime libraries are compiled."
|
44
45
|
puts " custom-packaged Check whether Phusion Passenger is custom"
|
45
46
|
puts " packaged."
|
@@ -77,6 +78,8 @@ module PhusionPassenger
|
|
77
78
|
puts "#{common_library.link_objects_as_string} #{PhusionPassenger.lib_dir}/common/libboost_oxt.a"
|
78
79
|
when "--resourcesdir"
|
79
80
|
puts PhusionPassenger.resources_dir
|
81
|
+
when "--support-binaries-dir"
|
82
|
+
puts PhusionPassenger.support_binaries_dir
|
80
83
|
when "--compiled"
|
81
84
|
common_library.link_objects.each do |filename|
|
82
85
|
if !File.exist?(filename)
|
@@ -88,14 +88,14 @@ module PhusionPassenger
|
|
88
88
|
handle_error(name, response)
|
89
89
|
end
|
90
90
|
else
|
91
|
-
STDERR.puts "*** An error occured while communicating with the #{
|
91
|
+
STDERR.puts "*** An error occured while communicating with the #{PROGRAM_NAME} #{name} (code #{response.code}):"
|
92
92
|
STDERR.puts response.body
|
93
93
|
abort
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
97
|
def perform_reinherit_logs_on(name, socket_name)
|
98
|
-
puts "
|
98
|
+
puts "Reopening logs for #{PROGRAM_NAME} #{name} (through reinheritance)"
|
99
99
|
request = Net::HTTP::Post.new("/reinherit_logs.json")
|
100
100
|
try_performing_full_admin_basic_auth(request, @instance)
|
101
101
|
request.content_type = "application/json"
|
@@ -108,7 +108,7 @@ module PhusionPassenger
|
|
108
108
|
handle_error(name, response)
|
109
109
|
end
|
110
110
|
else
|
111
|
-
STDERR.puts "*** An error occured while communicating with the #{
|
111
|
+
STDERR.puts "*** An error occured while communicating with the #{PROGRAM_NAME} #{name} (code #{response.code}):"
|
112
112
|
STDERR.puts response.body
|
113
113
|
abort
|
114
114
|
end
|
@@ -117,7 +117,7 @@ module PhusionPassenger
|
|
117
117
|
def handle_error(name, response)
|
118
118
|
json = PhusionPassenger::Utils::JSON.parse(response.body)
|
119
119
|
if !should_ignore_error?(json)
|
120
|
-
STDERR.puts "*** An error occured while communicating with the #{
|
120
|
+
STDERR.puts "*** An error occured while communicating with the #{PROGRAM_NAME} #{name} (code #{response.code}):"
|
121
121
|
STDERR.puts json['message']
|
122
122
|
abort
|
123
123
|
end
|
@@ -226,6 +226,16 @@ module PhusionPassenger
|
|
226
226
|
return ""
|
227
227
|
end
|
228
228
|
|
229
|
+
# Clears all memoized values. However, the disk cache (if any is configured)
|
230
|
+
# is still used.
|
231
|
+
def self.clear_memoizations
|
232
|
+
class_variables.each do |name|
|
233
|
+
if name.to_s =~ /^@@has_memoized_/
|
234
|
+
class_variable_set(name, false)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
229
239
|
def self.tmpdir
|
230
240
|
result = ENV['TMPDIR']
|
231
241
|
if result && !result.empty?
|
@@ -102,7 +102,7 @@ module PhusionPassenger
|
|
102
102
|
end
|
103
103
|
memoize :httpd_version
|
104
104
|
|
105
|
-
# Run `apache2ctl -V` and return its output.
|
105
|
+
# Run `apache2ctl -V` and return its output, or nil on failure.
|
106
106
|
#
|
107
107
|
# We used to run `httpd -V`, but on systems like Ubuntu it depends on various
|
108
108
|
# environment variables or directories, wich apache2ctl loads or initializes.
|
@@ -137,16 +137,20 @@ module PhusionPassenger
|
|
137
137
|
e_filename = Shellwords.escape(filename)
|
138
138
|
output = `#{version_command} -V 2>#{e_filename}`
|
139
139
|
|
140
|
-
|
141
|
-
f2
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
140
|
+
if $? && $?.exitstatus == 0
|
141
|
+
stderr_text = File.open(filename, "rb") do |f2|
|
142
|
+
f2.read
|
143
|
+
end
|
144
|
+
# This stderr message shows up on Ubuntu. We ignore it.
|
145
|
+
stderr_text.sub!(/.*Could not reliably determine the server's fully qualified domain name.*\r?\n?/, "")
|
146
|
+
# But we print the rest of stderr.
|
147
|
+
STDERR.write(stderr_text)
|
148
|
+
STDERR.flush
|
148
149
|
|
149
|
-
|
150
|
+
output
|
151
|
+
else
|
152
|
+
nil
|
153
|
+
end
|
150
154
|
end
|
151
155
|
else
|
152
156
|
nil
|
@@ -167,6 +167,16 @@ class TeeInput
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
|
+
def seek(*args)
|
171
|
+
if !socket_drained?
|
172
|
+
# seek may be forward, or relative to the end, so we need to consume the socket fully into tmp
|
173
|
+
pos = @tmp.pos # save/restore tmp.pos, to not break relative seeks
|
174
|
+
consume!
|
175
|
+
@tmp.pos = pos
|
176
|
+
end
|
177
|
+
@tmp.seek(*args)
|
178
|
+
end
|
179
|
+
|
170
180
|
def rewind
|
171
181
|
return 0 if 0 == @tmp.size
|
172
182
|
consume! if !socket_drained?
|
@@ -87,7 +87,11 @@ http {
|
|
87
87
|
|
88
88
|
<% if @options[:union_station_gateway_address] %>
|
89
89
|
union_station_gateway_address <%= @options[:union_station_gateway_address] %>;
|
90
|
+
<% end %>
|
91
|
+
<% if @options[:union_station_gateway_port] %>
|
90
92
|
union_station_gateway_port <%= @options[:union_station_gateway_port] %>;
|
93
|
+
<% end %>
|
94
|
+
<% if @options[:union_station_gateway_cert] %>
|
91
95
|
union_station_gateway_cert -;
|
92
96
|
<% end %>
|
93
97
|
|
@@ -106,9 +110,9 @@ http {
|
|
106
110
|
gzip_comp_level 3;
|
107
111
|
gzip_min_length 150;
|
108
112
|
gzip_proxied any;
|
109
|
-
gzip_types text/plain text/css text/json text/javascript
|
110
|
-
application/javascript application/x-javascript application/json
|
111
|
-
application/rss+xml application/vnd.ms-fontobject application/x-font-ttf
|
113
|
+
gzip_types text/plain text/css text/json text/javascript
|
114
|
+
application/javascript application/x-javascript application/json
|
115
|
+
application/rss+xml application/vnd.ms-fontobject application/x-font-ttf
|
112
116
|
application/xml font/opentype image/svg+xml text/xml;
|
113
117
|
|
114
118
|
<% if @app_finder.multi_mode? %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phusion - http://www.phusion.nl/
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -2543,7 +2543,7 @@ files:
|
|
2543
2543
|
- ext/common/StaticString.h
|
2544
2544
|
- ext/common/UnionStation/Connection.h
|
2545
2545
|
- ext/common/UnionStation/Core.h
|
2546
|
-
- ext/common/UnionStation/
|
2546
|
+
- ext/common/UnionStation/StopwatchLog.h
|
2547
2547
|
- ext/common/UnionStation/Transaction.h
|
2548
2548
|
- ext/common/Utils.cpp
|
2549
2549
|
- ext/common/Utils.h
|
@@ -2607,11 +2607,12 @@ files:
|
|
2607
2607
|
- ext/common/Utils/utf8/checked.h
|
2608
2608
|
- ext/common/Utils/utf8/core.h
|
2609
2609
|
- ext/common/Utils/utf8/unchecked.h
|
2610
|
+
- ext/common/agent/AgentMain.cpp
|
2610
2611
|
- ext/common/agent/ApiServerUtils.h
|
2611
2612
|
- ext/common/agent/Base.cpp
|
2612
2613
|
- ext/common/agent/Base.h
|
2613
2614
|
- ext/common/agent/Core/ApiServer.h
|
2614
|
-
- ext/common/agent/Core/
|
2615
|
+
- ext/common/agent/Core/CoreMain.cpp
|
2615
2616
|
- ext/common/agent/Core/OptionParser.h
|
2616
2617
|
- ext/common/agent/Core/RequestHandler.h
|
2617
2618
|
- ext/common/agent/Core/RequestHandler/AppResponse.h
|
@@ -2626,24 +2627,23 @@ files:
|
|
2626
2627
|
- ext/common/agent/Core/RequestHandler/TurboCaching.h
|
2627
2628
|
- ext/common/agent/Core/RequestHandler/Utils.cpp
|
2628
2629
|
- ext/common/agent/Core/ResponseCache.h
|
2629
|
-
- ext/common/agent/
|
2630
|
-
- ext/common/agent/
|
2631
|
-
- ext/common/agent/
|
2632
|
-
- ext/common/agent/TempDirToucher/Main.cpp
|
2630
|
+
- ext/common/agent/SpawnPreparer/SpawnPreparerMain.cpp
|
2631
|
+
- ext/common/agent/SystemMetrics/SystemMetricsMain.cpp
|
2632
|
+
- ext/common/agent/TempDirToucher/TempDirToucherMain.cpp
|
2633
2633
|
- ext/common/agent/UstRouter/ApiServer.h
|
2634
2634
|
- ext/common/agent/UstRouter/DataStoreId.h
|
2635
2635
|
- ext/common/agent/UstRouter/FilterSupport.cpp
|
2636
2636
|
- ext/common/agent/UstRouter/FilterSupport.h
|
2637
2637
|
- ext/common/agent/UstRouter/LoggingServer.h
|
2638
|
-
- ext/common/agent/UstRouter/Main.cpp
|
2639
2638
|
- ext/common/agent/UstRouter/OptionParser.h
|
2640
2639
|
- ext/common/agent/UstRouter/RemoteSender.h
|
2640
|
+
- ext/common/agent/UstRouter/UstRouterMain.cpp
|
2641
2641
|
- ext/common/agent/Watchdog/AgentWatcher.cpp
|
2642
2642
|
- ext/common/agent/Watchdog/ApiServer.h
|
2643
2643
|
- ext/common/agent/Watchdog/CoreWatcher.cpp
|
2644
2644
|
- ext/common/agent/Watchdog/InstanceDirToucher.cpp
|
2645
|
-
- ext/common/agent/Watchdog/Main.cpp
|
2646
2645
|
- ext/common/agent/Watchdog/UstRouterWatcher.cpp
|
2646
|
+
- ext/common/agent/Watchdog/WatchdogMain.cpp
|
2647
2647
|
- ext/libev/Changes
|
2648
2648
|
- ext/libev/LICENSE
|
2649
2649
|
- ext/libev/Makefile.am
|
@@ -2684,13 +2684,6 @@ files:
|
|
2684
2684
|
- ext/libuv/README.md
|
2685
2685
|
- ext/libuv/aclocal.m4
|
2686
2686
|
- ext/libuv/ar-lib
|
2687
|
-
- ext/libuv/autom4te.cache/output.0
|
2688
|
-
- ext/libuv/autom4te.cache/output.1
|
2689
|
-
- ext/libuv/autom4te.cache/output.2
|
2690
|
-
- ext/libuv/autom4te.cache/requests
|
2691
|
-
- ext/libuv/autom4te.cache/traces.0
|
2692
|
-
- ext/libuv/autom4te.cache/traces.1
|
2693
|
-
- ext/libuv/autom4te.cache/traces.2
|
2694
2687
|
- ext/libuv/checksparse.sh
|
2695
2688
|
- ext/libuv/common.gypi
|
2696
2689
|
- ext/libuv/compile
|
metadata.gz.asc
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
|
3
3
|
Comment: GPGTools - http://gpgtools.org
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
=
|
5
|
+
iQEcBAABAgAGBQJV2sAHAAoJECrHRaUKISqMiqkH/jfE92JB1oWIyLNOJ92Fwksa
|
6
|
+
lFUC66V79wkjv3hJVjkGb3z9kkAyvRRku7weTyHeCGZIkPtkP7I+AyP5ZyIfX90c
|
7
|
+
YI1Yoae6s6MDnEeBGh7z1vHx6bHOddgbQmBCrapbSvS2jAU35smuiD4yvcwuYHcN
|
8
|
+
2v+dC6PYfGe5l9dugJAF9gXZ6WjaRmOlEl1n54SZ1p6cxgg4wOaaTV6/8xjYDFmO
|
9
|
+
0QK7ualtpyEbpOpsJyw6W/rOus8HzNUbA9BYYn3buj/VEztxBzXjM8iMZU7/d9T6
|
10
|
+
UemM3UcoowbV5o5xLPY00MazpiFenevmC9fOAxFNSVvD2FzE8RGJBETNUnSlpKc=
|
11
|
+
=vfGW
|
12
12
|
-----END PGP SIGNATURE-----
|