passenger 5.3.4 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +69 -0
  3. data/CONTRIBUTORS +1 -0
  4. data/README.md +2 -1
  5. data/Rakefile +0 -5
  6. data/build/agent.rb +6 -3
  7. data/build/cxx_tests.rb +28 -19
  8. data/build/integration_tests.rb +6 -2
  9. data/build/misc.rb +2 -1
  10. data/build/packaging.rb +2 -0
  11. data/build/support/cplusplus.rb +2 -2
  12. data/build/support/cxx_dependency_map.rb +2651 -2189
  13. data/dev/colorize-logs +272 -0
  14. data/dev/show-latest-crashlog-dir +27 -0
  15. data/resources/templates/standalone/http.erb +2 -0
  16. data/resources/templates/standalone/server.erb +1 -0
  17. data/src/agent/AgentMain.cpp +4 -0
  18. data/src/agent/Core/AdminPanelConnector.h +6 -6
  19. data/src/agent/Core/ApiServer.h +4 -4
  20. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
  21. data/src/agent/Core/ApplicationPool/Context.h +5 -1
  22. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +2 -2
  23. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +5 -0
  24. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +2 -1
  25. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +3 -3
  26. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  27. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +13 -20
  28. data/src/agent/Core/ApplicationPool/Group.h +4 -2
  29. data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
  30. data/src/agent/Core/ApplicationPool/Options.h +42 -38
  31. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +2 -1
  32. data/src/agent/Core/ApplicationPool/Pool.h +4 -4
  33. data/src/agent/Core/ApplicationPool/Process.h +13 -15
  34. data/src/agent/Core/ApplicationPool/Socket.h +5 -5
  35. data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
  36. data/src/agent/Core/Config.h +50 -10
  37. data/src/agent/Core/ConfigChange.cpp +13 -1
  38. data/src/agent/Core/Controller/Config.h +41 -17
  39. data/src/agent/Core/Controller/ForwardResponse.cpp +4 -0
  40. data/src/agent/Core/Controller/InitRequest.cpp +14 -8
  41. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +5 -0
  42. data/src/agent/Core/Controller/SendRequest.cpp +9 -9
  43. data/src/agent/Core/Controller/TurboCaching.h +2 -2
  44. data/src/agent/Core/Controller.h +7 -5
  45. data/src/agent/Core/CoreMain.cpp +204 -60
  46. data/src/agent/Core/OptionParser.h +20 -3
  47. data/src/agent/Core/ResponseCache.h +3 -3
  48. data/src/agent/Core/SecurityUpdateChecker.h +4 -2
  49. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  50. data/src/agent/Core/SpawningKit/Config.h +3 -2
  51. data/src/agent/Core/SpawningKit/Context.h +8 -2
  52. data/src/agent/Core/SpawningKit/DirectSpawner.h +4 -4
  53. data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
  54. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  55. data/src/agent/Core/SpawningKit/Exceptions.h +21 -14
  56. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  57. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  58. data/src/agent/Core/SpawningKit/Handshake/Perform.h +14 -2
  59. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
  60. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  61. data/src/agent/Core/SpawningKit/Journey.h +4 -5
  62. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  63. data/src/agent/Core/SpawningKit/README.md +34 -17
  64. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  65. data/src/agent/Core/SpawningKit/Result.h +20 -8
  66. data/src/agent/Core/SpawningKit/SmartSpawner.h +7 -7
  67. data/src/agent/Core/SpawningKit/Spawner.h +25 -8
  68. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +17 -7
  69. data/src/agent/Core/TelemetryCollector.h +681 -0
  70. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  71. data/src/agent/FileReadHelper/FileReadHelperMain.cpp +198 -0
  72. data/src/agent/README.md +1 -1
  73. data/src/agent/Shared/ApiAccountUtils.h +1 -1
  74. data/src/agent/Shared/ApiServerUtils.h +3 -3
  75. data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
  76. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +324 -98
  77. data/src/agent/Shared/Fundamentals/AbortHandler.h +31 -4
  78. data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -5
  79. data/src/agent/Shared/Fundamentals/Initialization.h +9 -1
  80. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  81. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
  82. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +3 -3
  83. data/src/agent/Watchdog/ApiServer.h +3 -3
  84. data/src/agent/Watchdog/Config.h +24 -5
  85. data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
  86. data/src/agent/Watchdog/WatchdogMain.cpp +97 -28
  87. data/src/apache2_module/Config.cpp +14 -14
  88. data/src/apache2_module/Config.h +8 -16
  89. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +510 -481
  90. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
  91. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
  92. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +69 -1
  93. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
  94. data/src/apache2_module/ConfigGeneral/Common.h +45 -0
  95. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +17 -1
  96. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
  97. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
  98. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
  99. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +19 -1
  100. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
  101. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -1
  102. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
  103. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +36 -1
  104. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
  105. data/src/apache2_module/DirectoryMapper.h +36 -37
  106. data/src/apache2_module/Hooks.cpp +27 -8
  107. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +20 -0
  108. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +48 -1
  109. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
  110. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
  111. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
  112. data/src/cxx_supportlib/AppLocalConfigFileUtils.h +148 -0
  113. data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +147 -0
  114. data/src/cxx_supportlib/AppTypeDetector/CBindings.h +75 -0
  115. data/src/cxx_supportlib/{AppTypes.h → AppTypeDetector/Detector.h} +92 -131
  116. data/src/cxx_supportlib/ConfigKit/README.md +90 -2
  117. data/src/cxx_supportlib/ConfigKit/Schema.h +60 -15
  118. data/src/cxx_supportlib/ConfigKit/Store.h +129 -5
  119. data/src/cxx_supportlib/Constants.h +1 -1
  120. data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
  121. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
  122. data/src/cxx_supportlib/DataStructures/LString.h +3 -3
  123. data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
  124. data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
  125. data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
  126. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  127. data/src/cxx_supportlib/Hooks.h +2 -2
  128. data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
  129. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +4 -3
  130. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
  131. data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
  132. data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
  133. data/src/cxx_supportlib/InstanceDirectory.h +4 -4
  134. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
  135. data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
  136. data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
  137. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
  138. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
  139. data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +3 -3
  140. data/src/cxx_supportlib/ProcessManagement/Ruby.h +7 -2
  141. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +19 -12
  142. data/src/cxx_supportlib/ProcessManagement/Spawn.h +21 -2
  143. data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
  144. data/src/cxx_supportlib/RandomGenerator.h +2 -2
  145. data/src/cxx_supportlib/ResourceLocator.h +1 -1
  146. data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
  147. data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
  148. data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
  149. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
  150. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  151. data/src/cxx_supportlib/ServerKit/ClientRef.h +17 -7
  152. data/src/cxx_supportlib/ServerKit/Context.h +2 -2
  153. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
  154. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
  155. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  156. data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +17 -7
  157. data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
  158. data/src/cxx_supportlib/ServerKit/Server.h +3 -4
  159. data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
  160. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
  161. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
  162. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +12 -12
  163. data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
  164. data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
  165. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +88 -0
  166. data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +15 -12
  167. data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
  168. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
  169. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
  170. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  171. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
  172. data/src/cxx_supportlib/Utils/Curl.h +2 -2
  173. data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
  174. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  175. data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
  176. data/src/cxx_supportlib/Utils/Timer.h +2 -2
  177. data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
  178. data/src/cxx_supportlib/Utils.cpp +2 -2
  179. data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
  180. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
  181. data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +85 -0
  182. data/src/cxx_supportlib/{Utils/MemoryBarrier.h → WrapperRegistry/CBindings.h} +30 -27
  183. data/src/cxx_supportlib/WrapperRegistry/Entry.h +112 -0
  184. data/src/cxx_supportlib/WrapperRegistry/README.md +37 -0
  185. data/src/cxx_supportlib/WrapperRegistry/Registry.h +309 -0
  186. data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
  187. data/src/helper-scripts/download_binaries/extconf.rb +6 -2
  188. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +32 -0
  189. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +12 -0
  190. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +36 -0
  191. data/src/nginx_module/Configuration.c +23 -3
  192. data/src/nginx_module/ContentHandler.c +331 -32
  193. data/src/nginx_module/ContentHandler.h +8 -3
  194. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +10 -0
  195. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +27 -0
  196. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +3 -0
  197. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +7 -0
  198. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +11 -0
  199. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +23 -0
  200. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +8 -0
  201. data/src/nginx_module/config +2 -1
  202. data/src/nginx_module/ngx_http_passenger_module.c +9 -3
  203. data/src/nginx_module/ngx_http_passenger_module.h +10 -3
  204. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +19 -0
  205. data/src/ruby_supportlib/phusion_passenger/common_library.rb +19 -16
  206. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
  207. data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +6 -2
  208. data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +6 -2
  209. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
  210. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
  211. data/src/ruby_supportlib/phusion_passenger/native_support.rb +7 -3
  212. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +29 -0
  213. data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
  214. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
  215. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
  216. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -0
  217. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +22 -2
  218. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -1
  219. data/src/ruby_supportlib/phusion_passenger.rb +7 -5
  220. data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
  221. metadata +40 -89
  222. data/.editorconfig +0 -134
  223. data/CODE_OF_CONDUCT.md +0 -52
  224. data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
  225. data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
  226. data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
  227. data/dev/ci/README.md +0 -134
  228. data/dev/ci/lib/functions.sh +0 -129
  229. data/dev/ci/lib/set-container-envvars.sh +0 -53
  230. data/dev/ci/lib/setup-container.sh +0 -46
  231. data/dev/ci/run-tests-natively +0 -24
  232. data/dev/ci/run-tests-with-docker +0 -42
  233. data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
  234. data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
  235. data/dev/ci/scripts/docker-entrypoint.sh +0 -17
  236. data/dev/ci/scripts/inituidgid +0 -17
  237. data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
  238. data/dev/ci/scripts/setup-host-natively.sh +0 -11
  239. data/dev/ci/setup-host +0 -56
  240. data/dev/ci/tests/apache2/run +0 -6
  241. data/dev/ci/tests/apache2/setup +0 -4
  242. data/dev/ci/tests/binaries/Jenkinsfile +0 -105
  243. data/dev/ci/tests/binaries/build-linux +0 -38
  244. data/dev/ci/tests/binaries/build-macos +0 -40
  245. data/dev/ci/tests/binaries/prepare-macos +0 -38
  246. data/dev/ci/tests/binaries/test-linux +0 -45
  247. data/dev/ci/tests/binaries/test-macos +0 -38
  248. data/dev/ci/tests/cxx/run +0 -9
  249. data/dev/ci/tests/cxx/setup +0 -4
  250. data/dev/ci/tests/debian/Jenkinsfile +0 -89
  251. data/dev/ci/tests/debian/run +0 -60
  252. data/dev/ci/tests/nginx/run +0 -5
  253. data/dev/ci/tests/nginx/setup +0 -4
  254. data/dev/ci/tests/nginx-dynamic/run +0 -20
  255. data/dev/ci/tests/nginx-dynamic/setup +0 -4
  256. data/dev/ci/tests/nodejs/run +0 -4
  257. data/dev/ci/tests/nodejs/setup +0 -4
  258. data/dev/ci/tests/rpm/Jenkinsfile +0 -68
  259. data/dev/ci/tests/rpm/run +0 -63
  260. data/dev/ci/tests/ruby/run +0 -4
  261. data/dev/ci/tests/ruby/setup +0 -4
  262. data/dev/ci/tests/source-packaging/run +0 -4
  263. data/dev/ci/tests/source-packaging/setup +0 -4
  264. data/dev/ci/tests/standalone/run +0 -4
  265. data/dev/ci/tests/standalone/setup +0 -4
  266. data/dev/configkit-schemas/index.json +0 -1748
  267. data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
  268. data/dev/rack.test/config.ru +0 -5
  269. data/dev/rack.test/public/asset.txt +0 -1
  270. data/dev/vagrant/apache_default_site.conf +0 -35
  271. data/dev/vagrant/apache_passenger.conf +0 -5
  272. data/dev/vagrant/apache_passenger.load +0 -1
  273. data/dev/vagrant/apache_ports.conf +0 -24
  274. data/dev/vagrant/apache_rack_test.conf +0 -9
  275. data/dev/vagrant/bashrc +0 -23
  276. data/dev/vagrant/nginx.conf +0 -39
  277. data/dev/vagrant/nginx_rakefile +0 -33
  278. data/dev/vagrant/nginx_start +0 -32
  279. data/dev/vagrant/provision.sh +0 -117
  280. data/dev/vagrant/sudoers.conf +0 -5
  281. data/resources/templates/error_renderer/.editorconfig +0 -19
  282. data/src/cxx_supportlib/AppTypes.cpp +0 -109
  283. 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-2017 Phusion Holding B.V.
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 <Utils/IOUtils.h>
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 = asyncFork();
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, true);
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
- string &output, bool killSubprocessOnInterruption,
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 = asyncFork();
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, true);
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
- bool done = false;
144
+ size_t totalRead = 0;
144
145
 
