passenger 5.0.20 → 5.0.21

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (408) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/CHANGELOG +14 -0
  5. data/CONTRIBUTORS +1 -0
  6. data/README.md +1 -1
  7. data/Rakefile +4 -1
  8. data/bin/passenger +3 -2
  9. data/bin/passenger-config +3 -2
  10. data/bin/passenger-install-apache2-module +3 -3
  11. data/bin/passenger-install-nginx-module +10 -3
  12. data/bin/passenger-memory-stats +3 -2
  13. data/bin/passenger-status +3 -2
  14. data/build/agent.rb +4 -3
  15. data/build/apache2.rb +3 -2
  16. data/build/basics.rb +3 -2
  17. data/build/common_library.rb +9 -8
  18. data/build/cplusplus_support.rb +3 -2
  19. data/build/cxx_dependency_map.rb +67 -134
  20. data/build/cxx_tests.rb +3 -2
  21. data/build/documentation.rb +3 -2
  22. data/build/integration_tests.rb +3 -2
  23. data/build/misc.rb +3 -22
  24. data/build/nginx.rb +3 -2
  25. data/build/node_tests.rb +3 -2
  26. data/build/oxt_tests.rb +3 -2
  27. data/build/packaging.rb +4 -3
  28. data/build/ruby_extension.rb +3 -2
  29. data/build/ruby_tests.rb +3 -2
  30. data/build/test_basics.rb +3 -2
  31. data/dev/copy_boost_headers +3 -2
  32. data/doc/Design and Architecture.html +1 -1
  33. data/doc/Design and Architecture.txt +1 -1
  34. data/doc/Users guide Apache.html +1 -1
  35. data/doc/Users guide Nginx.html +1 -1
  36. data/doc/users_guide_snippets/appendix_a_about.txt +1 -1
  37. data/man/passenger-config.1 +0 -2
  38. data/man/passenger-memory-stats.8 +0 -2
  39. data/man/passenger-status.8 +0 -2
  40. data/src/agent/AgentMain.cpp +3 -2
  41. data/src/agent/Core/ApiServer.h +3 -2
  42. data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +3 -2
  43. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +3 -2
  44. data/src/agent/Core/ApplicationPool/Common.h +3 -2
  45. data/src/agent/Core/ApplicationPool/Context.h +3 -2
  46. data/src/agent/Core/ApplicationPool/ErrorRenderer.h +3 -2
  47. data/src/agent/Core/ApplicationPool/Group.h +3 -2
  48. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +3 -2
  49. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +3 -2
  50. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +3 -2
  51. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +3 -2
  52. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +3 -2
  53. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +3 -2
  54. data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +3 -2
  55. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +3 -2
  56. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +3 -2
  57. data/src/agent/Core/ApplicationPool/Group/Verification.cpp +3 -2
  58. data/src/agent/Core/ApplicationPool/Implementation.cpp +3 -2
  59. data/src/agent/Core/ApplicationPool/Options.h +3 -11
  60. data/src/agent/Core/ApplicationPool/Pool.h +3 -2
  61. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +3 -2
  62. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +3 -2
  63. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +3 -2
  64. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +3 -2
  65. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +3 -2
  66. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +3 -2
  67. data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +3 -2
  68. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +3 -2
  69. data/src/agent/Core/ApplicationPool/Process.h +3 -2
  70. data/src/agent/Core/ApplicationPool/Session.h +3 -2
  71. data/src/agent/Core/ApplicationPool/Socket.h +3 -2
  72. data/src/agent/Core/CoreMain.cpp +3 -2
  73. data/src/agent/Core/OptionParser.h +3 -2
  74. data/src/agent/Core/RequestHandler.h +3 -2
  75. data/src/agent/Core/RequestHandler/AppResponse.h +3 -2
  76. data/src/agent/Core/RequestHandler/BufferBody.cpp +3 -2
  77. data/src/agent/Core/RequestHandler/CheckoutSession.cpp +3 -2
  78. data/src/agent/Core/RequestHandler/Client.h +3 -2
  79. data/src/agent/Core/RequestHandler/ForwardResponse.cpp +3 -2
  80. data/src/agent/Core/RequestHandler/Hooks.cpp +4 -2
  81. data/src/agent/Core/RequestHandler/InitRequest.cpp +13 -4
  82. data/src/agent/Core/RequestHandler/Request.h +10 -2
  83. data/src/agent/Core/RequestHandler/SendRequest.cpp +40 -9
  84. data/src/agent/Core/RequestHandler/TurboCaching.h +3 -2
  85. data/src/agent/Core/RequestHandler/Utils.cpp +3 -2
  86. data/src/agent/Core/ResponseCache.h +3 -2
  87. data/src/agent/Core/SpawningKit/BackgroundIOCapturer.h +3 -2
  88. data/src/agent/Core/SpawningKit/Config.h +3 -2
  89. data/src/agent/Core/SpawningKit/DirectSpawner.h +3 -2
  90. data/src/agent/Core/SpawningKit/DummySpawner.h +3 -2
  91. data/src/agent/Core/SpawningKit/Factory.h +3 -2
  92. data/src/agent/Core/SpawningKit/Options.h +3 -2
  93. data/src/agent/Core/SpawningKit/PipeWatcher.h +3 -2
  94. data/src/agent/Core/SpawningKit/Result.h +3 -2
  95. data/src/agent/Core/SpawningKit/SmartSpawner.h +3 -2
  96. data/src/agent/Core/SpawningKit/Spawner.h +18 -2
  97. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +3 -2
  98. data/src/agent/Core/UnionStation/Connection.h +3 -2
  99. data/src/agent/Core/UnionStation/Core.h +3 -2
  100. data/src/agent/Core/UnionStation/StopwatchLog.h +3 -2
  101. data/src/agent/Core/UnionStation/Transaction.h +3 -2
  102. data/src/agent/Shared/ApiServerUtils.h +3 -2
  103. data/src/agent/Shared/ApplicationPoolApiKey.h +3 -2
  104. data/src/agent/Shared/Base.cpp +3 -2
  105. data/src/agent/Shared/Base.h +3 -2
  106. data/src/agent/SpawnPreparer/SpawnPreparerMain.cpp +3 -2
  107. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +3 -2
  108. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +3 -2
  109. data/src/agent/UstRouter/ApiServer.h +3 -2
  110. data/src/agent/UstRouter/Client.h +3 -2
  111. data/src/agent/UstRouter/Controller.h +3 -2
  112. data/src/agent/UstRouter/DataStoreId.h +3 -2
  113. data/src/agent/UstRouter/FileSink.h +3 -2
  114. data/src/agent/UstRouter/LogSink.h +3 -2
  115. data/src/agent/UstRouter/OptionParser.h +3 -2
  116. data/src/agent/UstRouter/RemoteSender.h +3 -2
  117. data/src/agent/UstRouter/RemoteSink.h +3 -2
  118. data/src/agent/UstRouter/Transaction.h +3 -2
  119. data/src/agent/UstRouter/UstRouterMain.cpp +3 -2
  120. data/src/agent/Watchdog/AgentWatcher.cpp +3 -2
  121. data/src/agent/Watchdog/ApiServer.h +3 -2
  122. data/src/agent/Watchdog/CoreWatcher.cpp +3 -2
  123. data/src/agent/Watchdog/InstanceDirToucher.cpp +3 -2
  124. data/src/agent/Watchdog/UstRouterWatcher.cpp +3 -2
  125. data/src/agent/Watchdog/WatchdogMain.cpp +4 -3
  126. data/src/apache2_module/Bucket.cpp +3 -2
  127. data/src/apache2_module/Bucket.h +3 -2
  128. data/src/apache2_module/Configuration.cpp +3 -2
  129. data/src/apache2_module/Configuration.h +3 -2
  130. data/src/apache2_module/Configuration.hpp +3 -2
  131. data/src/apache2_module/ConfigurationCommands.cpp +3 -2
  132. data/src/apache2_module/ConfigurationCommands.cpp.erb +3 -2
  133. data/src/apache2_module/ConfigurationFields.hpp +3 -2
  134. data/src/apache2_module/ConfigurationFields.hpp.erb +3 -2
  135. data/src/apache2_module/ConfigurationSetters.cpp +3 -2
  136. data/src/apache2_module/ConfigurationSetters.cpp.erb +3 -2
  137. data/src/apache2_module/CreateDirConfig.cpp +3 -2
  138. data/src/apache2_module/CreateDirConfig.cpp.erb +3 -2
  139. data/src/apache2_module/DirectoryMapper.h +3 -2
  140. data/src/apache2_module/Hooks.cpp +12 -11
  141. data/src/apache2_module/Hooks.h +3 -2
  142. data/src/apache2_module/MergeDirConfig.cpp +3 -2
  143. data/src/apache2_module/MergeDirConfig.cpp.erb +3 -2
  144. data/src/apache2_module/SetHeaders.cpp +3 -2
  145. data/src/apache2_module/SetHeaders.cpp.erb +3 -2
  146. data/src/apache2_module/mod_passenger.c +3 -2
  147. data/src/cxx_supportlib/AppTypes.cpp +3 -2
  148. data/src/cxx_supportlib/AppTypes.h +3 -2
  149. data/src/cxx_supportlib/BackgroundEventLoop.cpp +3 -2
  150. data/src/cxx_supportlib/BackgroundEventLoop.h +3 -2
  151. data/src/cxx_supportlib/Constants.h +4 -7
  152. data/src/cxx_supportlib/Constants.h.erb +3 -4
  153. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +3 -2
  154. data/src/cxx_supportlib/DataStructures/LString.h +3 -2
  155. data/src/cxx_supportlib/DataStructures/StringKeyTable.h +3 -2
  156. data/src/cxx_supportlib/Exceptions.cpp +3 -2
  157. data/src/cxx_supportlib/Exceptions.h +3 -2
  158. data/src/cxx_supportlib/FileDescriptor.h +3 -2
  159. data/src/cxx_supportlib/Hooks.h +3 -2
  160. data/src/cxx_supportlib/InstanceDirectory.h +4 -3
  161. data/src/cxx_supportlib/Logging.cpp +3 -2
  162. data/src/cxx_supportlib/Logging.h +3 -2
  163. data/src/cxx_supportlib/MemoryKit/mbuf.h +1 -1
  164. data/src/cxx_supportlib/MemoryKit/palloc.cpp +1 -1
  165. data/src/cxx_supportlib/MemoryKit/palloc.h +1 -1
  166. data/src/cxx_supportlib/MessageClient.h +3 -2
  167. data/src/cxx_supportlib/MessageReadersWriters.h +3 -2
  168. data/src/cxx_supportlib/RandomGenerator.h +3 -2
  169. data/src/cxx_supportlib/ResourceLocator.h +3 -2
  170. data/src/cxx_supportlib/SafeLibev.h +3 -2
  171. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +3 -2
  172. data/src/cxx_supportlib/ServerKit/Channel.h +3 -2
  173. data/src/cxx_supportlib/ServerKit/Client.h +3 -2
  174. data/src/cxx_supportlib/ServerKit/ClientRef.h +3 -2
  175. data/src/cxx_supportlib/ServerKit/Context.h +3 -2
  176. data/src/cxx_supportlib/ServerKit/CookieUtils.h +3 -2
  177. data/src/cxx_supportlib/ServerKit/Errors.h +3 -2
  178. data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +3 -2
  179. data/src/cxx_supportlib/ServerKit/FdSourceChannel.h +3 -2
  180. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +3 -2
  181. data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +3 -2
  182. data/src/cxx_supportlib/ServerKit/HeaderTable.h +3 -2
  183. data/src/cxx_supportlib/ServerKit/Hooks.h +3 -2
  184. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +3 -2
  185. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParserState.h +3 -2
  186. data/src/cxx_supportlib/ServerKit/HttpClient.h +3 -2
  187. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -2
  188. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +3 -2
  189. data/src/cxx_supportlib/ServerKit/HttpRequest.h +3 -2
  190. data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +3 -2
  191. data/src/cxx_supportlib/ServerKit/HttpServer.h +3 -2
  192. data/src/cxx_supportlib/ServerKit/Implementation.cpp +3 -2
  193. data/src/cxx_supportlib/ServerKit/Server.h +3 -2
  194. data/src/cxx_supportlib/StaticString.h +3 -2
  195. data/src/cxx_supportlib/UnionStationFilterSupport.cpp +3 -2
  196. data/src/cxx_supportlib/UnionStationFilterSupport.h +3 -2
  197. data/src/cxx_supportlib/Utils.cpp +3 -2
  198. data/src/cxx_supportlib/Utils.h +3 -2
  199. data/src/cxx_supportlib/Utils/AnsiColorConstants.h +3 -2
  200. data/src/cxx_supportlib/Utils/BlockingQueue.h +3 -2
  201. data/src/cxx_supportlib/Utils/BufferedIO.h +3 -2
  202. data/src/cxx_supportlib/Utils/CachedFileStat.cpp +3 -2
  203. data/src/cxx_supportlib/Utils/CachedFileStat.h +3 -2
  204. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -2
  205. data/src/cxx_supportlib/Utils/ClassUtils.h +20 -2
  206. data/src/cxx_supportlib/Utils/Curl.h +3 -2
  207. data/src/cxx_supportlib/Utils/DateParsing.h +3 -2
  208. data/src/cxx_supportlib/Utils/FastStringStream.h +3 -2
  209. data/src/cxx_supportlib/Utils/FileChangeChecker.h +3 -2
  210. data/src/cxx_supportlib/Utils/HashMap.h +3 -2
  211. data/src/cxx_supportlib/Utils/Hasher.cpp +3 -2
  212. data/src/cxx_supportlib/Utils/Hasher.h +3 -2
  213. data/src/cxx_supportlib/Utils/HttpConstants.h +3 -2
  214. data/src/cxx_supportlib/Utils/IOUtils.cpp +3 -2
  215. data/src/cxx_supportlib/Utils/IOUtils.h +3 -2
  216. data/src/cxx_supportlib/Utils/IniFile.h +3 -2
  217. data/src/cxx_supportlib/Utils/JsonUtils.h +3 -2
  218. data/src/cxx_supportlib/Utils/LargeFiles.h +3 -2
  219. data/src/cxx_supportlib/Utils/MemZeroGuard.h +3 -2
  220. data/src/cxx_supportlib/Utils/MemoryBarrier.h +3 -2
  221. data/src/cxx_supportlib/Utils/MessageIO.h +3 -2
  222. data/src/cxx_supportlib/Utils/MessagePassing.h +4 -3
  223. data/src/cxx_supportlib/Utils/OptionParsing.h +3 -2
  224. data/src/cxx_supportlib/Utils/ProcessMetricsCollector.h +3 -2
  225. data/src/cxx_supportlib/Utils/ScopeGuard.h +3 -2
  226. data/src/cxx_supportlib/Utils/SpeedMeter.h +3 -2
  227. data/src/cxx_supportlib/Utils/StrIntUtils.cpp +3 -2
  228. data/src/cxx_supportlib/Utils/StrIntUtils.h +3 -2
  229. data/src/cxx_supportlib/Utils/StrIntUtilsNoStrictAliasing.cpp +3 -2
  230. data/src/cxx_supportlib/Utils/StringMap.h +3 -2
  231. data/src/cxx_supportlib/Utils/StringScanning.h +3 -2
  232. data/src/cxx_supportlib/Utils/SystemMetricsCollector.h +3 -2
  233. data/src/cxx_supportlib/Utils/SystemTime.cpp +3 -2
  234. data/src/cxx_supportlib/Utils/SystemTime.h +3 -2
  235. data/src/cxx_supportlib/Utils/Timer.h +3 -2
  236. data/src/cxx_supportlib/Utils/VariantMap.h +3 -2
  237. data/src/cxx_supportlib/{AgentsStarter.cpp → WatchdogLauncher.cpp} +42 -41
  238. data/src/cxx_supportlib/{AgentsStarter.h → WatchdogLauncher.h} +99 -112
  239. data/src/cxx_supportlib/oxt/backtrace.hpp +1 -1
  240. data/src/cxx_supportlib/oxt/detail/backtrace_disabled.hpp +1 -1
  241. data/src/cxx_supportlib/oxt/detail/backtrace_enabled.hpp +1 -1
  242. data/src/cxx_supportlib/oxt/detail/context.hpp +1 -1
  243. data/src/cxx_supportlib/oxt/detail/spin_lock_darwin.hpp +1 -1
  244. data/src/cxx_supportlib/oxt/detail/spin_lock_gcc_x86.hpp +1 -1
  245. data/src/cxx_supportlib/oxt/detail/spin_lock_portable.hpp +1 -1
  246. data/src/cxx_supportlib/oxt/detail/spin_lock_pthreads.hpp +1 -1
  247. data/src/cxx_supportlib/oxt/detail/tracable_exception_disabled.hpp +1 -1
  248. data/src/cxx_supportlib/oxt/detail/tracable_exception_enabled.hpp +1 -1
  249. data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +1 -1
  250. data/src/cxx_supportlib/oxt/implementation.cpp +1 -1
  251. data/src/cxx_supportlib/oxt/initialize.hpp +1 -1
  252. data/src/cxx_supportlib/oxt/macros.hpp +1 -1
  253. data/src/cxx_supportlib/oxt/spin_lock.hpp +1 -1
  254. data/src/cxx_supportlib/oxt/system_calls.cpp +1 -1
  255. data/src/cxx_supportlib/oxt/system_calls.hpp +1 -1
  256. data/src/cxx_supportlib/oxt/thread.hpp +1 -1
  257. data/src/cxx_supportlib/oxt/tracable_exception.hpp +1 -1
  258. data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_raw_buffer.hpp +1 -1
  259. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +2 -2
  260. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/Changes +0 -0
  261. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/LICENSE +0 -0
  262. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/Makefile.am +0 -0
  263. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/Makefile.in +0 -0
  264. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/README +0 -0
  265. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/aclocal.m4 +0 -0
  266. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/autogen.sh +0 -0
  267. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/config.guess +0 -0
  268. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/config.h.in +0 -0
  269. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/config.sub +0 -0
  270. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/configure +0 -0
  271. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/configure.ac +0 -0
  272. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/depcomp +0 -0
  273. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev++.h +0 -0
  274. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev.c +0 -0
  275. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev.h +0 -0
  276. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_epoll.c +0 -0
  277. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_kqueue.c +0 -0
  278. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_poll.c +0 -0
  279. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_port.c +0 -0
  280. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_select.c +0 -0
  281. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_vars.h +0 -0
  282. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_win32.c +0 -0
  283. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ev_wrap.h +0 -0
  284. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/event.c +0 -0
  285. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/event.h +0 -0
  286. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/install-sh +0 -0
  287. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/libev.m4 +0 -0
  288. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/ltmain.sh +0 -0
  289. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/missing +0 -0
  290. data/src/cxx_supportlib/{vendor-copy → vendor-modified}/libev/mkinstalldirs +0 -0
  291. data/src/helper-scripts/backtrace-sanitizer.rb +3 -2
  292. data/src/helper-scripts/crash-watch.rb +1 -1
  293. data/src/helper-scripts/download_binaries/extconf.rb +3 -2
  294. data/src/helper-scripts/meteor-loader.rb +3 -2
  295. data/src/helper-scripts/node-loader.js +8 -5
  296. data/src/helper-scripts/prespawn +3 -2
  297. data/src/helper-scripts/rack-loader.rb +6 -3
  298. data/src/helper-scripts/rack-preloader.rb +6 -3
  299. data/src/helper-scripts/wsgi-loader.py +3 -2
  300. data/src/nginx_module/CacheLocationConfig.c +3 -2
  301. data/src/nginx_module/CacheLocationConfig.c.erb +3 -2
  302. data/src/nginx_module/Configuration.c +1 -1
  303. data/src/nginx_module/Configuration.h +1 -1
  304. data/src/nginx_module/ConfigurationCommands.c +3 -2
  305. data/src/nginx_module/ConfigurationCommands.c.erb +3 -2
  306. data/src/nginx_module/ConfigurationFields.h +3 -2
  307. data/src/nginx_module/ConfigurationFields.h.erb +3 -2
  308. data/src/nginx_module/ContentHandler.c +7 -7
  309. data/src/nginx_module/ContentHandler.h +1 -1
  310. data/src/nginx_module/CreateLocationConfig.c +3 -2
  311. data/src/nginx_module/CreateLocationConfig.c.erb +3 -2
  312. data/src/nginx_module/MergeLocationConfig.c +3 -2
  313. data/src/nginx_module/MergeLocationConfig.c.erb +3 -2
  314. data/src/nginx_module/StaticContentHandler.c +1 -1
  315. data/src/nginx_module/StaticContentHandler.h +1 -1
  316. data/src/nginx_module/config +1 -1
  317. data/src/nginx_module/ngx_http_passenger_module.c +46 -46
  318. data/src/nginx_module/ngx_http_passenger_module.h +3 -3
  319. data/src/nodejs_supportlib/phusion_passenger/line_reader.js +3 -2
  320. data/src/ruby_native_extension/extconf.rb +3 -2
  321. data/src/ruby_native_extension/passenger_native_support.c +6 -5
  322. data/src/ruby_supportlib/phusion_passenger.rb +4 -3
  323. data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +3 -2
  324. data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +3 -2
  325. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +3 -2
  326. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +3 -2
  327. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +3 -2
  328. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +3 -2
  329. data/src/ruby_supportlib/phusion_passenger/common_library.rb +6 -5
  330. data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +3 -2
  331. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +3 -2
  332. data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +3 -2
  333. data/src/ruby_supportlib/phusion_passenger/config/build_native_support_command.rb +3 -2
  334. data/src/ruby_supportlib/phusion_passenger/config/command.rb +3 -2
  335. data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +3 -2
  336. data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +3 -2
  337. data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +3 -2
  338. data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +3 -2
  339. data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +3 -2
  340. data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +3 -2
  341. data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +3 -2
  342. data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +3 -2
  343. data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +3 -2
  344. data/src/ruby_supportlib/phusion_passenger/config/main.rb +3 -2
  345. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +25 -3
  346. data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +3 -2
  347. data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +4 -3
  348. data/src/ruby_supportlib/phusion_passenger/config/system_metrics_command.rb +3 -2
  349. data/src/ruby_supportlib/phusion_passenger/config/utils.rb +3 -2
  350. data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +3 -2
  351. data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +3 -2
  352. data/src/ruby_supportlib/phusion_passenger/constants.rb +3 -11
  353. data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +3 -2
  354. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +21 -2
  355. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +8 -2
  356. data/src/ruby_supportlib/phusion_passenger/message_client.rb +3 -2
  357. data/src/ruby_supportlib/phusion_passenger/native_support.rb +3 -2
  358. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +3 -2
  359. data/src/ruby_supportlib/phusion_passenger/packaging.rb +3 -2
  360. data/src/ruby_supportlib/phusion_passenger/platform_info.rb +3 -2
  361. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +3 -2
  362. data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +3 -2
  363. data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +3 -2
  364. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +3 -2
  365. data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +3 -2
  366. data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +3 -2
  367. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck.rb +6 -0
  368. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/libs.rb +5 -1
  369. data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +3 -2
  370. data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +61 -0
  371. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +3 -2
  372. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +3 -2
  373. data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +3 -2
  374. data/src/ruby_supportlib/phusion_passenger/plugin.rb +3 -2
  375. data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +3 -2
  376. data/src/ruby_supportlib/phusion_passenger/public_api.rb +3 -2
  377. data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +3 -2
  378. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +18 -6
  379. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +3 -2
  380. data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +3 -2
  381. data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +45 -18
  382. data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +3 -2
  383. data/src/ruby_supportlib/phusion_passenger/simple_benchmarking.rb +3 -2
  384. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +8 -7
  385. data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +3 -2
  386. data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +4 -3
  387. data/src/ruby_supportlib/phusion_passenger/standalone/control_utils.rb +3 -2
  388. data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +3 -2
  389. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +23 -20
  390. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +3 -2
  391. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +3 -2
  392. data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +8 -3
  393. data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +8 -3
  394. data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +5 -3
  395. data/src/ruby_supportlib/phusion_passenger/utils.rb +3 -2
  396. data/src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb +3 -2
  397. data/src/ruby_supportlib/phusion_passenger/utils/download.rb +3 -2
  398. data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +3 -2
  399. data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +3 -2
  400. data/src/ruby_supportlib/phusion_passenger/utils/lock.rb +3 -2
  401. data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +3 -2
  402. data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +3 -2
  403. data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +3 -2
  404. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +3 -2
  405. metadata +36 -37
  406. metadata.gz.asc +7 -7
  407. data/src/cxx_supportlib/Account.h +0 -171
  408. data/src/cxx_supportlib/AccountsDatabase.h +0 -125
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2014 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2013-2015 Phusion
2
+ # Copyright (c) 2013-2015 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2015 Phusion
2
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2013-2015 Phusion
2
+ # Copyright (c) 2013-2015 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2014 Phusion
2
+ # Copyright (c) 2010-2014 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2013 Phusion
2
+ # Copyright (c) 2010-2013 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -2,6 +2,8 @@
2
2
  PhusionPassenger.require_passenger_lib 'platform_info/ruby'
