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.
@@ -26,6 +26,8 @@
26
26
  #ifndef _PASSENGER_AGENT_FUNDAMENTALS_ABORT_HANDLER_H_
27
27
  #define _PASSENGER_AGENT_FUNDAMENTALS_ABORT_HANDLER_H_
28
28
 
29
+ #include <cstddef>
30
+
29
31
  namespace Passenger {
30
32
  class ResourceLocator;
31
33
  }
@@ -36,7 +38,23 @@ namespace Fundamentals {
36
38
 
37
39
 
38
40
  struct AbortHandlerConfig {
39
- typedef void (*DiagnosticsDumper)(void *userData);
41
+ static const unsigned int MAX_DIAGNOSTICS_DUMPERS = 5;
42
+ typedef void (*DiagnosticsDumperFunc)(void *userData);
43
+
44
+ struct DiagnosticsDumper {
45
+ const char *name;
46
+ const char *logFileName;
47
+ DiagnosticsDumperFunc func;
48
+ void *userData;
49
+
50
+ DiagnosticsDumper()
51
+ : name(0),
52
+ logFileName(0),
53
+ func(0),
54
+ userData(0)
55
+ { }
56
+ };
57
+
40
58
 
41
59
  char *ruby;
42
60
  char **origArgv;
@@ -45,8 +63,17 @@ struct AbortHandlerConfig {
45
63
  bool beep;
46
64
  bool stopProcess;
47
65
  ResourceLocator *resourceLocator;
48
- DiagnosticsDumper diagnosticsDumper;
49
- void *diagnosticsDumperUserData;
66
+ DiagnosticsDumper diagnosticsDumpers[MAX_DIAGNOSTICS_DUMPERS];
67
+
68
+ AbortHandlerConfig()
69
+ : ruby(NULL),
70
+ origArgv(NULL),
71
+ randomSeed(0),
72
+ dumpWithCrashWatch(false),
73
+ beep(false),
74
+ stopProcess(false),
75
+ resourceLocator(NULL)
76
+ { }
50
77
  };
51
78
 
52
79
  void installAbortHandler(const AbortHandlerConfig *config);
@@ -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.
@@ -50,9 +50,9 @@
50
50
  #include <ResourceLocator.h>
51
51
  #include <LoggingKit/LoggingKit.h>
52
52
  #include <LoggingKit/Context.h>
53
- #include <Utils/StrIntUtils.h>
54
- #include <Utils/MessageIO.h>
55
- #include <Utils/SystemTime.h>
53
+ #include <StrIntTools/StrIntUtils.h>
54
+ #include <IOTools/MessageIO.h>
55
+ #include <SystemTools/SystemTime.h>
56
56
 
57
57
 
58
58
  namespace Passenger {
@@ -559,7 +559,6 @@ initializeAgent(int argc, char **argv[], const char *processName,
559
559
  const char *seedStr;
560
560
 
561
561
  context = new Context();
562
- memset(context, 0, sizeof(Context));
563
562
 
564
563
  seedStr = getEnvString("PASSENGER_RANDOM_SEED");
565
564
  if (seedStr == NULL) {
@@ -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.
@@ -47,6 +47,14 @@ struct Context {
47
47
  char **origArgv;
48
48
  bool feedbackFdAvailable;
49
49
  AbortHandlerConfig abortHandlerConfig;
50
+
51
+ Context()
52
+ : resourceLocator(NULL),
53
+ randomSeed(0),
54
+ origArgc(0),
55
+ origArgv(NULL),
56
+ feedbackFdAvailable(false)
57
+ { }
50
58
  };
51
59
 
52
60
  typedef void (*OptionParserFunc)(int argc, const char **argv, ConfigKit::Store &config);
@@ -64,7 +64,7 @@
64
64
  #include <FileTools/PathManip.h>
65
65
  #include <SystemTools/UserDatabase.h>
66
66
  #include <Utils.h>
67
- #include <Utils/StrIntUtils.h>
67
+ #include <StrIntTools/StrIntUtils.h>
68
68
  #include <Core/SpawningKit/Handshake/WorkDir.h>
69
69
  #include <Core/SpawningKit/Exceptions.h>
70
70
 
@@ -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.
@@ -28,9 +28,10 @@
28
28
  #include <unistd.h>
29
29
  #include <cstdio>
30
30
  #include <cstring>
31
+
32
+ #include <SystemTools/SystemMetricsCollector.h>
31
33
  #include <Utils.h>
32
- #include <Utils/StrIntUtils.h>
33
- #include <Utils/SystemMetricsCollector.h>
34
+ #include <StrIntTools/StrIntUtils.h>
34
35
 
35
36
  using namespace std;
36
37
  using namespace Passenger;
@@ -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.
@@ -361,7 +361,7 @@ touchDir(const char *dir) {
361
361
  }
362
362
  execlp("/bin/sh", "/bin/sh", "-c",
363
363
  "find \"$1\" | xargs touch", "/bin/sh", ".",
364
- (const char * const) 0);
364
+ (char *) 0);
365
365
  e = errno;
366
366
  fprintf(stderr, ERROR_PREFIX ": cannot execute /bin/sh: %s (errno %d)\n",
367
367
  strerror(e), e);
@@ -432,7 +432,7 @@ performCleanup(const char *dir) {
432
432
  close(terminationPipe[1]);
433
433
  execlp("/bin/sh", "/bin/sh", "-c",
434
434
  "rm -rf \"$1\"", "/bin/sh", dir,
435
- (const char * const) 0);
435
+ (char *) 0);
436
436
  e = errno;
437
437
  fprintf(stderr, ERROR_PREFIX ": cannot execute /bin/sh: %s (errno %d)\n",
438
438
  strerror(e), e);
@@ -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.
@@ -40,8 +40,8 @@
40
40
  #include <StaticString.h>
41
41
  #include <LoggingKit/LoggingKit.h>
42
42
  #include <Constants.h>
43
- #include <Utils/StrIntUtils.h>
44
- #include <Utils/MessageIO.h>
43
+ #include <StrIntTools/StrIntUtils.h>
44
+ #include <IOTools/MessageIO.h>
45
45
 
46
46
  namespace Passenger {
47
47
  namespace Watchdog {
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2011-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2011-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,7 +33,7 @@
33
33
  #include <Watchdog/ApiServer.h>
34
34
  #include <Shared/ApiAccountUtils.h>
35
35
  #include <Utils.h>
36
- #include <Utils/StrIntUtils.h>
36
+ #include <StrIntTools/StrIntUtils.h>
37
37
 
38
38
  namespace Passenger {
39
39
  namespace Watchdog {
@@ -146,15 +146,27 @@ using namespace std;
146
146
  * security_update_checker_interval unsigned integer - default(86400)
147
147
  * security_update_checker_proxy_url string - -
148
148
  * security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
149
- * server_software string - default("Phusion_Passenger/5.3.4")
149
+ * server_software string - default("Phusion_Passenger/6.0.1")
150
150
  * setsid boolean - default(false)
151
151
  * show_version_in_header boolean - default(true)
152
152
  * single_app_mode_app_root string - default,read_only
153
+ * single_app_mode_app_start_command string - read_only
153
154
  * single_app_mode_app_type string - read_only
154
155
  * single_app_mode_startup_file string - read_only
155
156
  * standalone_engine string - default
156
157
  * startup_report_file string - -
157
158
  * stat_throttle_rate unsigned integer - default(10)
159
+ * telemetry_collector_ca_certificate_path string - -
160
+ * telemetry_collector_debug_curl boolean - default(false)
161
+ * telemetry_collector_disabled boolean - default(false)
162
+ * telemetry_collector_final_run_timeout unsigned integer - default(5)
163
+ * telemetry_collector_first_interval unsigned integer - default(7200)
164
+ * telemetry_collector_interval unsigned integer - default(21600)
165
+ * telemetry_collector_interval_jitter unsigned integer - default(7200)
166
+ * telemetry_collector_proxy_url string - -
167
+ * telemetry_collector_timeout unsigned integer - default(180)
168
+ * telemetry_collector_url string - default("https://anontelemetry.phusionpassenger.com/v1/collect.json")
169
+ * telemetry_collector_verify_server boolean - default(true)
158
170
  * turbocaching boolean - default(true),read_only
159
171
  * user string - default,read_only
160
172
  * user_switching boolean - default(true)
@@ -253,9 +265,13 @@ private:
253
265
  }
254
266
 
255
267
  public:
256
- struct {
268
+ struct CoreSubschemaContainer {
257
269
  Core::Schema schema;
258
270
  ConfigKit::TableTranslator translator;
271
+
272
+ CoreSubschemaContainer(const WrapperRegistry::Registry *wrapperRegistry)
273
+ : schema(wrapperRegistry)
274
+ { }
259
275
  } core;
260
276
  struct {
261
277
  ApiServer::Schema schema;
@@ -266,7 +282,9 @@ public:
266
282
  ConfigKit::PrefixTranslator translator;
267
283
  } apiServerKit;
268
284
 
269
- Schema() {
285
+ Schema(const WrapperRegistry::Registry *wrapperRegistry = NULL)
286
+ : core(wrapperRegistry)
287
+ {
270
288
  using namespace ConfigKit;
271
289
 
272
290
  // Add subschema: core
@@ -279,6 +297,7 @@ public:
279
297
  core.translator.finalize();
280
298
  addSubSchema(core.schema, core.translator);
281
299
  erase("instance_dir");
300
+ erase("oom_score");
282
301
  erase("watchdog_fd_passing_password");
283
302
  /***********/
284
303
  /***********/
@@ -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.
@@ -25,7 +25,7 @@
25
25
  */
26
26
 
27
27
  #include <Shared/Fundamentals/Utils.h>
28
- #include <Utils/MessageIO.h>
28
+ #include <IOTools/MessageIO.h>
29
29
 
30
30
  class CoreWatcher: public AgentWatcher {
31
31
  protected:
@@ -73,18 +73,19 @@
73
73
  #include <FileDescriptor.h>
74
74
  #include <FileTools/PathSecurityCheck.h>
75
75
  #include <SystemTools/UserDatabase.h>
76
+ #include <SystemTools/ContainerHelpers.h>
76
77
  #include <RandomGenerator.h>
77
78
  #include <BackgroundEventLoop.h>
78
79
  #include <LoggingKit/LoggingKit.h>
79
80
  #include <Exceptions.h>
80
81
  #include <StaticString.h>
81
82
  #include <Hooks.h>
83
+ #include <IOTools/IOUtils.h>
84
+ #include <IOTools/MessageIO.h>
82
85
  #include <Utils.h>
83
86
  #include <Utils/Timer.h>
84
87
  #include <Utils/ScopeGuard.h>
85
- #include <Utils/StrIntUtils.h>
86
- #include <Utils/IOUtils.h>
87
- #include <Utils/MessageIO.h>
88
+ #include <StrIntTools/StrIntUtils.h>
88
89
  #include <Utils/OptionParsing.h>
89
90
  #include <Utils/VariantMap.h>
90
91
 
@@ -165,6 +166,7 @@ namespace Watchdog {
165
166
 
166
167
  using namespace Passenger::Watchdog;
167
168
 
169
+ static WrapperRegistry::Registry *watchdogWrapperRegistry;
168
170
  static Schema *watchdogSchema;
169
171
  static ConfigKit::Store *watchdogConfig;
170
172
  static WorkingObjects *workingObjects;
@@ -179,8 +181,22 @@ static void cleanup(const WorkingObjectsPtr &wo);
179
181
  /***** Functions *****/
180
182
 
181
183
  #if !BOOST_OS_MACOS
184
+
185
+ struct WatchdogOomAdjustResult {
186
+ struct Message {
187
+ LoggingKit::Level level;
188
+ string text;
189
+ };
190
+
191
+ string oldScore;
192
+ // LoggingKit has not been initialized yet when setOomScoreNeverKill()
193
+ // is called, so we store the messages here and print them after
194
+ // LoggingKit initialization.
195
+ vector<Message> messages;
196
+ };
197
+
182
198
  static FILE *
183
- openOomAdjFileGetType(const char *mode, OomFileType &type) {
199
+ openOomAdjFileGetType(const char *mode, OomFileType &type, string &path) {
184
200
  FILE *f = fopen("/proc/self/oom_score_adj", mode);
185
201
  if (f == NULL) {
186
202
  f = fopen("/proc/self/oom_adj", mode);
@@ -188,40 +204,46 @@ openOomAdjFileGetType(const char *mode, OomFileType &type) {
188
204
  return NULL;
189
205
  } else {
190
206
  type = OOM_ADJ;
207
+ path = "/proc/self/oom_adj";
191
208
  return f;
192
209
  }
193
210
  } else {
194
211
  type = OOM_SCORE_ADJ;
212
+ path = "/proc/self/oom_score_adj";
195
213
  return f;
196
214
  }
197
215
  }
198
216
 
199
- static FILE *
200
- openOomAdjFileForcedType(const char *mode, OomFileType &type) {
201
- if (type == OOM_SCORE_ADJ) {
202
- return fopen("/proc/self/oom_score_adj", mode);
203
- } else {
204
- assert(type == OOM_ADJ);
205
- return fopen("/proc/self/oom_adj", mode);
206
- }
207
- }
208
-
209
217
  /**
210
218
  * Set the current process's OOM score to "never kill".
211
219
  */
212
- static string
220
+ static WatchdogOomAdjustResult
213
221
  setOomScoreNeverKill() {
214
- string oldScore;
222
+ WatchdogOomAdjustResult result;
215
223
  FILE *f;
224
+ string path;
216
225
  OomFileType type;
226
+ int e;
227
+
228
+ if (geteuid() != 0) {
229
+ WatchdogOomAdjustResult::Message msg;
230
+ msg.level = LoggingKit::DEBUG;
231
+ msg.text = "Not adjusting Watchdog's OOM score because not running with root privileges";
232
+ result.messages.push_back(msg);
233
+ return result;
234
+ }
217
235
 
218
- f = openOomAdjFileGetType("r", type);
236
+ f = openOomAdjFileGetType("r", type, path);
219
237
  if (f == NULL) {
220
- return "";
238
+ e = errno;
239
+ P_ERROR("Error adjusting Watchdog's OOM score: error opening both"
240
+ " /proc/self/oom_score_adj and /proc/self/oom_adj for reading: " <<
241
+ strerror(e) << " (errno=" << e << ")");
242
+ return result;
221
243
  }
222
244
  // mark if this is a legacy score so we won't try to write it as OOM_SCORE_ADJ
223
245
  if (type == OOM_ADJ) {
224
- oldScore.append("l");
246
+ result.oldScore.append("l");
225
247
  }
226
248
  char buf[1024];
227
249
  size_t bytesRead;
@@ -230,17 +252,27 @@ setOomScoreNeverKill() {
230
252
  if (bytesRead == 0 && feof(f)) {
231
253
  break;
232
254
  } else if (bytesRead == 0 && ferror(f)) {
255
+ P_ERROR("Error adjusting Watchdog's OOM score: error reading " << path);
233
256
  fclose(f);
234
- return "";
257
+ result.oldScore.clear();
258
+ return result;
235
259
  } else {
236
- oldScore.append(buf, bytesRead);
260
+ result.oldScore.append(buf, bytesRead);
237
261
  }
238
262
  }
239
263
  fclose(f);
240
264
 
241
- f = openOomAdjFileForcedType("w", type);
265
+ f = fopen(path.c_str(), "w");
242
266
  if (f == NULL) {
243
- return "";
267
+ e = errno;
268
+ WatchdogOomAdjustResult::Message msg;
269
+ msg.level = LoggingKit::ERROR;
270
+ msg.text = "Error adjusting Watchdog's OOM score: error opening "
271
+ + path + " for writing: " + strerror(e) + " (errno="
272
+ + toString(e) + ")";
273
+ result.messages.push_back(msg);
274
+ result.oldScore.clear();
275
+ return result;
244
276
  }
245
277
  if (type == OOM_SCORE_ADJ) {
246
278
  fprintf(f, "-1000\n");
@@ -248,10 +280,44 @@ setOomScoreNeverKill() {
248
280
  assert(type == OOM_ADJ);
249
281
  fprintf(f, "-17\n");
250
282
  }
251
- fclose(f);
252
283
 
253
- return oldScore;
284
+ e = fflush(f);
285
+ if (e != 0) {
286
+ e = errno;
287
+ WatchdogOomAdjustResult::Message msg;
288
+ if (autoDetectInContainer()) {
289
+ msg.level = LoggingKit::INFO;
290
+ msg.text = "Running in container, so couldn't adjust Watchdog's"
291
+ " OOM score through " + path;
292
+ } else {
293
+ msg.level = LoggingKit::ERROR;
294
+ msg.text = "Error adjusting Watchdog's OOM score: error writing to "
295
+ + path + ": " + strerror(e) + " (errno=" + toString(e) + ")";
296
+ }
297
+ result.messages.push_back(msg);
298
+ }
299
+ e = fclose(f);
300
+ if (e == EOF) {
301
+ e = errno;
302
+ WatchdogOomAdjustResult::Message msg;
303
+ msg.level = LoggingKit::ERROR;
304
+ msg.text = "Error adjusting Watchdog's OOM score: error closing "
305
+ + path + ": " + strerror(e) + " (errno=" + toString(e) + ")";
306
+ result.messages.push_back(msg);
307
+ }
308
+
309
+ return result;
310
+ }
311
+
312
+ static void
313
+ printOomAdjustResultMessages(const WatchdogOomAdjustResult &result) {
314
+ vector<WatchdogOomAdjustResult::Message>::const_iterator it;
315
+
316
+ for (it = result.messages.begin(); it != result.messages.end(); it++) {
317
+ P_LOG(LoggingKit::context, it->level, __FILE__, __LINE__, it->text);
318
+ }
254
319
  }
320
+
255
321
  #endif
256
322
 
257
323
  static void
@@ -797,10 +863,12 @@ initializeBareEssentials(int argc, char *argv[], WorkingObjectsPtr &wo) {
797
863
  * so we need to restore it after each fork().
798
864
  */
799
865
  #if !BOOST_OS_MACOS
800
- string oldOomScore = setOomScoreNeverKill();
866
+ WatchdogOomAdjustResult oomAdjustResult = setOomScoreNeverKill();
801
867
  #endif
802
868
 
803
- watchdogSchema = new Schema();
869
+ watchdogWrapperRegistry = new WrapperRegistry::Registry();
870
+ watchdogWrapperRegistry->finalize();
871
+ watchdogSchema = new Schema(watchdogWrapperRegistry);
804
872
  watchdogConfig = new ConfigKit::Store(*watchdogSchema);
805
873
  initializeAgent(argc, &argv, SHORT_PROGRAM_NAME " watchdog",
806
874
  *watchdogConfig, watchdogSchema->core.schema.loggingKit.translator,
@@ -812,7 +880,8 @@ initializeBareEssentials(int argc, char *argv[], WorkingObjectsPtr &wo) {
812
880
  wo = boost::make_shared<WorkingObjects>();
813
881
  workingObjects = wo.get();
814
882
  #if !BOOST_OS_MACOS
815
- wo->extraConfigToPassToSubAgents["oom_score"] = oldOomScore;
883
+ printOomAdjustResultMessages(oomAdjustResult);
884
+ wo->extraConfigToPassToSubAgents["oom_score"] = oomAdjustResult.oldScore;
816
885
  #endif
817
886
  }
818
887
 
@@ -40,12 +40,6 @@
40
40
  #include <ap_config.h>
41
41
  #undef AP_HAVE_DESIGNATED_INITIALIZER
42
42
 
43
- #include "Config.h"
44
- #include "ConfigGeneral/SetterFuncs.h"
45
- #include "ConfigGeneral/ManifestGeneration.h"
46
- #include "DirConfig/AutoGeneratedCreateFunction.cpp"
47
- #include "DirConfig/AutoGeneratedMergeFunction.cpp"
48
- #include "Utils.h"
49
43
  #include <JsonTools/Autocast.h>
50
44
  #include <SystemTools/UserDatabase.h>
51
45
  #include <Utils.h>
@@ -56,9 +50,17 @@
56
50
  #include <apr_strings.h>
57
51
  // In Apache < 2.4, this macro was necessary for core_dir_config and other structs
58
52
  #define CORE_PRIVATE
59
- #include <http_core.h>
53
+ #include <httpd.h>
60
54
  #include <http_config.h>
61
55
  #include <http_log.h>
56
+ #include <http_core.h>
57
+
58
+ #include "Config.h"
59
+ #include "ConfigGeneral/SetterFuncs.h"
60
+ #include "ConfigGeneral/ManifestGeneration.h"
61
+ #include "DirConfig/AutoGeneratedCreateFunction.cpp"
62
+ #include "DirConfig/AutoGeneratedMergeFunction.cpp"
63
+ #include "Utils.h"
62
64
 
63
65
 
64
66
  extern "C" module AP_MODULE_DECLARE_DATA passenger_module;
@@ -72,6 +74,9 @@ extern "C" module AP_MODULE_DECLARE_DATA passenger_module;
72
74
  #endif
73
75
 
74
76
 
77
+ #include "ConfigGeneral/AutoGeneratedSetterFuncs.cpp"
78
+
79
+
75
80
  namespace Passenger {
76
81
  namespace Apache2Module {
77
82
 
@@ -174,8 +179,6 @@ postprocessConfig(server_rec *s, apr_pool_t *pool, apr_pool_t *temp_pool) {
174
179
  * Passenger settings
175
180
  *************************************************/
176
181
 
177
- #include "ConfigGeneral/AutoGeneratedSetterFuncs.cpp"
178
-
179
182
  static const char *
180
183
  cmd_passenger_enterprise_only(cmd_parms *cmd, void *pcfg, const char *arg) {
181
184
  return "this feature is only available in Phusion Passenger Enterprise. "
@@ -246,11 +249,8 @@ cmd_passenger_base_uri(cmd_parms *cmd, void *pcfg, const char *arg) {
246
249
  }
247
250
  }
248
251
 
249
- extern "C" const command_rec passenger_commands[] = {
250
- #include "ConfigGeneral/AutoGeneratedDefinitions.cpp"
251
- { NULL }
252
- };
253
-
254
252
 
255
253
  } // namespace Apache2Module
256
254
  } // namespace Passenger
255
+
256
+ #include "ConfigGeneral/AutoGeneratedDefinitions.cpp"
@@ -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.
@@ -40,28 +40,22 @@
40
40
  #include <apr_pools.h>
41
41
  #include <apr_strings.h>
42
42
 
43
+ #include "ConfigGeneral/Common.h"
44
+ #include "DirConfig/AutoGeneratedStruct.h"
45
+ #include "ServerConfig/AutoGeneratedStruct.h"
46
+
43
47
  namespace Passenger {
44
48
  namespace Apache2Module {
45
49
 
46
50
  using namespace std;
47
51
 
48
52
 
49
- enum Threeway {
50
- UNSET = -1,
51
- DISABLED = 0,
52
- ENABLED = 1
53
- };
54
-
55
- #define UNSET_INT_VALUE INT_MIN
56
-
57
53
  /**
58
- * Per-directory configuration information.
54
+ * Per-directory configuration information (manually-written part).
59
55
  *
60
56
  * Use the getter methods to query information, because those will return
61
57
  * the default value if the value is not specified.
62
58
  */
63
- #include "DirConfig/AutoGeneratedStruct.h"
64
-
65
59
  struct DirConfig: public AutoGeneratedDirConfig {
66
60
 
67
61
  /*************************************/
@@ -72,14 +66,12 @@ struct DirConfig: public AutoGeneratedDirConfig {
72
66
 
73
67
 
74
68
  /**
75
- * Server-wide (global, not per-virtual host) configuration information.
69
+ * Server-wide (global, not per-virtual host) configuration information
70
+ * (manually written part).
76
71
  *
77
72
  * Use the getter methods to query information, because those will return
78
73
  * the default value if the value is not specified.
79
74
  */
80
-
81
- #include "ServerConfig/AutoGeneratedStruct.h"
82
-
83
75
  struct ServerConfig: public AutoGeneratedServerConfig {
84
76
  Json::Value manifest;
85
77