146
+ output.eof = false;
145
147
  p[1].close();
146
- while (!done) {
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, sizeof(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-2017 Phusion Holding B.V.
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
- string &output, bool killSubprocessOnInterruption = true,
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-2017 Phusion Holding B.V.
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 <Utils/StrIntUtils.h>
38
+ #include <StrIntTools/StrIntUtils.h>
39
39
 
40
40
 
41
41
  namespace Passenger {
@@ -170,7 +170,7 @@ public:
170
170
  return buildSystemDir;
171
171
  }
172
172
 
173
- string findSupportBinary(const string &name) {
173
+ string findSupportBinary(const string &name) const {
174
174
  string path = getSupportBinariesDir() + "/" + name;
175
175
  bool found;
176
176
  try {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2017 Phusion Holding B.V.
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 <Utils/SystemTime.h>
32
- #include <Utils/StrIntUtils.h>
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-2017 Phusion Holding B.V.
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 _PASSENGER_CRYPTO_H_
27
- #define _PASSENGER_CRYPTO_H_
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 /* _PASSENGER_CRYPTO_H_ */
155
+ #endif /* _PASSENGER_SECURITYKIT_CRYPTO_H_ */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
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 <Utils/IOUtils.h>
47
+ #include <IOTools/IOUtils.h>
48
48
 
49
49
  namespace Passenger {
50
50
  namespace ServerKit {
@@ -37,7 +37,7 @@
37
37
  #include <ServerKit/Hooks.h>
38
38
  #include <MemoryKit/mbuf.h>
39
39
  #include <LoggingKit/LoggingKit.h>
40
- #include <Utils/StrIntUtils.h>
40
+ #include <StrIntTools/StrIntUtils.h>
41
41
 
42
42
  namespace Passenger {
43
43
  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 (client == ref.client) {
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
- Client *oldClient = client;
118
- client = ref.client;
119
- ref.client = NULL;
120
- if (oldClient != NULL) {
121
- getServer(oldClient)->_unrefClient(oldClient, file, line);
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-2017 Phusion Holding B.V.
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 <Utils/JsonUtils.h>
39
+ #include <JsonTools/JsonUtils.h>
40
40
 
41
41
  extern "C" {
42
42
  struct uv_loop_s;
@@ -46,7 +46,7 @@
46
46
  #include <ServerKit/Config.h>
47
47
  #include <ServerKit/Errors.h>
48
48
  #include <ServerKit/Channel.h>
49
- #include <Utils/JsonUtils.h>
49
+ #include <JsonTools/JsonUtils.h>
50
50
 
51
51
  namespace Passenger {
52
52
  namespace ServerKit {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
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 <Utils/StrIntUtils.h>
42
- #include <Utils/Hasher.h>
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-2017 Phusion Holding B.V.
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 <Utils/Hasher.h>
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 (request == ref.request) {
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
- Request *oldRequest = request;
118
- request = ref.request;
119
- ref.request = NULL;
120
- if (oldRequest != NULL) {
121
- getServer(oldRequest)->_unrefRequest(oldRequest, file, line);
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-2017 Phusion Holding B.V.
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 <Utils/SystemTime.h>
48
- #include <Utils/StrIntUtils.h>
47
+ #include <SystemTools/SystemTime.h>
48
+ #include <StrIntTools/StrIntUtils.h>
49
49
  #include <Utils/HttpConstants.h>
50
- #include <Utils/Hasher.h>
51
- #include <Utils/SystemTime.h>
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
- ret = createRequestHeaderParser(this->getContext(), req).
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 <Utils/StrIntUtils.h>
72
- #include <Utils/IOUtils.h>
73
- #include <Utils/SystemTime.h>
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-2017 Phusion Holding B.V.
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 _PASSENGER_UTILS_DATE_PARSING_H_
27
- #define _PASSENGER_UTILS_DATE_PARSING_H_
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 <Utils/StrIntUtils.h>
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 /* _PASSENGER_UTILS_DATE_PARSING_H_ */
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-2017 Phusion Holding B.V.
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 <Utils/SystemTime.h>
37
- #include <Utils/StrIntUtils.h>
36
+ #include <SystemTools/SystemTime.h>
37
+ #include <StrIntTools/StrIntUtils.h>
38
38
 
39
39
  namespace Passenger {
40
40
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
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 <Utils/StrIntUtils.h>
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-2017 Phusion Holding B.V.
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 _PASSENGER_STRING_SCANNING_H_
27
- #define _PASSENGER_STRING_SCANNING_H_
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 <Utils/StrIntUtils.h>
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 /* _PASSENGER_STRING_SCANNING_H_ */
272
+ #endif /* _PASSENGER_STR_INT_TOOLS_TEMPLATE_H_ */