3
3
  PhusionPassenger.require_passenger_lib 'platform_info/linux'
4
4
  PhusionPassenger.require_passenger_lib 'platform_info/compiler'
5
+ PhusionPassenger.require_passenger_lib 'platform_info/openssl'
6
+ PhusionPassenger.require_passenger_lib 'platform_info/curl'
5
7
  PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
6
8
  PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
7
9
 
@@ -260,6 +262,10 @@ module PhusionPassenger
260
262
  "<b>#{gem_command} install #{package_name}</b>")
261
263
  end
262
264
 
265
+ def brew_install(package_name)
266
+ install_instructions("Please install it with <b>brew install #{package_name}</b>")
267
+ end
268
+
263
269
  def install_osx_command_line_tools
264
270
  PhusionPassenger.require_passenger_lib 'platform_info/compiler'
265
271
  if PlatformInfo.xcode_select_version.to_s >= "2333"
@@ -2,7 +2,8 @@ define 'openssl-dev' do
2
2
  name "OpenSSL development headers"
3
3
  website "http://www.openssl.org/"
4
4
  define_checker do
5
- check_for_header('openssl/ssl.h')
5
+ check_for_header('openssl/ssl.h', :c,
6
+ PlatformInfo.openssl_extra_cflags)
6
7
  end
