passenger 5.3.4 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +69 -0
- data/CONTRIBUTORS +1 -0
- data/README.md +2 -1
- data/Rakefile +0 -5
- data/build/agent.rb +6 -3
- data/build/cxx_tests.rb +28 -19
- data/build/integration_tests.rb +6 -2
- data/build/misc.rb +2 -1
- data/build/packaging.rb +2 -0
- data/build/support/cplusplus.rb +2 -2
- data/build/support/cxx_dependency_map.rb +2651 -2189
- data/dev/colorize-logs +272 -0
- data/dev/show-latest-crashlog-dir +27 -0
- data/resources/templates/standalone/http.erb +2 -0
- data/resources/templates/standalone/server.erb +1 -0
- data/src/agent/AgentMain.cpp +4 -0
- data/src/agent/Core/AdminPanelConnector.h +6 -6
- data/src/agent/Core/ApiServer.h +4 -4
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
- data/src/agent/Core/ApplicationPool/Context.h +5 -1
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +2 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +3 -3
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +13 -20
- data/src/agent/Core/ApplicationPool/Group.h +4 -2
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
- data/src/agent/Core/ApplicationPool/Options.h +42 -38
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +2 -1
- data/src/agent/Core/ApplicationPool/Pool.h +4 -4
- data/src/agent/Core/ApplicationPool/Process.h +13 -15
- data/src/agent/Core/ApplicationPool/Socket.h +5 -5
- data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
- data/src/agent/Core/Config.h +50 -10
- data/src/agent/Core/ConfigChange.cpp +13 -1
- data/src/agent/Core/Controller/Config.h +41 -17
- data/src/agent/Core/Controller/ForwardResponse.cpp +4 -0
- data/src/agent/Core/Controller/InitRequest.cpp +14 -8
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +5 -0
- data/src/agent/Core/Controller/SendRequest.cpp +9 -9
- data/src/agent/Core/Controller/TurboCaching.h +2 -2
- data/src/agent/Core/Controller.h +7 -5
- data/src/agent/Core/CoreMain.cpp +204 -60
- data/src/agent/Core/OptionParser.h +20 -3
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SecurityUpdateChecker.h +4 -2
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Config.h +3 -2
- data/src/agent/Core/SpawningKit/Context.h +8 -2
- data/src/agent/Core/SpawningKit/DirectSpawner.h +4 -4
- data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
- data/src/agent/Core/SpawningKit/Exceptions.h +21 -14
- data/src/agent/Core/SpawningKit/Factory.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +14 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
- data/src/agent/Core/SpawningKit/Journey.h +4 -5
- data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
- data/src/agent/Core/SpawningKit/README.md +34 -17
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Result.h +20 -8
- data/src/agent/Core/SpawningKit/SmartSpawner.h +7 -7
- data/src/agent/Core/SpawningKit/Spawner.h +25 -8
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +17 -7
- data/src/agent/Core/TelemetryCollector.h +681 -0
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/FileReadHelper/FileReadHelperMain.cpp +198 -0
- data/src/agent/README.md +1 -1
- data/src/agent/Shared/ApiAccountUtils.h +1 -1
- data/src/agent/Shared/ApiServerUtils.h +3 -3
- data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
- data/src/agent/Shared/Fundamentals/AbortHandler.cpp +324 -98
- data/src/agent/Shared/Fundamentals/AbortHandler.h +31 -4
- data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -5
- data/src/agent/Shared/Fundamentals/Initialization.h +9 -1
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +3 -3
- data/src/agent/Watchdog/ApiServer.h +3 -3
- data/src/agent/Watchdog/Config.h +24 -5
- data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
- data/src/agent/Watchdog/WatchdogMain.cpp +97 -28
- data/src/apache2_module/Config.cpp +14 -14
- data/src/apache2_module/Config.h +8 -16
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +510 -481
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +69 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
- data/src/apache2_module/ConfigGeneral/Common.h +45 -0
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +17 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +19 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +36 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
- data/src/apache2_module/DirectoryMapper.h +36 -37
- data/src/apache2_module/Hooks.cpp +27 -8
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +20 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +48 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
- data/src/cxx_supportlib/AppLocalConfigFileUtils.h +148 -0
- data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +147 -0
- data/src/cxx_supportlib/AppTypeDetector/CBindings.h +75 -0
- data/src/cxx_supportlib/{AppTypes.h → AppTypeDetector/Detector.h} +92 -131
- data/src/cxx_supportlib/ConfigKit/README.md +90 -2
- data/src/cxx_supportlib/ConfigKit/Schema.h +60 -15
- data/src/cxx_supportlib/ConfigKit/Store.h +129 -5
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
- data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
- data/src/cxx_supportlib/DataStructures/LString.h +3 -3
- data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
- data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
- data/src/cxx_supportlib/Hooks.h +2 -2
- data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +4 -3
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
- data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
- data/src/cxx_supportlib/InstanceDirectory.h +4 -4
- data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
- data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
- data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +3 -3
- data/src/cxx_supportlib/ProcessManagement/Ruby.h +7 -2
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +19 -12
- data/src/cxx_supportlib/ProcessManagement/Spawn.h +21 -2
- data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
- data/src/cxx_supportlib/RandomGenerator.h +2 -2
- data/src/cxx_supportlib/ResourceLocator.h +1 -1
- data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
- data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
- data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/ClientRef.h +17 -7
- data/src/cxx_supportlib/ServerKit/Context.h +2 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
- data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +17 -7
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
- data/src/cxx_supportlib/ServerKit/Server.h +3 -4
- data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +12 -12
- data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +88 -0
- data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +15 -12
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
- data/src/cxx_supportlib/Utils/Curl.h +2 -2
- data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
- data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
- data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
- data/src/cxx_supportlib/Utils/Timer.h +2 -2
- data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
- data/src/cxx_supportlib/Utils.cpp +2 -2
- data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +85 -0
- data/src/cxx_supportlib/{Utils/MemoryBarrier.h → WrapperRegistry/CBindings.h} +30 -27
- data/src/cxx_supportlib/WrapperRegistry/Entry.h +112 -0
- data/src/cxx_supportlib/WrapperRegistry/README.md +37 -0
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +309 -0
- data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
- data/src/helper-scripts/download_binaries/extconf.rb +6 -2
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +32 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +12 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +36 -0
- data/src/nginx_module/Configuration.c +23 -3
- data/src/nginx_module/ContentHandler.c +331 -32
- data/src/nginx_module/ContentHandler.h +8 -3
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +10 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +27 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +3 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +7 -0
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +11 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +23 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +8 -0
- data/src/nginx_module/config +2 -1
- data/src/nginx_module/ngx_http_passenger_module.c +9 -3
- data/src/nginx_module/ngx_http_passenger_module.h +10 -3
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +19 -0
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +19 -16
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +6 -2
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +6 -2
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +7 -3
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +29 -0
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
- data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +22 -2
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -1
- data/src/ruby_supportlib/phusion_passenger.rb +7 -5
- data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
- metadata +40 -89
- data/.editorconfig +0 -134
- data/CODE_OF_CONDUCT.md +0 -52
- data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
- data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
- data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
- data/dev/ci/README.md +0 -134
- data/dev/ci/lib/functions.sh +0 -129
- data/dev/ci/lib/set-container-envvars.sh +0 -53
- data/dev/ci/lib/setup-container.sh +0 -46
- data/dev/ci/run-tests-natively +0 -24
- data/dev/ci/run-tests-with-docker +0 -42
- data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
- data/dev/ci/scripts/docker-entrypoint.sh +0 -17
- data/dev/ci/scripts/inituidgid +0 -17
- data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
- data/dev/ci/scripts/setup-host-natively.sh +0 -11
- data/dev/ci/setup-host +0 -56
- data/dev/ci/tests/apache2/run +0 -6
- data/dev/ci/tests/apache2/setup +0 -4
- data/dev/ci/tests/binaries/Jenkinsfile +0 -105
- data/dev/ci/tests/binaries/build-linux +0 -38
- data/dev/ci/tests/binaries/build-macos +0 -40
- data/dev/ci/tests/binaries/prepare-macos +0 -38
- data/dev/ci/tests/binaries/test-linux +0 -45
- data/dev/ci/tests/binaries/test-macos +0 -38
- data/dev/ci/tests/cxx/run +0 -9
- data/dev/ci/tests/cxx/setup +0 -4
- data/dev/ci/tests/debian/Jenkinsfile +0 -89
- data/dev/ci/tests/debian/run +0 -60
- data/dev/ci/tests/nginx/run +0 -5
- data/dev/ci/tests/nginx/setup +0 -4
- data/dev/ci/tests/nginx-dynamic/run +0 -20
- data/dev/ci/tests/nginx-dynamic/setup +0 -4
- data/dev/ci/tests/nodejs/run +0 -4
- data/dev/ci/tests/nodejs/setup +0 -4
- data/dev/ci/tests/rpm/Jenkinsfile +0 -68
- data/dev/ci/tests/rpm/run +0 -63
- data/dev/ci/tests/ruby/run +0 -4
- data/dev/ci/tests/ruby/setup +0 -4
- data/dev/ci/tests/source-packaging/run +0 -4
- data/dev/ci/tests/source-packaging/setup +0 -4
- data/dev/ci/tests/standalone/run +0 -4
- data/dev/ci/tests/standalone/setup +0 -4
- data/dev/configkit-schemas/index.json +0 -1748
- data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
- data/dev/rack.test/config.ru +0 -5
- data/dev/rack.test/public/asset.txt +0 -1
- data/dev/vagrant/apache_default_site.conf +0 -35
- data/dev/vagrant/apache_passenger.conf +0 -5
- data/dev/vagrant/apache_passenger.load +0 -1
- data/dev/vagrant/apache_ports.conf +0 -24
- data/dev/vagrant/apache_rack_test.conf +0 -9
- data/dev/vagrant/bashrc +0 -23
- data/dev/vagrant/nginx.conf +0 -39
- data/dev/vagrant/nginx_rakefile +0 -33
- data/dev/vagrant/nginx_start +0 -32
- data/dev/vagrant/provision.sh +0 -117
- data/dev/vagrant/sudoers.conf +0 -5
- data/resources/templates/error_renderer/.editorconfig +0 -19
- data/src/cxx_supportlib/AppTypes.cpp +0 -109
- data/src/cxx_supportlib/vendor-modified/SmallVector.h +0 -653
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -33,13 +33,14 @@
|
|
33
33
|
#include <boost/thread.hpp>
|
34
34
|
#include <oxt/system_calls.hpp>
|
35
35
|
#include <string>
|
36
|
+
#include <algorithm>
|
36
37
|
#include <cerrno>
|
37
38
|
|
38
39
|
#include <ProcessManagement/Spawn.h>
|
39
40
|
#include <ProcessManagement/Utils.h>
|
40
41
|
#include <StaticString.h>
|
41
42
|
#include <Exceptions.h>
|
42
|
-
#include <
|
43
|
+
#include <IOTools/IOUtils.h>
|
43
44
|
|
44
45
|
namespace Passenger {
|
45
46
|
|
@@ -68,14 +69,14 @@ runCommand(const char **command, SubprocessInfo &info, bool wait, bool killSubpr
|
|
68
69
|
int e, waitStatus;
|
69
70
|
pid_t waitRet;
|
70
71
|
|
71
|
-
info.pid =
|
72
|
+
info.pid = syscalls::fork();
|
72
73
|
if (info.pid == 0) {
|
73
74
|
resetSignalHandlersAndMask();
|
74
75
|
disableMallocDebugging();
|
75
76
|
if (afterFork) {
|
76
77
|
afterFork();
|
77
78
|
}
|
78
|
-
closeAllFileDescriptors(2
|
79
|
+
closeAllFileDescriptors(2);
|
79
80
|
execvp(command[0], (char * const *) command);
|
80
81
|
if (onExecFail) {
|
81
82
|
onExecFail(command, errno);
|
@@ -110,7 +111,7 @@ runCommand(const char **command, SubprocessInfo &info, bool wait, bool killSubpr
|
|
110
111
|
|
111
112
|
void
|
112
113
|
runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
113
|
-
|
114
|
+
SubprocessOutput &output, size_t maxSize, bool killSubprocessOnInterruption,
|
114
115
|
const boost::function<void ()> &afterFork,
|
115
116
|
const boost::function<void (const char **command, int errcode)> &onExecFail)
|
116
117
|
{
|
@@ -120,7 +121,7 @@ runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
|
120
121
|
|
121
122
|
p = createPipe(__FILE__, __LINE__);
|
122
123
|
|
123
|
-
info.pid =
|
124
|
+
info.pid = syscalls::fork();
|
124
125
|
if (info.pid == 0) {
|
125
126
|
dup2(p[1], 1);
|
126
127
|
close(p[0]);
|
@@ -130,7 +131,7 @@ runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
|
130
131
|
if (afterFork) {
|
131
132
|
afterFork();
|
132
133
|
}
|
133
|
-
closeAllFileDescriptors(2
|
134
|
+
closeAllFileDescriptors(2);
|
134
135
|
execvp(command[0], (char * const *) command);
|
135
136
|
if (onExecFail) {
|
136
137
|
onExecFail(command, errno);
|
@@ -140,15 +141,17 @@ runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
|
140
141
|
e = errno;
|
141
142
|
throw SystemException("Cannot fork() a new process", e);
|
142
143
|
} else {
|
143
|
-
|
144
|
+
size_t totalRead = 0;
|
144
145
|
|
146
|
+
output.eof = false;
|
145
147
|
p[1].close();
|
146
|
-
while (
|
148
|
+
while (totalRead < maxSize) {
|
147
149
|
char buf[1024 * 4];
|
148
150
|
ssize_t ret;
|
149
151
|
|
150
152
|
try {
|
151
|
-
ret = syscalls::read(p[0], buf,
|
153
|
+
ret = syscalls::read(p[0], buf,
|
154
|
+
std::min<size_t>(sizeof(buf), maxSize - totalRead));
|
152
155
|
} catch (const boost::thread_interrupted &) {
|
153
156
|
if (killSubprocessOnInterruption) {
|
154
157
|
boost::this_thread::disable_syscall_interruption dsi;
|
@@ -166,9 +169,13 @@ runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
|
166
169
|
}
|
167
170
|
throw SystemException(string("Cannot read output from the '") +
|
168
171
|
command[0] + "' command", e);
|
172
|
+
} else if (ret == 0) {
|
173
|
+
output.eof = true;
|
174
|
+
break;
|
175
|
+
} else {
|
176
|
+
totalRead += ret;
|
177
|
+
output.data.append(buf, ret);
|
169
178
|
}
|
170
|
-
done = ret == 0;
|
171
|
-
output.append(buf, ret);
|
172
179
|
}
|
173
180
|
p[0].close();
|
174
181
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -67,6 +67,24 @@ struct SubprocessInfo {
|
|
67
67
|
{ }
|
68
68
|
};
|
69
69
|
|
70
|
+
struct SubprocessOutput {
|
71
|
+
/**
|
72
|
+
* The read subprocess output data.
|
73
|
+
*/
|
74
|
+
string data;
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Whether the entire file has been read. If false, then it
|
78
|
+
* means there is more data than specified through the `maxSize`
|
79
|
+
* parameter.
|
80
|
+
*/
|
81
|
+
bool eof;
|
82
|
+
|
83
|
+
SubprocessOutput()
|
84
|
+
: eof(false)
|
85
|
+
{ }
|
86
|
+
};
|
87
|
+
|
70
88
|
|
71
89
|
// See ProcessManagement/Utils.h for definition
|
72
90
|
void printExecError(const char **command, int errcode);
|
@@ -132,6 +150,7 @@ void runCommand(const char **command, SubprocessInfo &info,
|
|
132
150
|
*
|
133
151
|
* @param command The argument array to pass to execvp(). Must be null-terminated.
|
134
152
|
* @param info
|
153
|
+
* @param maxSize The maximum number of output bytes to read.
|
135
154
|
* @param killSubprocessOnInterruption Whether to automatically kill the subprocess
|
136
155
|
* when this function is interrupted.
|
137
156
|
* @param afterFork A function object to be called right after forking.
|
@@ -140,7 +159,7 @@ void runCommand(const char **command, SubprocessInfo &info,
|
|
140
159
|
* @throws boost::thread_interrupted
|
141
160
|
*/
|
142
161
|
void runCommandAndCaptureOutput(const char **command, SubprocessInfo &info,
|
143
|
-
|
162
|
+
SubprocessOutput &output, size_t maxSize, bool killSubprocessOnInterruption = true,
|
144
163
|
const boost::function<void ()> &afterFork = boost::function<void ()>(),
|
145
164
|
const boost::function<void (const char **command, int errcode)> &onExecFail = printExecError);
|
146
165
|
|
@@ -58,6 +58,16 @@ using namespace std;
|
|
58
58
|
* to grab a lock which was already locked. This means that on macOS
|
59
59
|
* we pretty much can never use regular fork() at all in a multithreaded
|
60
60
|
* environment.
|
61
|
+
*
|
62
|
+
* As of 2018 May 16 with macOS 10.13 High Sierra, it was confirmed that the
|
63
|
+
* use of asyncFork() can lead to the following messages to be printed
|
64
|
+
* if the child process allocates memory:
|
65
|
+
*
|
66
|
+
* malloc: *** mach_vm_map(size=1048576) failed (error code=268435459)
|
67
|
+
* malloc: *** error: can't allocate region securely
|
68
|
+
* malloc: *** set a breakpoint in malloc_error_break to debug
|
69
|
+
*
|
70
|
+
* See https://github.com/phusion/passenger/issues/1193#issuecomment-389503928
|
61
71
|
*/
|
62
72
|
pid_t asyncFork();
|
63
73
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -35,7 +35,7 @@
|
|
35
35
|
#include <LoggingKit/LoggingKit.h>
|
36
36
|
#include <StaticString.h>
|
37
37
|
#include <Exceptions.h>
|
38
|
-
#include <
|
38
|
+
#include <StrIntTools/StrIntUtils.h>
|
39
39
|
|
40
40
|
|
41
41
|
namespace Passenger {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -24,12 +24,12 @@
|
|
24
24
|
* THE SOFTWARE.
|
25
25
|
*/
|
26
26
|
|
27
|
-
#include <Crypto.h>
|
27
|
+
#include <SecurityKit/Crypto.h>
|
28
28
|
#include <modp_b64.h>
|
29
29
|
#include <LoggingKit/LoggingKit.h>
|
30
30
|
#include <string>
|
31
|
-
#include <
|
32
|
-
#include <
|
31
|
+
#include <SystemTools/SystemTime.h>
|
32
|
+
#include <StrIntTools/StrIntUtils.h>
|
33
33
|
|
34
34
|
#if BOOST_OS_MACOS
|
35
35
|
#else
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -23,8 +23,8 @@
|
|
23
23
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
24
|
* THE SOFTWARE.
|
25
25
|
*/
|
26
|
-
#ifndef
|
27
|
-
#define
|
26
|
+
#ifndef _PASSENGER_SECURITY_KIT_CRYPTO_H_
|
27
|
+
#define _PASSENGER_SECURITY_KIT_CRYPTO_H_
|
28
28
|
|
29
29
|
#include <boost/function.hpp>
|
30
30
|
#include <boost/thread.hpp>
|
@@ -152,4 +152,4 @@ public:
|
|
152
152
|
|
153
153
|
} // namespace Passenger
|
154
154
|
|
155
|
-
#endif /*
|
155
|
+
#endif /* _PASSENGER_SECURITYKIT_CRYPTO_H_ */
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -44,7 +44,7 @@
|
|
44
44
|
#include <Constants.h>
|
45
45
|
#include <LoggingKit/LoggingKit.h>
|
46
46
|
#include <Utils.h>
|
47
|
-
#include <
|
47
|
+
#include <IOTools/IOUtils.h>
|
48
48
|
|
49
49
|
namespace Passenger {
|
50
50
|
namespace ServerKit {
|
@@ -80,9 +80,13 @@ public:
|
|
80
80
|
|
81
81
|
explicit
|
82
82
|
ClientRef(BOOST_RV_REF(ClientRef) ref)
|
83
|
-
: client(ref.client)
|
83
|
+
: client(ref.client),
|
84
|
+
file(ref.file),
|
85
|
+
line(ref.line)
|
84
86
|
{
|
85
87
|
ref.client = NULL;
|
88
|
+
ref.file = NULL;
|
89
|
+
ref.line = 0;
|
86
90
|
}
|
87
91
|
|
88
92
|
~ClientRef() {
|
@@ -96,7 +100,7 @@ public:
|
|
96
100
|
}
|
97
101
|
|
98
102
|
ClientRef &operator=(BOOST_COPY_ASSIGN_REF(ClientRef) ref) {
|
99
|
-
if (
|
103
|
+
if (this != &ref) {
|
100
104
|
Client *oldClient = client;
|
101
105
|
const char *oldFile = file;
|
102
106
|
unsigned int oldLine = line;
|
@@ -114,11 +118,17 @@ public:
|
|
114
118
|
}
|
115
119
|
|
116
120
|
ClientRef &operator=(BOOST_RV_REF(ClientRef) ref) {
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
121
|
+
if (this != &ref) {
|
122
|
+
Client *oldClient = client;
|
123
|
+
client = ref.client;
|
124
|
+
file = ref.file;
|
125
|
+
line = ref.line;
|
126
|
+
ref.client = NULL;
|
127
|
+
ref.file = NULL;
|
128
|
+
ref.line = 0;
|
129
|
+
if (oldClient != NULL) {
|
130
|
+
getServer(oldClient)->_unrefClient(oldClient, file, line);
|
131
|
+
}
|
122
132
|
}
|
123
133
|
return *this;
|
124
134
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -36,7 +36,7 @@
|
|
36
36
|
#include <SafeLibev.h>
|
37
37
|
#include <Exceptions.h>
|
38
38
|
#include <Utils.h>
|
39
|
-
#include <
|
39
|
+
#include <JsonTools/JsonUtils.h>
|
40
40
|
|
41
41
|
extern "C" {
|
42
42
|
struct uv_loop_s;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -38,8 +38,8 @@
|
|
38
38
|
#include <DataStructures/LString.h>
|
39
39
|
#include <DataStructures/HashedStaticString.h>
|
40
40
|
#include <LoggingKit/LoggingKit.h>
|
41
|
-
#include <
|
42
|
-
#include <
|
41
|
+
#include <StrIntTools/StrIntUtils.h>
|
42
|
+
#include <Algorithms/Hasher.h>
|
43
43
|
|
44
44
|
namespace Passenger {
|
45
45
|
namespace ServerKit {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -27,7 +27,7 @@
|
|
27
27
|
#define _PASSENGER_SERVER_KIT_HTTP_HEADER_PARSER_STATE_H_
|
28
28
|
|
29
29
|
#include <DataStructures/LString.h>
|
30
|
-
#include <
|
30
|
+
#include <Algorithms/Hasher.h>
|
31
31
|
|
32
32
|
namespace Passenger {
|
33
33
|
namespace ServerKit {
|
@@ -80,9 +80,13 @@ public:
|
|
80
80
|
|
81
81
|
explicit
|
82
82
|
HttpRequestRef(BOOST_RV_REF(HttpRequestRef) ref)
|
83
|
-
: request(ref.request)
|
83
|
+
: request(ref.request),
|
84
|
+
file(ref.file),
|
85
|
+
line(ref.line)
|
84
86
|
{
|
85
87
|
ref.request = NULL;
|
88
|
+
ref.file = NULL;
|
89
|
+
ref.line = 0;
|
86
90
|
}
|
87
91
|
|
88
92
|
~HttpRequestRef() {
|
@@ -96,7 +100,7 @@ public:
|
|
96
100
|
}
|
97
101
|
|
98
102
|
HttpRequestRef &operator=(BOOST_COPY_ASSIGN_REF(HttpRequestRef) ref) {
|
99
|
-
if (
|
103
|
+
if (this != &ref) {
|
100
104
|
Request *oldRequest = request;
|
101
105
|
const char *oldFile = file;
|
102
106
|
unsigned int oldLine = line;
|
@@ -114,11 +118,17 @@ public:
|
|
114
118
|
}
|
115
119
|
|
116
120
|
HttpRequestRef &operator=(BOOST_RV_REF(HttpRequestRef) ref) {
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
121
|
+
if (this != &ref) {
|
122
|
+
Request *oldRequest = request;
|
123
|
+
request = ref.request;
|
124
|
+
file = ref.file;
|
125
|
+
line = ref.line;
|
126
|
+
ref.request = NULL;
|
127
|
+
ref.file = NULL;
|
128
|
+
ref.line = 0;
|
129
|
+
if (oldRequest != NULL) {
|
130
|
+
getServer(oldRequest)->_unrefRequest(oldRequest, file, line);
|
131
|
+
}
|
122
132
|
}
|
123
133
|
return *this;
|
124
134
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -44,11 +44,11 @@
|
|
44
44
|
#include <ServerKit/HttpChunkedBodyParser.h>
|
45
45
|
#include <Algorithms/MovingAverage.h>
|
46
46
|
#include <Integrations/LibevJsonUtils.h>
|
47
|
-
#include <
|
48
|
-
#include <
|
47
|
+
#include <SystemTools/SystemTime.h>
|
48
|
+
#include <StrIntTools/StrIntUtils.h>
|
49
49
|
#include <Utils/HttpConstants.h>
|
50
|
-
#include <
|
51
|
-
#include <
|
50
|
+
#include <Algorithms/Hasher.h>
|
51
|
+
#include <SystemTools/SystemTime.h>
|
52
52
|
|
53
53
|
namespace Passenger {
|
54
54
|
namespace ServerKit {
|
@@ -329,10 +329,8 @@ private:
|
|
329
329
|
SKC_TRACE(client, 3, "Parsing " << buffer.size() <<
|
330
330
|
" bytes of HTTP header: \"" << cEscapeString(StaticString(
|
331
331
|
buffer.start, buffer.size())) << "\"");
|
332
|
-
|
333
|
-
|
334
|
-
feed(buffer);
|
335
|
-
}
|
332
|
+
ret = createRequestHeaderParser(this->getContext(), req).
|
333
|
+
feed(buffer);
|
336
334
|
if (req->httpState == Request::PARSING_HEADERS) {
|
337
335
|
// Not yet done parsing.
|
338
336
|
return Channel::Result(buffer.size(), false);
|
@@ -417,6 +415,9 @@ private:
|
|
417
415
|
assert(maxRemaining > 0);
|
418
416
|
remaining = std::min<boost::uint64_t>(buffer.size(), maxRemaining);
|
419
417
|
req->bodyAlreadyRead += remaining;
|
418
|
+
SKC_TRACE(client, 3, "Event comes with " << buffer.size() <<
|
419
|
+
" bytes of fixed-length HTTP request body: \"" << cEscapeString(StaticString(
|
420
|
+
buffer.start, buffer.size())) << "\"");
|
420
421
|
SKC_TRACE(client, 3, "Request body: " <<
|
421
422
|
req->bodyAlreadyRead << " of " <<
|
422
423
|
req->aux.bodyInfo.contentLength << " bytes already read");
|
@@ -474,6 +475,9 @@ private:
|
|
474
475
|
}
|
475
476
|
}
|
476
477
|
|
478
|
+
SKC_TRACE(client, 3, "Event comes with " << buffer.size() <<
|
479
|
+
" bytes of chunked HTTP request body: \"" << cEscapeString(StaticString(
|
480
|
+
buffer.start, buffer.size())) << "\"");
|
477
481
|
HttpChunkedEvent event(createChunkedBodyParser(req).feed(buffer));
|
478
482
|
req->bodyAlreadyRead += event.consumed;
|
479
483
|
|
@@ -512,7 +516,6 @@ private:
|
|
512
516
|
return Channel::Result(event.consumed, false);
|
513
517
|
case HttpChunkedEvent::ERROR:
|
514
518
|
assert(event.end);
|
515
|
-
P_ASSERT_EQ(event.consumed, 0);
|
516
519
|
client->input.stop();
|
517
520
|
req->wantKeepAlive = false;
|
518
521
|
req->bodyChannel.feedError(event.errcode);
|
@@ -553,6 +556,9 @@ private:
|
|
553
556
|
}
|
554
557
|
}
|
555
558
|
|
559
|
+
SKC_TRACE(client, 3, "Event comes with " << buffer.size() <<
|
560
|
+
" bytes of upgraded HTTP request body: \"" << cEscapeString(StaticString(
|
561
|
+
buffer.start, buffer.size())) << "\"");
|
556
562
|
req->bodyAlreadyRead += buffer.size();
|
557
563
|
req->bodyChannel.feed(buffer);
|
558
564
|
if (!req->ended()) {
|
@@ -54,7 +54,6 @@
|
|
54
54
|
#include <pthread.h>
|
55
55
|
#include <cstdio>
|
56
56
|
#include <jsoncpp/json.h>
|
57
|
-
#include <SmallVector.h>
|
58
57
|
|
59
58
|
#include <LoggingKit/LoggingKit.h>
|
60
59
|
#include <SafeLibev.h>
|
@@ -68,9 +67,9 @@
|
|
68
67
|
#include <Algorithms/MovingAverage.h>
|
69
68
|
#include <Utils.h>
|
70
69
|
#include <Utils/ScopeGuard.h>
|
71
|
-
#include <
|
72
|
-
#include <
|
73
|
-
#include <
|
70
|
+
#include <StrIntTools/StrIntUtils.h>
|
71
|
+
#include <IOTools/IOUtils.h>
|
72
|
+
#include <SystemTools/SystemTime.h>
|
74
73
|
|
75
74
|
namespace Passenger {
|
76
75
|
namespace ServerKit {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -23,15 +23,15 @@
|
|
23
23
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
24
|
* THE SOFTWARE.
|
25
25
|
*/
|
26
|
-
#ifndef
|
27
|
-
#define
|
26
|
+
#ifndef _PASSENGER_STRINTTOOLS_DATE_PARSING_H_
|
27
|
+
#define _PASSENGER_STRINTTOOLS_DATE_PARSING_H_
|
28
28
|
|
29
29
|
#include <algorithm>
|
30
30
|
#include <time.h>
|
31
31
|
#include <cassert>
|
32
32
|
#include <cstring>
|
33
33
|
#include <StaticString.h>
|
34
|
-
#include <
|
34
|
+
#include <StrIntTools/StrIntUtils.h>
|
35
35
|
|
36
36
|
namespace Passenger {
|
37
37
|
|
@@ -404,4 +404,4 @@ parseImfFixdate_zone(const char **pos, const char *end, int &zone) {
|
|
404
404
|
|
405
405
|
} // namespace Passenger
|
406
406
|
|
407
|
-
#endif /*
|
407
|
+
#endif /* _PASSENGER_STRINTTOOLS_DATE_PARSING_H_ */
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2010-
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -33,8 +33,8 @@
|
|
33
33
|
#include <utf8.h>
|
34
34
|
#include <algorithm>
|
35
35
|
#include <Exceptions.h>
|
36
|
-
#include <
|
37
|
-
#include <
|
36
|
+
#include <SystemTools/SystemTime.h>
|
37
|
+
#include <StrIntTools/StrIntUtils.h>
|
38
38
|
|
39
39
|
namespace Passenger {
|
40
40
|
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2014-
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -27,7 +27,7 @@
|
|
27
27
|
#include <boost/cstdint.hpp>
|
28
28
|
#include <cstddef>
|
29
29
|
#include <oxt/macros.hpp>
|
30
|
-
#include <
|
30
|
+
#include <StrIntTools/StrIntUtils.h>
|
31
31
|
|
32
32
|
namespace Passenger {
|
33
33
|
|
@@ -135,13 +135,13 @@ convertLowerCase(const unsigned char * restrict data,
|
|
135
135
|
i = imax * 8;
|
136
136
|
output = (unsigned char *) d;
|
137
137
|
switch (leftover) {
|
138
|
-
case 7: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
139
|
-
case 6: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
140
|
-
case 5: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
141
|
-
case 4: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
142
|
-
case 3: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
143
|
-
case 2: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
144
|
-
case 1: *output++ = (unsigned char) gsToLowerMap[ustr[i]];
|
138
|
+
case 7: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
139
|
+
case 6: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
140
|
+
case 5: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
141
|
+
case 4: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
142
|
+
case 3: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
143
|
+
case 2: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
144
|
+
case 1: *output++ = (unsigned char) gsToLowerMap[ustr[i]]; /* Falls through. */
|
145
145
|
case 0: break;
|
146
146
|
}
|
147
147
|
#elif defined(__x86__)
|
@@ -167,9 +167,9 @@ convertLowerCase(const unsigned char * restrict data,
|
|
167
167
|
i = imax * 4;
|
168
168
|
output = (unsigned char *) d;
|
169
169
|
switch (leftover) {
|
170
|
-
case 3: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
171
|
-
case 2: *output++ = (unsigned char) gsToLowerMap[ustr[i++]];
|
172
|
-
case 1: *output++ = (unsigned char) gsToLowerMap[ustr[i]];
|
170
|
+
case 3: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
171
|
+
case 2: *output++ = (unsigned char) gsToLowerMap[ustr[i++]]; /* Falls through. */
|
172
|
+
case 1: *output++ = (unsigned char) gsToLowerMap[ustr[i]]; /* Falls through. */
|
173
173
|
case 0: break;
|
174
174
|
}
|
175
175
|
#else
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2013-
|
3
|
+
* Copyright (c) 2013-2018 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -23,14 +23,14 @@
|
|
23
23
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
24
|
* THE SOFTWARE.
|
25
25
|
*/
|
26
|
-
#ifndef
|
27
|
-
#define
|
26
|
+
#ifndef _PASSENGER_STR_INT_TOOLS_STRING_SCANNING_H_
|
27
|
+
#define _PASSENGER_STR_INT_TOOLS_STRING_SCANNING_H_
|
28
28
|
|
29
29
|
#include <cstring>
|
30
30
|
#include <cstdlib>
|
31
31
|
#include <string>
|
32
32
|
#include <StaticString.h>
|
33
|
-
#include <
|
33
|
+
#include <StrIntTools/StrIntUtils.h>
|
34
34
|
|
35
35
|
|
36
36
|
/**
|
@@ -269,4 +269,4 @@ readNextSentence(const char **data, char terminator) {
|
|
269
269
|
|
270
270
|
} // namespace Passenger
|
271
271
|
|
272
|
-
#endif /*
|
272
|
+
#endif /* _PASSENGER_STR_INT_TOOLS_TEMPLATE_H_ */
|