passenger 6.0.22 → 6.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +59 -1
  3. data/Rakefile +13 -2
  4. data/bin/passenger-install-apache2-module +5 -0
  5. data/bin/passenger-install-nginx-module +18 -2
  6. data/build/apache2.rb +1 -1
  7. data/build/basics.rb +10 -4
  8. data/build/cxx_tests.rb +18 -7
  9. data/build/support/cxx_dependency_map.rb +40 -6
  10. data/build/test_basics.rb +24 -13
  11. data/package.json +1 -1
  12. data/passenger.gemspec +4 -2
  13. data/resources/templates/standalone/server.erb +1 -0
  14. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +8 -0
  15. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +10 -2
  16. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +8 -0
  17. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +9 -0
  18. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +9 -0
  19. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +63 -50
  20. data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +19 -9
  21. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +8 -0
  22. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +9 -1
  23. data/src/agent/Core/ApplicationPool/Group/Verification.cpp +8 -0
  24. data/src/agent/Core/ApplicationPool/Group.h +15 -5
  25. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +5 -0
  26. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +5 -0
  27. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +5 -0
  28. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +5 -0
  29. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +5 -0
  30. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +5 -0
  31. data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +5 -0
  32. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +11 -4
  33. data/src/agent/Core/ApplicationPool/Pool.h +0 -2
  34. data/src/agent/Core/ApplicationPool/Process.h +22 -6
  35. data/src/agent/Core/ApplicationPool/Session.h +6 -1
  36. data/src/agent/Core/Config.h +8 -3
  37. data/src/agent/Core/Controller/CheckoutSession.cpp +24 -1
  38. data/src/agent/Core/Controller/Config.h +5 -1
  39. data/src/agent/Core/Controller.h +1 -0
  40. data/src/agent/Core/CoreMain.cpp +10 -17
  41. data/src/agent/Core/OptionParser.h +3 -0
  42. data/src/agent/Core/SpawningKit/ErrorRenderer.h +5 -0
  43. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -53
  44. data/src/agent/Core/SpawningKit/Handshake/Session.h +3 -0
  45. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +5 -2
  46. data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -2
  47. data/src/agent/Core/SpawningKit/Spawner.h +4 -0
  48. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +88 -9
  49. data/src/agent/Shared/Fundamentals/AbortHandler.h +2 -0
  50. data/src/agent/Shared/Fundamentals/Initialization.cpp +9 -3
  51. data/src/agent/Shared/Fundamentals/Initialization.h +3 -3
  52. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +6 -7
  53. data/src/agent/Watchdog/Config.h +2 -1
  54. data/src/agent/Watchdog/WatchdogMain.cpp +4 -7
  55. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +5 -0
  56. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +15 -0
  57. data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +5 -3
  58. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +5 -0
  59. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +3 -0
  60. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +13 -0
  61. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -0
  62. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +16 -0
  63. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +3 -0
  64. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +2 -1
  65. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +2 -1
  66. data/src/cxx_supportlib/Constants.h +1 -1
  67. data/src/cxx_supportlib/DataStructures/LString.h +4 -0
  68. data/src/cxx_supportlib/DataStructures/StringMap.h +0 -1
  69. data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
  70. data/src/cxx_supportlib/SafeLibev.h +1 -3
  71. data/src/cxx_supportlib/ServerKit/Hooks.h +2 -2
  72. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +0 -1
  73. data/src/cxx_supportlib/ServerKit/HttpServer.h +15 -10
  74. data/src/cxx_supportlib/ServerKit/Server.h +0 -6
  75. data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +2 -0
  76. data/src/cxx_supportlib/Utils/SpeedMeter.h +0 -3
  77. data/src/cxx_supportlib/oxt/implementation.cpp +11 -0
  78. data/src/cxx_supportlib/oxt/system_calls.cpp +10 -3
  79. data/src/cxx_supportlib/oxt/thread.hpp +1 -1
  80. data/src/cxx_supportlib/vendor-modified/boost/asio/as_tuple.hpp +35 -9
  81. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_immediate_executor.hpp +3 -2
  82. data/src/cxx_supportlib/vendor-modified/boost/asio/associator.hpp +1 -1
  83. data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +74 -68
  84. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +11 -11
  85. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
  86. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
  87. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +10 -10
  88. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +1 -1
  89. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +3 -3
  90. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +2 -2
  91. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +1 -1
  92. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +2 -2
  93. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +9 -9
  94. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
  95. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +6 -6
  96. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
  97. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +1 -1
  98. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +88 -22
  99. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +91 -22
  100. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +105 -23
  101. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_immediate_executor.hpp +90 -23
  102. data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +2 -2
  103. data/src/cxx_supportlib/vendor-modified/boost/asio/buffer_registration.hpp +1 -1
  104. data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_after.hpp +303 -0
  105. data/src/cxx_supportlib/vendor-modified/boost/asio/cancel_at.hpp +296 -0
  106. data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/impl/co_composed.hpp → co_composed.hpp} +208 -61
  107. data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +49 -0
  108. data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +10 -201
  109. data/src/cxx_supportlib/vendor-modified/boost/asio/composed.hpp +415 -0
  110. data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +214 -48
  111. data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +3 -4
  112. data/src/cxx_supportlib/vendor-modified/boost/asio/default_completion_token.hpp +91 -0
  113. data/src/cxx_supportlib/vendor-modified/boost/asio/deferred.hpp +9 -5
  114. data/src/cxx_supportlib/vendor-modified/boost/asio/detached.hpp +2 -2
  115. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +1 -1
  116. data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_message.hpp → detail/completion_message.hpp} +14 -16
  117. data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_payload.hpp → detail/completion_payload.hpp} +30 -32
  118. data/src/cxx_supportlib/vendor-modified/boost/asio/{experimental/detail/channel_handler.hpp → detail/completion_payload_handler.hpp} +15 -13
  119. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +26 -32
  120. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +5 -1
  121. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +14 -118
  122. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +36 -33
  123. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +1 -1
  124. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +7 -5
  125. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +6 -4
  126. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +44 -35
  127. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +1 -1
  128. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/initiation_base.hpp +64 -0
  129. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +0 -11
  130. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +20 -16
  131. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +0 -1
  132. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +4 -4
  133. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +23 -18
  134. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/recycling_allocator.hpp +9 -0
  135. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +1 -1
  136. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_query_op.hpp +1 -1
  137. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +11 -1
  138. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timed_cancel_op.hpp +363 -0
  139. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +29 -51
  140. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +1 -1
  141. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +1 -1
  142. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +1 -1
  143. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +1 -1
  144. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +1 -1
  145. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +1 -1
  146. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +1 -1
  147. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +1 -1
  148. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +2 -1
  149. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +2 -1
  150. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +2 -114
  151. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_receive_op.hpp +2 -3
  152. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_functions.hpp +27 -19
  153. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_send_op.hpp +0 -1
  154. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +17 -15
  155. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +2 -3
  156. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/impl/channel_service.hpp +4 -2
  157. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +3 -5
  158. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +12 -7
  159. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +1 -1
  160. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +38 -40
  161. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +3 -3
  162. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +5 -5
  163. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +1 -1
  164. data/src/cxx_supportlib/vendor-modified/boost/asio/immediate.hpp +144 -0
  165. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +14 -7
  166. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +45 -14
  167. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/awaitable.hpp +3 -3
  168. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_after.hpp +270 -0
  169. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/cancel_at.hpp +270 -0
  170. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +8 -0
  171. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +60 -166
  172. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +14 -7
  173. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/detached.hpp +2 -2
  174. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +14 -7
  175. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +26 -177
  176. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +16 -82
  177. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +13 -286
  178. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +55 -18
  179. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +1 -1
  180. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +26 -185
  181. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +16 -87
  182. data/src/cxx_supportlib/vendor-modified/boost/asio/io_context_strand.hpp +5 -5
  183. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +6 -6
  184. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +1 -1
  185. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +1 -1
  186. data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +12 -6
  187. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +1 -1
  188. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
  189. data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +127 -28
  190. data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +70 -20
  191. data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +114 -36
  192. data/src/cxx_supportlib/vendor-modified/boost/asio/redirect_error.hpp +43 -3
  193. data/src/cxx_supportlib/vendor-modified/boost/asio/registered_buffer.hpp +2 -2
  194. data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +0 -1
  195. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +2 -2
  196. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +10 -7
  197. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +5 -5
  198. data/src/cxx_supportlib/vendor-modified/boost/asio/this_coro.hpp +2 -2
  199. data/src/cxx_supportlib/vendor-modified/boost/asio/use_awaitable.hpp +2 -2
  200. data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +1 -1
  201. data/src/cxx_supportlib/vendor-modified/boost/asio/uses_executor.hpp +1 -1
  202. data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
  203. data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +147 -35
  204. data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +74 -22
  205. data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +6 -0
  206. data/src/cxx_supportlib/vendor-modified/boost/assert/source_location.hpp +4 -1
  207. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/futex.hpp +42 -11
  208. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +15 -37
  209. data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +8 -8
  210. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
  211. data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +151 -10
  212. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +11 -9
  213. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +611 -102
  214. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +1 -1
  215. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +47 -47
  216. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +25 -24
  217. data/src/cxx_supportlib/vendor-modified/boost/container/detail/allocation_type.hpp +7 -7
  218. data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_list.hpp +2 -2
  219. data/src/cxx_supportlib/vendor-modified/boost/container/detail/block_slist.hpp +2 -2
  220. data/src/cxx_supportlib/vendor-modified/boost/container/detail/construct_in_place.hpp +35 -1
  221. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +14 -14
  222. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +1 -1
  223. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +55 -23
  224. data/src/cxx_supportlib/vendor-modified/boost/container/detail/function_detector.hpp +1 -1
  225. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_container.hpp +2 -2
  226. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_contiguous_container.hpp +1 -1
  227. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_pair.hpp +4 -4
  228. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +8 -8
  229. data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +9 -9
  230. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +4 -4
  231. data/src/cxx_supportlib/vendor-modified/boost/container/detail/multiallocation_chain.hpp +96 -10
  232. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_alloc_holder.hpp +19 -4
  233. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +1 -1
  234. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +17 -17
  235. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common.hpp +1 -1
  236. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +2 -2
  237. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_resource.hpp +4 -4
  238. data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +86 -52
  239. data/src/cxx_supportlib/vendor-modified/boost/container/detail/version_type.hpp +4 -4
  240. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +12 -0
  241. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +145 -65
  242. data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +105 -22
  243. data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +2 -2
  244. data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +30 -22
  245. data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +19 -2
  246. data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +1 -1
  247. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +15 -8
  248. data/src/cxx_supportlib/vendor-modified/boost/container/node_handle.hpp +6 -5
  249. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +15 -15
  250. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +1 -1
  251. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -1
  252. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +3 -3
  253. data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +1 -1
  254. data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +2 -2
  255. data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +31 -24
  256. data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +45 -43
  257. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +45 -33
  258. data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +5 -7
  259. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +55 -47
  260. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +3 -3
  261. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +222 -73
  262. data/src/cxx_supportlib/vendor-modified/boost/core/detail/minstd_rand.hpp +58 -0
  263. data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +13 -13
  264. data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +53 -5
  265. data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +1 -0
  266. data/src/cxx_supportlib/vendor-modified/boost/core/pointer_in_range.hpp +49 -0
  267. data/src/cxx_supportlib/vendor-modified/boost/core/span.hpp +2 -0
  268. data/src/cxx_supportlib/vendor-modified/boost/core/type_name.hpp +7 -2
  269. data/src/cxx_supportlib/vendor-modified/boost/function/function_base.hpp +22 -34
  270. data/src/cxx_supportlib/vendor-modified/boost/function/function_template.hpp +141 -38
  271. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/algorithm.hpp +8 -8
  272. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hash.hpp +1 -1
  273. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/hook_traits.hpp +8 -6
  274. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_traits.hpp +18 -18
  275. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +22 -17
  276. data/src/cxx_supportlib/vendor-modified/boost/libs/random/src/random_device.cpp +3 -1
  277. data/src/cxx_supportlib/vendor-modified/boost/move/detail/config_begin.hpp +0 -1
  278. data/src/cxx_supportlib/vendor-modified/boost/move/detail/launder.hpp +53 -0
  279. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +9 -1
  280. data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +6 -1
  281. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  282. data/src/cxx_supportlib/vendor-modified/boost/mpl/aux_/integral_wrapper.hpp +2 -1
  283. data/src/cxx_supportlib/vendor-modified/boost/predef/version.h +1 -1
  284. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/requires_cxx11.hpp +1 -1
  285. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +4 -1
  286. data/src/cxx_supportlib/vendor-modified/boost/system/detail/generic_category_message.hpp +13 -1
  287. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +13 -1
  288. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map_fwd.hpp +15 -0
  289. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +13 -1
  290. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set_fwd.hpp +15 -0
  291. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +22 -6
  292. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +38 -10
  293. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +111 -2
  294. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/cumulative_stats.hpp +177 -0
  295. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +11 -1
  296. data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +33 -7
  297. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +12 -0
  298. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +15 -0
  299. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +12 -0
  300. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +14 -0
  301. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map_fwd.hpp +19 -0
  302. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +12 -0
  303. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map_fwd.hpp +15 -0
  304. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +12 -0
  305. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set_fwd.hpp +14 -0
  306. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set_fwd.hpp +17 -0
  307. data/src/cxx_supportlib/vendor-modified/boost/utility/detail/minstd_rand.hpp +1 -43
  308. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  309. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +8 -0
  310. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +12 -0
  311. data/src/nginx_module/Configuration.c +7 -2
  312. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +6 -0
  313. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +15 -0
  314. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +14 -0
  315. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +3 -0
  316. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +4 -0
  317. data/src/ruby_native_extension/passenger_native_support.c +1 -0
  318. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +5 -0
  319. data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +6 -2
  320. data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +10 -0
  321. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +12 -4
  322. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +5 -0
  323. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +32 -5
  324. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/gems.rb +10 -0
  325. data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +73 -0
  326. data/src/ruby_supportlib/phusion_passenger/rack_handler.rb +30 -56
  327. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +5 -0
  328. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +1 -0
  329. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +0 -4
  330. data/src/ruby_supportlib/phusion_passenger/utils/json.rb +7 -198
  331. data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +67 -0
  332. data/src/ruby_supportlib/phusion_passenger/utils.rb +5 -15
  333. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  334. metadata +39 -10