7
8
 
8
9
  on :debian do
@@ -11,6 +12,9 @@ define 'openssl-dev' do
11
12
  on :redhat do
12
13
  yum_install "openssl-devel"
13
14
  end
15
+ on :macosx do
16
+ brew_install "openssl"
17
+ end
14
18
  end
15
19
 
16
20
  define 'libcurl-dev' do
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2014 Phusion
3
+ # Copyright (c) 2010-2014 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,61 @@
1
+ # Phusion Passenger - https://www.phusionpassenger.com/
2
+ # Copyright (c) 2015 Phusion Holding B.V.
3
+ #
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ # THE SOFTWARE.
24
+
25
+ PhusionPassenger.require_passenger_lib 'platform_info'
26
+ PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
27
+
28
+ module PhusionPassenger
29
+
30
+ module PlatformInfo
31
+ def self.openssl_extra_cflags
32
+ if PlatformInfo.os_name == "macosx"
33
+ if File.exist?("/usr/include/openssl")
34
+ ""
35
+ else
36
+ # OS X >= 10.11 El Capitan no longer include
37
+ # OpenSSL development headers. Use the one from
38
+ # Homebrew.
39
+ "-I/usr/local/opt/openssl/include"
40
+ end
41
+ else
42
+ ""
43
+ end
44
+ end
45
+ memoize :openssl_extra_cflags
46
+
47
+ def self.openssl_extra_ldflags
48
+ if PlatformInfo.os_name == "macosx"
49
+ if File.exist?("/usr/include/openssl")
50
+ ""
51
+ else
52
+ "-L/usr/local/opt/openssl/lib"
53
+ end
54
+ else
55
+ ""
56
+ end
57
+ end
58
+ memoize :openssl_extra_ldflags
59
+ end
60
+
61
+ end # module PhusionPassenger
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2013 Phusion
2
+ # Copyright (c) 2010-2013 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2011-2014 Phusion
3
+ # Copyright (c) 2011-2014 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2015 Phusion
2
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2012-2014 Phusion
3
+ # Copyright (c) 2012-2014 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -44,7 +45,9 @@ module PhusionPassenger
44
45
  SCRIPT_NAME = "SCRIPT_NAME" # :nodoc:
45
46
  REQUEST_METHOD = "REQUEST_METHOD" # :nodoc:
46
47
  TRANSFER_ENCODING_HEADER = "Transfer-Encoding" # :nodoc:
48
+ TRANSFER_ENCODING_HEADERS = ["Transfer-Encoding", "Transfer-encoding", "transfer-encoding"] # :nodoc:
47
49
  CONTENT_LENGTH_HEADER = "Content-Length" # :nodoc:
50
+ CONTENT_LENGTH_HEADERS = ["Content-Length", "Content-length", "content-length"] # :nodoc:
48
51
  X_SENDFILE_HEADER = "X-Sendfile" # :nodoc:
49
52
  X_ACCEL_REDIRECT_HEADER = "X-Accel-Redirect" # :nodoc:
50
53
  CONTENT_LENGTH_HEADER_AND_SEPARATOR = "Content-Length: " # :nodoc
@@ -199,12 +202,12 @@ module PhusionPassenger
199
202
  # time that the body we write out is guaranteed to match what the headers say.
200
203
  # Otherwise we disable keep-alive to prevent the app from being able to mess
201
204
  # up the keep-alive connection.
202
- if header = headers[CONTENT_LENGTH_HEADER]
205
+ if header = lookup_header(headers, CONTENT_LENGTH_HEADERS)
203
206
  # Easiest case: app has a Content-Length header. The headers