@@ -1,5 +1,6 @@
1
1
 
2
2
  // Copyright (C) 2022 Christian Mazakas
3
+ // Copyright (C) 2024 Braden Ganetsky
3
4
  // Distributed under the Boost Software License, Version 1.0. (See accompanying
4
5
  // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
 
@@ -15,6 +16,10 @@
15
16
  #include <functional>
16
17
  #include <memory>
17
18
 
19
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
20
+ #include <memory_resource>
21
+ #endif
22
+
18
23
  namespace boost {
19
24
  namespace unordered {
20
25
  template <class Key, class T, class Hash = boost::hash<Key>,
@@ -36,6 +41,16 @@ namespace boost {
36
41
  void swap(unordered_node_map<Key, T, Hash, KeyEqual, Allocator>& lhs,
37
42
  unordered_node_map<Key, T, Hash, KeyEqual, Allocator>& rhs)
38
43
  noexcept(noexcept(lhs.swap(rhs)));
44
+
45
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
46
+ namespace pmr {
47
+ template <class Key, class T, class Hash = boost::hash<Key>,
48
+ class KeyEqual = std::equal_to<Key> >
49
+ using unordered_node_map =
50
+ boost::unordered::unordered_node_map<Key, T, Hash, KeyEqual,
51
+ std::pmr::polymorphic_allocator<std::pair<const Key, T> > >;
52
+ } // namespace pmr
53
+ #endif
39
54
  } // namespace unordered
40
55
 
41
56
  using boost::unordered::unordered_node_map;
@@ -105,6 +105,10 @@ namespace boost {
105
105
  using insert_return_type =
106
106
  detail::foa::insert_return_type<iterator, node_type>;
107
107
 
108
+ #if defined(BOOST_UNORDERED_ENABLE_STATS)
109
+ using stats = typename table_type::stats;
110
+ #endif
111
+
108
112
  unordered_node_set() : unordered_node_set(0) {}
109
113
 
110
114
  explicit unordered_node_set(size_type n, hasher const& h = hasher(),
@@ -563,6 +567,14 @@ namespace boost {
563
567
 
564
568
  void reserve(size_type n) { table_.reserve(n); }
565
569
 
570
+ #if defined(BOOST_UNORDERED_ENABLE_STATS)
571
+ /// Stats
572
+ ///
573
+ stats get_stats() const { return table_.get_stats(); }
574
+
575
+ void reset_stats() noexcept { table_.reset_stats(); }
576
+ #endif
577
+
566
578
  /// Observers
567
579
  ///
568
580
 
@@ -1,5 +1,6 @@
1
1
 
2
2
  // Copyright (C) 2023 Christian Mazakas
3
+ // Copyright (C) 2024 Braden Ganetsky
3
4
  // Distributed under the Boost Software License, Version 1.0. (See accompanying
4
5
  // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6
 
@@ -15,6 +16,10 @@
15
16
  #include <functional>
16
17
  #include <memory>
17
18
 
19
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
20
+ #include <memory_resource>
21
+ #endif
22
+
18
23
  namespace boost {
19
24
  namespace unordered {
20
25
  template <class Key, class Hash = boost::hash<Key>,
@@ -36,6 +41,15 @@ namespace boost {
36
41
  void swap(unordered_node_set<Key, Hash, KeyEqual, Allocator>& lhs,
37
42
  unordered_node_set<Key, Hash, KeyEqual, Allocator>& rhs)
38
43
  noexcept(noexcept(lhs.swap(rhs)));
44
+
45
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
46
+ namespace pmr {
47
+ template <class Key, class Hash = boost::hash<Key>,
48
+ class KeyEqual = std::equal_to<Key> >
49
+ using unordered_node_set = boost::unordered::unordered_node_set<Key, Hash,
50
+ KeyEqual, std::pmr::polymorphic_allocator<Key> >;
51
+ } // namespace pmr
52
+ #endif
39
53
  } // namespace unordered
40
54
 
41
55
  using boost::unordered::unordered_node_set;
@@ -1,6 +1,7 @@
1
1
 
2
2
  // Copyright (C) 2008-2011 Daniel James.
3
3
  // Copyright (C) 2022 Christian Mazakas
4
+ // Copyright (C) 2024 Braden Ganetsky
4
5
  // Distributed under the Boost Software License, Version 1.0. (See accompanying
5
6
  // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7
 
@@ -16,6 +17,10 @@
16
17
  #include <functional>
17
18
  #include <memory>
18
19
 
20
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
21
+ #include <memory_resource>
22
+ #endif
23
+
19
24
  namespace boost {
20
25
  namespace unordered {
21
26
  template <class T, class H = boost::hash<T>, class P = std::equal_to<T>,
@@ -56,6 +61,18 @@ namespace boost {
56
61
 
57
62
  template <class N, class T, class A> class node_handle_set;
58
63
  template <class Iter, class NodeType> struct insert_return_type_set;
64
+
65
+ #ifndef BOOST_NO_CXX17_HDR_MEMORY_RESOURCE
66
+ namespace pmr {
67
+ template <class T, class H = boost::hash<T>, class P = std::equal_to<T> >
68
+ using unordered_set = boost::unordered::unordered_set<T, H, P,
69
+ std::pmr::polymorphic_allocator<T> >;
70
+
71
+ template <class T, class H = boost::hash<T>, class P = std::equal_to<T> >
72
+ using unordered_multiset = boost::unordered::unordered_multiset<T, H, P,
73
+ std::pmr::polymorphic_allocator<T> >;
74
+ } // namespace pmr
75
+ #endif
59
76
  } // namespace unordered
60
77
 
61
78
  using boost::unordered::unordered_multiset;
@@ -11,48 +11,6 @@
11
11
  // An implementation of minstd_rand that does not require
12
12
  // the Random library
13
13
 
14
- #include <boost/cstdint.hpp>
15
-
16
- namespace boost
17
- {
18
- namespace detail
19
- {
20
-
21
- class minstd_rand
22
- {
23
- private:
24
-
25
- boost::uint_least32_t x_;
26
-
27
- enum { a = 48271, m = 2147483647 };
28
-
29
- public:
30
-
31
- minstd_rand(): x_( 1 )
32
- {
33
- }
34
-
35
- explicit minstd_rand( boost::uint_least32_t x ): x_( x % m )
36
- {
37
- if( x_ == 0 )
38
- {
39
- x_ = 1;
40
- }
41
- }
42
-
43
- boost::uint_least32_t operator()()
44
- {
45
- boost::uint_least64_t y = x_;
46
-
47
- y = ( a * y ) % m;
48
-
49
- x_ = static_cast<boost::uint_least32_t>( y );
50
-
51
- return x_;
52
- }
53
- };
54
-
55
- } // namespace detail
56
- } // namespace boost
14
+ #include <boost/core/detail/minstd_rand.hpp>
57
15
 
58
16
  #endif // #ifndef BOOST_UTILITY_DETAIL_MINSTD_RAND_HPP_INCLUDED
@@ -19,7 +19,7 @@
19
19
  // BOOST_VERSION / 100 % 1000 is the minor version
20
20
  // BOOST_VERSION / 100000 is the major version
21
21
 
22
- #define BOOST_VERSION 108500
22
+ #define BOOST_VERSION 108600
23
23
 
24
24
  //
25
25
  // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
@@ -27,6 +27,6 @@
27
27
  // number, y is the minor version number, and z is the patch level if not 0.
28
28
  // This is used by <config/auto_link.hpp> to select which library version to link to.
29
29
 
30
- #define BOOST_LIB_VERSION "1_85"
30
+ #define BOOST_LIB_VERSION "1_86"
31
31
 
32
32
  #endif
@@ -350,6 +350,14 @@
350
350
  offsetof(passenger_loc_conf_t, autogenerated.friendly_error_pages),
351
351
  NULL
352
352
  },
353
+ {
354
+ ngx_string("passenger_custom_error_page"),
355
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
356
+ passenger_conf_set_custom_error_page,
357
+ NGX_HTTP_LOC_CONF_OFFSET,
358
+ offsetof(passenger_loc_conf_t, autogenerated.custom_error_page),
359
+ NULL
360
+ },
353
361
  {
354
362
  ngx_string("passenger_min_instances"),
355
363
  NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
@@ -541,6 +541,18 @@ passenger_conf_set_friendly_error_pages(ngx_conf_t *cf, ngx_command_t *cmd, void
541
541
  return ngx_conf_set_flag_slot(cf, cmd, conf);
542
542
  }
543
543
 
544
+ static char *
545
+ passenger_conf_set_custom_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
546
+ passenger_loc_conf_t *passenger_conf = conf;
547
+
548
+ passenger_conf->autogenerated.custom_error_page_explicitly_set = 1;
549
+ record_loc_conf_source_location(cf, passenger_conf,
550
+ &passenger_conf->autogenerated.custom_error_page_source_file,
551
+ &passenger_conf->autogenerated.custom_error_page_source_line);
552
+
553
+ return ngx_conf_set_str_slot(cf, cmd, conf);
554
+ }
555
+
544
556
  static char *
545
557
  passenger_conf_set_min_instances(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
546
558
  passenger_loc_conf_t *passenger_conf = conf;
@@ -224,7 +224,9 @@ passenger_create_loc_conf(ngx_conf_t *cf)
224
224
 
225
225
  conf->upstream_config.send_lowat = NGX_CONF_UNSET_SIZE;
226
226
  conf->upstream_config.buffer_size = NGX_CONF_UNSET_SIZE;
227
- #if NGINX_VERSION_NUM >= 1007007
227
+ #if NGINX_VERSION_NUM >= 1027000
228
+ conf->upstream_config.limit_rate = NGX_CONF_UNSET_PTR;
229
+ #elif NGINX_VERSION_NUM >= 1007007
228
230
  conf->upstream_config.limit_rate = NGX_CONF_UNSET_SIZE;
229
231
  #endif
230
232
 
@@ -465,7 +467,10 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
465
467
  prev->upstream_config.buffer_size,
466
468
  16 * 1024);
467
469
 
468
- #if NGINX_VERSION_NUM >= 1007007
470
+ #if NGINX_VERSION_NUM >= 1027000
471
+ ngx_conf_merge_ptr_value(conf->upstream_config.limit_rate,
472
+ prev->upstream_config.limit_rate, NULL);
473
+ #elif NGINX_VERSION_NUM >= 1007007
469
474
  ngx_conf_merge_size_value(conf->upstream_config.limit_rate,
470
475
  prev->upstream_config.limit_rate, 0);
471
476
  #endif
@@ -51,6 +51,8 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
51
51
  conf->environment.data = NULL;
52
52
  conf->environment.len = 0;
53
53
  conf->friendly_error_pages = NGX_CONF_UNSET;
54
+ conf->custom_error_page.data = NULL;
55
+ conf->custom_error_page.len = 0;
54
56
  conf->min_instances = NGX_CONF_UNSET_UINT;
55
57
  conf->start_timeout = NGX_CONF_UNSET_UINT;
56
58
  conf->user.data = NULL;
@@ -128,6 +130,10 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
128
130
  conf->friendly_error_pages_source_file.len = 0;
129
131
  conf->friendly_error_pages_source_line = 0;
130
132
  conf->friendly_error_pages_explicitly_set = 0;
133
+ conf->custom_error_page_source_file.data = NULL;
134
+ conf->custom_error_page_source_file.len = 0;
135
+ conf->custom_error_page_source_line = 0;
136
+ conf->custom_error_page_explicitly_set = 0;
131
137
  conf->min_instances_source_file.data = NULL;
132
138
  conf->min_instances_source_file.len = 0;
133
139
  conf->min_instances_source_line = 0;
@@ -86,6 +86,12 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
86
86
  : sizeof("f\r\n") - 1;
87
87
  }
88
88
 
89
+ if (conf->autogenerated.custom_error_page.data != NULL) {
90
+ len += sizeof("!~PASSENGER_CUSTOM_ERROR_PAGE: ") - 1;
91
+ len += conf->autogenerated.custom_error_page.len;
92
+ len += sizeof("\r\n") - 1;
93
+ }
94
+
89
95
  if (conf->autogenerated.min_instances != NGX_CONF_UNSET_UINT) {
90
96
  end = ngx_snprintf(int_buf,
91
97
  sizeof(int_buf) - 1,
@@ -342,6 +348,15 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
342
348
  }
343
349
  }
344
350
 
351
+ if (conf->autogenerated.custom_error_page.data != NULL) {
352
+ pos = ngx_copy(pos,
353
+ "!~PASSENGER_CUSTOM_ERROR_PAGE: ",
354
+ sizeof("!~PASSENGER_CUSTOM_ERROR_PAGE: ") - 1);
355
+ pos = ngx_copy(pos,
356
+ conf->autogenerated.custom_error_page.data,
357
+ conf->autogenerated.custom_error_page.len);
358
+ pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1);
359
+ }
345
360
  if (conf->autogenerated.min_instances != NGX_CONF_UNSET_UINT) {
346
361
  pos = ngx_copy(pos,
347
362
  "!~PASSENGER_MIN_PROCESSES: ",
@@ -129,6 +129,20 @@ generate_config_manifest_for_autogenerated_loc_conf(manifest_gen_ctx_t *ctx, pas
129
129
  psg_json_value_set_bool(hierarchy_member, "value",
130
130
  plcf->autogenerated.friendly_error_pages);
131
131
  }
132
+ if (plcf->autogenerated.custom_error_page_explicitly_set) {
133
+ find_or_create_manifest_app_and_loc_options_containers(ctx,
134
+ plcf, cscf, clcf, &app_options_container, &loc_options_container);
135
+ option_container = find_or_create_manifest_option_container(ctx,
136
+ app_options_container,
137
+ "passenger_custom_error_page",
138
+ sizeof("passenger_custom_error_page") - 1);
139
+ hierarchy_member = add_manifest_option_container_hierarchy_member(option_container,
140
+ &plcf->autogenerated.custom_error_page_source_file,
141
+ plcf->autogenerated.custom_error_page_source_line);
142
+ psg_json_value_set_str(hierarchy_member, "value",
143
+ (const char *) plcf->autogenerated.custom_error_page.data,
144
+ plcf->autogenerated.custom_error_page.len);
145
+ }
132
146
  if (plcf->autogenerated.min_instances_explicitly_set) {
133
147
  find_or_create_manifest_app_and_loc_options_containers(ctx,
134
148
  plcf, cscf, clcf, &app_options_container, &loc_options_container);
@@ -61,6 +61,9 @@ passenger_merge_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *conf,
61
61
  ngx_conf_merge_value(conf->friendly_error_pages,
62
62
  prev->friendly_error_pages,
63
63
  NGX_CONF_UNSET);
64
+ ngx_conf_merge_str_value(conf->custom_error_page,
65
+ prev->custom_error_page,
66
+ NULL);
64
67
  ngx_conf_merge_uint_value(conf->min_instances,
65
68
  prev->min_instances,
66
69
  1);
@@ -67,6 +67,7 @@ typedef struct {
67
67
  ngx_str_t app_root;
68
68
  ngx_str_t app_start_command;
69
69
  ngx_str_t app_type;
70
+ ngx_str_t custom_error_page;
70
71
  ngx_str_t direct_instance_request_address;
71
72
  ngx_str_t document_root;
72
73
  ngx_str_t environment;
@@ -92,6 +93,7 @@ typedef struct {
92
93
  ngx_str_t app_type_source_file;
93
94
  ngx_str_t base_uris_source_file;
94
95
  ngx_str_t buffer_upload_source_file;
96
+ ngx_str_t custom_error_page_source_file;
95
97
  ngx_str_t debugger_source_file;
96
98
  ngx_str_t direct_instance_request_address_source_file;
97
99
  ngx_str_t document_root_source_file;
@@ -147,6 +149,7 @@ typedef struct {
147
149
  ngx_uint_t app_type_source_line;
148
150
  ngx_uint_t base_uris_source_line;
149
151
  ngx_uint_t buffer_upload_source_line;
152
+ ngx_uint_t custom_error_page_source_line;
150
153
  ngx_uint_t debugger_source_line;
151
154
  ngx_uint_t direct_instance_request_address_source_line;
152
155
  ngx_uint_t document_root_source_line;
@@ -202,6 +205,7 @@ typedef struct {
202
205
  ngx_int_t app_type_explicitly_set;
203
206
  ngx_int_t base_uris_explicitly_set;
204
207
  ngx_int_t buffer_upload_explicitly_set;
208
+ ngx_int_t custom_error_page_explicitly_set;
205
209
  ngx_int_t debugger_explicitly_set;
206
210
  ngx_int_t direct_instance_request_address_explicitly_set;
207
211
  ngx_int_t document_root_explicitly_set;
@@ -993,6 +993,7 @@ Init_passenger_native_support() {
993
993
  fs_watcher_wait_for_change, 0);
994
994
  rb_define_method(cFileSystemWatcher, "close",
995
995
  fs_watcher_close, 0);
996
+ rb_undef_alloc_func(cFileSystemWatcher);
996
997
  #endif
997
998
 
998
999
  /* The maximum length of a Unix socket path, including terminating null. */
@@ -462,6 +462,11 @@ APACHE2_CONFIGURATION_OPTIONS = [
462
462
  :dynamic_default => 'On if PassengerAppEnv is development, off otherwise',
463
463
  :desc => 'Whether to display friendly error pages when something goes wrong.'
464
464
  },
465
+ {
466
+ :name => 'PassengerCustomErrorPage',
467
+ :type => :string,
468
+ :desc => 'Path to html file to use for Passenger generated error pages.'
469
+ },
465
470
  {
466
471
  :name => 'PassengerRestartDir',
467
472
  :type => :string,
@@ -39,7 +39,8 @@ module PhusionPassenger
39
39
  :colorize => :auto,
40
40
  :force_tip => true,
41
41
  :connect_timeout => 30,
42
- :idle_timeout => 30
42
+ :idle_timeout => 30,
43
+ :address_sanitizer => false,
43
44
  }
44
45
  parse_options
45
46
  initialize_objects
@@ -70,7 +71,7 @@ module PhusionPassenger
70
71
  opts.on("--nginx-tarball PATH", String, "Use the given Nginx tarball instead of#{nl}" +
71
72
  "downloading it. You MUST also specify the#{nl}" +
72
73
  "Nginx version with --nginx-version") do |val|
73
- options[:nginx_tarball] = val
74
+ options[:nginx_tarball] = File.absolute_path(val)
74
75
  end
75
76
  opts.on("-f", "--force", "Skip sanity checks") do
76
77
  options[:force] = true
@@ -88,6 +89,9 @@ module PhusionPassenger
88
89
  opts.on("--idle-timeout SECONDS", Integer, "The maximum idle read time. Default: 30") do |val|
89
90
  options[:idle_timeout] = val
90
91
  end
92
+ opts.on("--address-sanitizer", "Compile with AddressSanitizer support") do
93
+ options[:address_sanitizer] = true
94
+ end
91
95
  opts.on("-h", "--help", "Show this help") do
92
96
  options[:help] = true
93
97
  end
@@ -272,11 +272,21 @@ module PhusionPassenger
272
272
  args << "--nginx-tarball"
273
273
  args << @options[:nginx_tarball]
274
274
  end
275
+ # The agent and the support libraries are compiled through Rake, which
276
+ # already supports $USE_ASAN, so it makes sense to use that environment
277
+ # variable here as well rather than introducing a CLI flag.
278
+ if boolean_option('USE_ASAN')
279
+ args << "--address-sanitizer"
280
+ end
275
281
  CompileNginxEngineCommand.new(args).run
276
282
  else
277
283
  abort "No precompiled Nginx engine could be downloaded. Refusing to compile because --no-compile is given."
278
284
  end
279
285
  end
286
+
287
+ def boolean_option(env_name)
288
+ ["true", "on", "yes", "1"].include?(ENV[env_name])
289
+ end
280
290
  end
281
291
 
282
292
  end # module Config
@@ -44,11 +44,19 @@ module PhusionPassenger
44
44
  class NginxEngineCompiler < AbstractInstaller
45
45
  include InstallationUtils
46
46
 
47
- def self.configure_script_options
48
- extra_cflags = "-Wno-error #{PlatformInfo.openssl_extra_cflags} #{PlatformInfo.pcre_extra_cflags}".strip
47
+ def self.configure_script_options(address_sanitizer: false)
48
+ extra_cflags = [
49
+ "-Wno-error",
50
+ PlatformInfo.openssl_extra_cflags,
51
+ PlatformInfo.pcre_extra_cflags,
52
+ ].compact.join(" ").strip
49
53
  result = "--with-cc-opt=#{Shellwords.escape extra_cflags} "
50
54
 
51
- extra_ldflags = "#{PlatformInfo.openssl_extra_ldflags} #{PlatformInfo.pcre_extra_ldflags}".strip
55
+ extra_ldflags = [
56
+ PlatformInfo.openssl_extra_ldflags,
57
+ PlatformInfo.pcre_extra_ldflags,
58
+ address_sanitizer ? PlatformInfo.address_sanitizer_flags : nil,
59
+ ].compact.join(" ").strip
52
60
  if !extra_ldflags.empty?
53
61
  result << "--with-ld-opt=#{Shellwords.escape extra_ldflags} "
54
62
  end
@@ -339,7 +347,7 @@ module PhusionPassenger
339
347
  # work around the problem by configure Nginx with prefix
340
348
  # /tmp.
341
349
  command << "#{shell} ./configure --prefix=/tmp " +
342
- "#{self.class.configure_script_options} " +
350
+ "#{self.class.configure_script_options(address_sanitizer: @address_sanitizer)} " +
343
351
  "--add-module=#{Shellwords.escape PhusionPassenger.nginx_module_source_dir}"
344
352
  run_command_yield_activity(command) do
345
353
  yield
@@ -403,6 +403,11 @@ NGINX_CONFIGURATION_OPTIONS = [
403
403
  :type => :flag,
404
404
  :dynamic_default => 'On if passenger_app_env is development, off otherwise'
405
405
  },
406
+ {
407
+ :name => 'passenger_custom_error_page',
408
+ :scope => :application,
409
+ :type => :string
410
+ },
406
411
  {
407
412
  :name => 'passenger_min_instances',
408
413
  :scope => :application,
@@ -142,8 +142,6 @@ module PhusionPassenger
142
142
  private_class_method :cc_or_cxx_supports_feliminate_unused_debug?
143
143
 
144
144
  def self.cc_or_cxx_supports_blocks?(language)
145
- ext = detect_language_extension(language)
146
- compiler_type_name = detect_compiler_type_name(language)
147
145
  command = create_compiler_command(language,"-E -dM",'- </dev/null')
148
146
  result = `#{command}`
149
147
  return result.include? "__BLOCKS__"
@@ -360,6 +358,13 @@ module PhusionPassenger
360
358
  end
361
359
  memoize :cc_supports_fno_limit_debug_info_flag?
362
360
 
361
+ def self.cc_supports_fno_optimize_sibling_calls_flag?
362
+ try_compile_with_warning_flag(
363
+ "Checking for C compiler '-fno-optimize-sibling-calls' support",
364
+ :c, '', '-fno-optimize-sibling-calls')
365
+ end
366
+ memoize :cc_supports_fno_optimize_sibling_calls_flag?
367
+
363
368
  def self.cxx_supports_visibility_flag?
364
369
  return false if os_name_simple == "aix"
365
370
  return try_compile("Checking for C++ compiler '-fvisibility' support",
@@ -430,6 +435,13 @@ module PhusionPassenger
430
435
  end
431
436
  memoize :cxx_supports_fno_limit_debug_info_flag?
432
437
 
438
+ def self.cxx_supports_fno_optimize_sibling_calls_flag?
439
+ try_compile_with_warning_flag(
440
+ "Checking for C++ compiler '-fno-optimize-sibling-calls' support",
441
+ :cxx, '', '-fno-optimize-sibling-calls')
442
+ end
443
+ memoize :cxx_supports_fno_optimize_sibling_calls_flag?
444
+
433
445
  def self.cc_supports_no_tls_direct_seg_refs_option?
434
446
  return try_compile("Checking for C compiler '-mno-tls-direct-seg-refs' support",
435
447
  :c, '', '-mno-tls-direct-seg-refs')
@@ -493,10 +505,10 @@ module PhusionPassenger
493
505
  end
494
506
  memoize :cxx_visibility_flag_generates_warnings?, true
495
507
 
496
- def self.address_sanitizer_flag
508
+ def self.address_sanitizer_flags
497
509
  if cc_is_clang?
498
510
  if `#{cc} --help` =~ /-fsanitize=/
499
- "-fsanitize=address"
511
+ "-fsanitize=address -fsanitize-address-use-after-return=always -fsanitize-address-use-after-scope"
500
512
  else
501
513
  "-faddress-sanitizer"
502
514
  end
@@ -504,7 +516,14 @@ module PhusionPassenger
504
516
  nil
505
517
  end
506
518
  end
507
- memoize :address_sanitizer_flag
519
+
520
+ def self.undefined_behavior_sanitizer_flags
521
+ if cc_is_clang?
522
+ "-fsanitize=undefined"
523
+ else
524
+ nil
525
+ end
526
+ end
508
527
 
509
528
  def self.cxx_11_flag
510
529
  # C++11 support on FreeBSD 10.0 + Clang seems to be bugged.
@@ -603,6 +622,14 @@ module PhusionPassenger
603
622
  end
604
623
  end
605
624
 
625
+ def self.precompiled_header_extension
626
+ if cxx_is_gcc?
627
+ 'gch'
628
+ else
629
+ 'pch'
630
+ end
631
+ end
632
+
606
633
 
607
634
  def self.make
608
635
  return string_env('MAKE', find_command('make'))
@@ -13,3 +13,13 @@ define 'rack' do
13
13
  end
14
14
  gem_install 'rack'
15
15
  end
16
+
17
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4.0')
18
+ define 'rackup' do
19
+ name 'rackup'
20
+ define_checker do
21
+ check_for_ruby_library('rackup')
22
+ end
23
+ gem_install 'rackup'
24
+ end
25
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Phusion Passenger - https://www.phusionpassenger.com/
4
+ # Copyright (c) 2024 Phusion Holding B.V.
5
+ #
6
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
7
+ # trademarks of Phusion Holding B.V.
8
+ #
9
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ # of this software and associated documentation files (the "Software"), to deal
11
+ # in the Software without restriction, including without limitation the rights
12
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ # copies of the Software, and to permit persons to whom the Software is
14
+ # furnished to do so, subject to the following conditions:
15
+ #
16
+ # The above copyright notice and this permission notice shall be included in
17
+ # all copies or substantial portions of the Software.
18
+ #
19
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ # THE SOFTWARE.
26
+
27
+ module PhusionPassenger
28
+ module Rack
29
+ module Handler
30
+ def run(app, options = {})
31
+ result = system(ruby_executable, '-S', find_passenger_standalone,
32
+ 'start', *build_args(options))
33
+ if !result
34
+ raise "Error starting Passenger"
35
+ end
36
+ end
37
+
38
+ def environment
39
+ ENV['RAILS_ENV'] || 'development'
40
+ end
41
+
42
+ def to_s
43
+ 'Passenger application server'
44
+ end
45
+
46
+ private
47
+ def build_args(options)
48
+ args = ['-e', environment]
49
+ args << '-p' << options[:Port].to_s if options[:Port]
50
+ args << '-a' << options[:Host].to_s if options[:Host]
51
+ args << '-R' << options[:config].to_s if options[:config]
52
+ args
53
+ end
54
+
55
+ def rb_config
56
+ if defined?(::RbConfig)
57
+ ::RbConfig::CONFIG
58
+ else
59
+ ::Config::CONFIG
60
+ end
61
+ end
62
+
63
+ def ruby_executable
64
+ @ruby_executable ||= rb_config['bindir'] + '/' +
65
+ rb_config['RUBY_INSTALL_NAME'] + rb_config['EXEEXT']
66
+ end
67
+
68
+ def find_passenger_standalone
69
+ ::File.join(::PhusionPassenger.bin_dir, 'passenger')
70
+ end
71
+ end
72
+ end
73
+ end