204
207
  # need no fixing.
205
208
  message_length_type = :content_length
206
209
  content_length = header.to_i
207
- if headers.has_key?(TRANSFER_ENCODING_HEADER)
210
+ if lookup_header(headers, TRANSFER_ENCODING_HEADERS)
208
211
  # Disallowed by the HTTP spec
209
212
  raise "Response object may not contain both Content-Length and Transfer-Encoding"
210
213
  end
@@ -224,7 +227,7 @@ module PhusionPassenger
224
227
  end
225
228
  end
226
229
  end
227
- elsif headers.has_key?(TRANSFER_ENCODING_HEADER)
230
+ elsif lookup_header(headers, TRANSFER_ENCODING_HEADERS)
228
231
  # App has a Transfer-Encoding header. We assume that the app
229
232
  # has already chunked the body. The headers need no fixing.
230
233
  message_length_type = :chunked_by_app
@@ -234,7 +237,7 @@ module PhusionPassenger
234
237
  # just to be safe.
235
238
  @can_keepalive = false
236
239
  end
237
- if headers.has_key?(CONTENT_LENGTH_HEADER)
240
+ if lookup_header(headers, CONTENT_LENGTH_HEADERS)
238
241
  # Disallowed by the HTTP spec
239
242
  raise "Response object may not contain both Content-Length and Transfer-Encoding"
240
243
  end
@@ -348,6 +351,15 @@ module PhusionPassenger
348
351
  return result
349
352
  end
350
353
 
354
+ def lookup_header(haystack, needles)
355
+ needles.each do |needle|
356
+ if result = haystack[needle]
357
+ return result
358
+ end
359
+ end
360
+ nil
361
+ end
362
+
351
363
  def should_output_body?(status, is_head_request)
352
364
  return (status < 100 ||
353
365
  (status >= 200 && status != 204 && status != 304)) &&
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2014 Phusion
3
+ # Copyright (c) 2010-2014 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,8 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2015 Phusion
2
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
3
3
  #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
5
6
  #
6
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,9 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2015 Phusion
3
+ # Copyright (c) 2010-2015 Phusion Holding B.V.
4
4
  #
5
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ # trademarks of Phusion Holding B.V.
6
7
  #
7
8
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
9
  # of this software and associated documentation files (the "Software"), to deal
@@ -37,6 +38,7 @@ if (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
37
38
  "gem install fastthread"
38
39
  end
39
40
  end
41
+ require 'pathname'
40
42
 
41
43
  class Exception
42
44
  def backtrace_string(current_location = nil)
@@ -60,32 +62,57 @@ class Exception
60
62
  end
61
63
 
62
64
  class Dir
63
- # Dir.pwd resolves symlinks. This version tries not to, by shelling
64
- # out to the pwd tool.
65
- def self.pwd_no_resolve
66
- begin
67
- result = `pwd`.strip
68
- rescue Errno::ENOENT
69
- result = `/bin/pwd`.strip
65
+ # The current working directory may contain one or more symlinks
66
+ # in its path. Both Dir.pwd and the C getcwd() call resolve symlinks
67
+ # in the path.
68
+ #
69
+ # It turns out that there is no such thing as a path without
70
+ # unresolved symlinks. The shell presents a working directory with
71
+ # unresolved symlinks (which it calls the "logical working directory"),
72
+ # but that is an illusion provided by the shell. The shell reports
73
+ # the logical working directory though the PWD environment variable.
74
+ #
75
+ # This method tries to use the PWD environment variable if it
76
+ # matches the actual working directory.
77
+ #
78
+ # See also:
79
+ # https://github.com/phusion/passenger/issues/1596#issuecomment-138154045
80
+ # http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/pwd.c
81
+ # http://www.opensource.apple.com/source/shell_cmds/shell_cmds-170/pwd/pwd.c
82
+ def self.logical_pwd
83
+ physical_pwd = Dir.pwd
84
+ logical_pwd = ENV['PWD']
85
+ if logical_pwd.nil? || logical_pwd.empty?
86
+ return physical_pwd
70
87
  end
71
- if result.empty?
72
- return Dir.pwd
73
- else
74
- return result
88
+
89
+ # Check whether $PWD matches the actual working directory.
90
+ # This algorithm similar to the one used by GNU coreutils.
91
+ begin
92
+ logical_stat = File.stat(logical_pwd)
93
+ physical_stat = File.stat(physical_pwd)
94
+ if logical_stat.ino == physical_stat.ino &&
95
+ logical_stat.dev == physical_stat.dev
96
+ logical_pwd
97
+ else
98
+ physical_pwd
99
+ end
100
+ rescue SystemCallError
101
+ physical_pwd
75
102
  end
76
103
  end
77
104
  end
78
105
 
79
106
  class File
80
107
  # Dir.pwd resolves symlinks. So in turn, File.expand_path/File.absolute_path
81
- # do that too. This method fixes that by using Dir.pwd_no_resolve.
108
+ # do that too. This method fixes that by using Dir.logical_pwd.
82
109
  if File.respond_to?(:absolute_path)
83
- def self.absolute_path_no_resolve(path)
84
- return File.absolute_path(path, Dir.pwd_no_resolve)
110
+ def self.absolute_logical_path(path, base = Dir.logical_pwd)
111
+ return File.absolute_path(path, base)
85
112
  end
86
113
  else
87
- def self.absolute_path_no_resolve(path)
88
- return File.expand_path(path, Dir.pwd_no_resolve)
114
+ def self.absolute_logical_path(path, base = Dir.logical_pwd)
115
+ return File.expand_path(path, base)
89
116
  end
90
117
  end
91
118
  end