passenger 4.0.30 → 4.0.31
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.
- data.tar.gz.asc +7 -7
- data/NEWS +31 -0
- data/bin/passenger +5 -5
- data/bin/passenger-config +6 -126
- data/bin/passenger-install-apache2-module +108 -26
- data/bin/passenger-install-nginx-module +81 -27
- data/bin/passenger-memory-stats +7 -6
- data/bin/passenger-status +13 -10
- data/build/agents.rb +8 -12
- data/build/apache2.rb +12 -7
- data/build/basics.rb +28 -20
- data/build/common_library.rb +4 -4
- data/build/cplusplus_support.rb +4 -4
- data/build/cxx_tests.rb +5 -3
- data/build/debian.rb +1 -2
- data/build/integration_tests.rb +25 -9
- data/build/misc.rb +2 -2
- data/build/oxt_tests.rb +5 -6
- data/build/packaging.rb +72 -40
- data/build/ruby_tests.rb +5 -1
- data/build/test_basics.rb +1 -2
- data/debian.template/locations.ini.template +1 -0
- data/debian.template/rules.template +2 -1
- data/dev/install_scripts_bootstrap_code.rb +42 -0
- data/dev/run_travis.sh +1 -0
- data/dev/runner +27 -0
- data/doc/Packaging.txt.md +5 -10
- data/doc/Users guide Apache.idmap.txt +3 -1
- data/doc/Users guide Apache.txt +5 -3
- data/doc/Users guide Nginx.idmap.txt +9 -5
- data/doc/Users guide Nginx.txt +47 -17
- data/doc/users_guide_snippets/environment_variables.txt +2 -2
- data/doc/users_guide_snippets/installation.txt +6 -2
- data/doc/users_guide_snippets/tips.txt +4 -0
- data/ext/apache2/Hooks.cpp +16 -3
- data/ext/common/Account.h +6 -5
- data/ext/common/AgentsStarter.h +1 -1
- data/ext/common/ApplicationPool2/Common.h +72 -0
- data/ext/common/ApplicationPool2/Group.h +263 -148
- data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
- data/ext/common/ApplicationPool2/Options.h +1 -7
- data/ext/common/ApplicationPool2/Pool.h +96 -72
- data/ext/common/ApplicationPool2/Process.h +12 -17
- data/ext/common/ApplicationPool2/Socket.h +4 -4
- data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
- data/ext/common/Constants.h +15 -1
- data/ext/common/MessageServer.h +22 -0
- data/ext/common/Utils.cpp +4 -1
- data/ext/common/Utils.h +3 -1
- data/ext/common/Utils/StrIntUtils.h +1 -0
- data/ext/common/Utils/Timer.h +15 -1
- data/ext/common/Utils/utf8/checked.h +0 -0
- data/ext/common/Utils/utf8/core.h +0 -0
- data/ext/common/Utils/utf8/unchecked.h +0 -0
- data/ext/common/agents/Base.cpp +59 -35
- data/ext/common/agents/HelperAgent/Main.cpp +23 -12
- data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
- data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
- data/ext/common/agents/TempDirToucher.c +12 -3
- data/ext/common/agents/Watchdog/Main.cpp +8 -2
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/ContentHandler.c +32 -19
- data/ext/nginx/CreateLocationConfig.c +5 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/nginx/config +13 -6
- data/ext/ruby/passenger_native_support.c +61 -2
- data/helper-scripts/classic-rails-loader.rb +9 -10
- data/helper-scripts/classic-rails-preloader.rb +10 -11
- data/helper-scripts/node-loader.js +3 -2
- data/helper-scripts/rack-loader.rb +8 -9
- data/helper-scripts/rack-preloader.rb +9 -10
- data/lib/phusion_passenger.rb +36 -7
- data/lib/phusion_passenger/abstract_installer.rb +16 -15
- data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
- data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
- data/lib/phusion_passenger/analytics_logger.rb +3 -3
- data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/config.rb +125 -0
- data/lib/phusion_passenger/config/about_command.rb +183 -0
- data/lib/phusion_passenger/config/command.rb +57 -0
- data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
- data/lib/phusion_passenger/config/utils.rb +108 -0
- data/lib/phusion_passenger/console_text_template.rb +2 -1
- data/lib/phusion_passenger/constants.rb +7 -2
- data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
- data/lib/phusion_passenger/message_client.rb +15 -4
- data/lib/phusion_passenger/native_support.rb +116 -98
- data/lib/phusion_passenger/nginx/config_options.rb +5 -0
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/platform_info/apache.rb +9 -5
- data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
- data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
- data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
- data/lib/phusion_passenger/platform_info/curl.rb +1 -1
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
- data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
- data/lib/phusion_passenger/platform_info/linux.rb +2 -2
- data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
- data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
- data/lib/phusion_passenger/plugin.rb +0 -1
- data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/lib/phusion_passenger/public_api.rb +1 -1
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/request_handler.rb +8 -9
- data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
- data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
- data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
- data/lib/phusion_passenger/standalone/command.rb +10 -8
- data/lib/phusion_passenger/standalone/help_command.rb +1 -1
- data/lib/phusion_passenger/standalone/main.rb +3 -3
- data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
- data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
- data/lib/phusion_passenger/standalone/start_command.rb +6 -7
- data/lib/phusion_passenger/standalone/status_command.rb +1 -1
- data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
- data/lib/phusion_passenger/standalone/utils.rb +1 -1
- data/lib/phusion_passenger/standalone/version_command.rb +2 -3
- data/lib/phusion_passenger/utils.rb +1 -1
- data/lib/phusion_passenger/utils/download.rb +1 -2
- data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
- data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- data/lib/phusion_passenger/utils/tee_input.rb +1 -1
- data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
- data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
- data/resources/templates/apache2/config_snippets.txt.erb +2 -3
- data/resources/templates/apache2/deployment_example.txt.erb +2 -2
- data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
- data/resources/templates/nginx/config_snippets.txt.erb +1 -1
- data/resources/templates/nginx/deployment_example.txt.erb +2 -2
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
- data/rpm/Vagrantfile +1 -0
- data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
- data/test/cxx/MessagePassingTest.cpp +1 -1
- data/test/cxx/RequestHandlerTest.cpp +26 -26
- data/test/integration_tests/apache2_tests.rb +162 -243
- data/test/integration_tests/native_packaging_spec.rb +10 -10
- data/test/integration_tests/nginx_tests.rb +87 -107
- data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
- data/test/integration_tests/source_packaging_test.rb +2 -1
- data/test/integration_tests/standalone_tests.rb +34 -19
- data/test/ruby/admin_tools_spec.rb +4 -4
- data/test/ruby/analytics_logger_spec.rb +1 -1
- data/test/ruby/debug_logging_spec.rb +2 -2
- data/test/ruby/message_channel_spec.rb +1 -1
- data/test/ruby/request_handler_spec.rb +171 -64
- data/test/ruby/shared/loader_sharedspec.rb +5 -5
- data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
- data/test/ruby/spec_helper.rb +4 -4
- data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
- data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
- data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
- data/test/ruby/utils/hosts_file_parser.rb +1 -1
- data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
- data/test/ruby/utils_spec.rb +4 -4
- data/test/stub/apache2/httpd.conf.erb +5 -0
- data/test/stub/index.html +1 -0
- data/test/stub/rack/config.ru +80 -33
- data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
- data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
- data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
- data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
- data/test/stub/rails2.3/config/routes.rb +1 -2
- data/test/stub/wsgi/passenger_wsgi.py +47 -8
- data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
- data/test/support/apache2_controller.rb +2 -2
- data/test/support/nginx_controller.rb +11 -5
- data/test/support/placebo-preloader.rb +2 -2
- data/test/support/test_helper.rb +26 -7
- metadata +78 -240
- metadata.gz.asc +7 -7
- data/debian.template/repack.sh +0 -42
- data/debian.template/watch +0 -3
- data/test/integration_tests/cgi_environment_spec.rb +0 -36
- data/test/integration_tests/hello_world_rack_spec.rb +0 -43
- data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
- data/test/integration_tests/mycook_spec.rb +0 -166
- data/test/stub/rack/public/rack.jpg +0 -0
- data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
- data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
- data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
- data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
- data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
- data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
- data/test/stub/rails_apps/1.2/empty/script/about +0 -3
- data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
- data/test/stub/rails_apps/1.2/empty/script/console +0 -3
- data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/1.2/empty/script/server +0 -3
- data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
- data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
- data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
- data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
- data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
- data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
- data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
- data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/script/about +0 -4
- data/test/stub/rails_apps/2.2/empty/script/console +0 -3
- data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
- data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/server +0 -3
- data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
- data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
- data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
- data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
- data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/script/about +0 -4
- data/test/stub/rails_apps/2.3/empty/script/console +0 -3
- data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.3/empty/script/server +0 -3
- data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
- data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
- data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
@@ -139,6 +139,11 @@ LOCATION_CONFIGURATION_OPTIONS = [
|
|
139
139
|
:header => nil,
|
140
140
|
:auto_generate_nginx_merge_code => false
|
141
141
|
},
|
142
|
+
{
|
143
|
+
:name => 'passenger_document_root',
|
144
|
+
:type => :string,
|
145
|
+
:header => nil
|
146
|
+
},
|
142
147
|
{
|
143
148
|
:name => 'passenger_user',
|
144
149
|
:type => :string
|
@@ -22,10 +22,10 @@
|
|
22
22
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
23
|
# THE SOFTWARE.
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
27
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
28
|
+
PhusionPassenger.require_passenger_lib 'platform_info/linux'
|
29
29
|
|
30
30
|
module PhusionPassenger
|
31
31
|
|
@@ -185,7 +185,11 @@ module PlatformInfo
|
|
185
185
|
|
186
186
|
def self.httpd_actual_error_log(options = nil)
|
187
187
|
if config_file = httpd_default_config_file(options)
|
188
|
-
|
188
|
+
begin
|
189
|
+
contents = File.open(config_file, "rb") { |f| f.read }
|
190
|
+
rescue Errno::EACCES
|
191
|
+
return nil
|
192
|
+
end
|
189
193
|
# We don't want to match comments
|
190
194
|
contents.gsub!(/^[ \t]*#.*/, '')
|
191
195
|
if contents =~ /^ErrorLog (.+)$/
|
@@ -21,12 +21,11 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
require 'phusion_passenger/utils/ansi_colors'
|
24
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
27
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
28
|
+
PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
|
30
29
|
require 'pathname'
|
31
30
|
|
32
31
|
module PhusionPassenger
|
@@ -22,9 +22,9 @@
|
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
24
|
require 'rbconfig'
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
27
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
28
28
|
|
29
29
|
module PhusionPassenger
|
30
30
|
|
@@ -21,8 +21,8 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
26
26
|
|
27
27
|
module PhusionPassenger
|
28
28
|
|
@@ -144,18 +144,25 @@ public
|
|
144
144
|
def self.cc
|
145
145
|
return string_env('CC', default_cc)
|
146
146
|
end
|
147
|
+
memoize :cc
|
147
148
|
|
148
149
|
def self.cxx
|
149
150
|
return string_env('CXX', default_cxx)
|
150
151
|
end
|
152
|
+
memoize :cxx
|
151
153
|
|
152
154
|
def self.default_cc
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
155
|
+
# On most platforms, we'll want to use the same compiler as what the rest
|
156
|
+
# of the system uses, so that we generate compatible binaries. That's
|
157
|
+
# most likely the 'cc' command. We used to use 'gcc' by default.
|
158
|
+
#
|
159
|
+
# See for example this issue with OS X Mavericks (10.9). They switched from
|
160
|
+
# GCC to Clang as the default compiler. Since the Nginx by default uses 'cc'
|
161
|
+
# as the compiler, we'll have to do that too. Otherwise we'll get C++ linker
|
162
|
+
# errors because Nginx is compiled with Clang while Phusion Passenger is
|
163
|
+
# compiled with GCC.
|
157
164
|
# https://code.google.com/p/phusion-passenger/issues/detail?id=950
|
158
|
-
if PlatformInfo.
|
165
|
+
if PlatformInfo.find_command('cc')
|
159
166
|
return 'cc'
|
160
167
|
else
|
161
168
|
return 'gcc'
|
@@ -163,7 +170,7 @@ public
|
|
163
170
|
end
|
164
171
|
|
165
172
|
def self.default_cxx
|
166
|
-
if PlatformInfo.
|
173
|
+
if PlatformInfo.find_command('c++')
|
167
174
|
return 'c++'
|
168
175
|
else
|
169
176
|
return 'g++'
|
@@ -175,6 +182,11 @@ public
|
|
175
182
|
end
|
176
183
|
memoize :cc_is_gcc?
|
177
184
|
|
185
|
+
def self.cxx_is_gcc?
|
186
|
+
`#{cxx} -v 2>&1` =~ /gcc version/
|
187
|
+
end
|
188
|
+
memoize :cxx_is_gcc?
|
189
|
+
|
178
190
|
def self.cc_is_clang?
|
179
191
|
`#{cc} --version 2>&1` =~ /clang version/
|
180
192
|
end
|
@@ -428,12 +440,18 @@ public
|
|
428
440
|
memoize :adress_sanitizer_flag
|
429
441
|
|
430
442
|
def self.cxx_11_flag
|
431
|
-
|
432
|
-
|
443
|
+
# C++11 support on FreeBSD 10.0 + Clang seems to be bugged.
|
444
|
+
# http://llvm.org/bugs/show_bug.cgi?id=18310
|
445
|
+
return nil if os_name =~ /freebsd/
|
446
|
+
|
447
|
+
source = %{
|
448
|
+
struct Foo {
|
449
|
+
Foo(Foo &&f) { }
|
450
|
+
};
|
433
451
|
}
|
434
452
|
if try_compile("Checking for C++ -std=gnu++11 compiler flag", :cxx, source, '-std=gnu++11')
|
435
453
|
return "-std=gnu++11"
|
436
|
-
elsif try_compile("Checking for C++ -std=c++11 compiler flag", :cxx, source, '-std=c++')
|
454
|
+
elsif try_compile("Checking for C++ -std=c++11 compiler flag", :cxx, source, '-std=c++11')
|
437
455
|
return "-std=c++11"
|
438
456
|
else
|
439
457
|
return nil
|
@@ -21,27 +21,26 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
27
27
|
|
28
28
|
module PhusionPassenger
|
29
29
|
|
30
30
|
module PlatformInfo
|
31
|
-
#
|
32
|
-
#
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
return result
|
31
|
+
# Extra flags that should always be passed to the C compiler
|
32
|
+
# when linking, to be included last in the command string.
|
33
|
+
def self.portability_c_ldflags
|
34
|
+
return portability_c_or_cxx_ldflags(:c)
|
35
|
+
end
|
36
|
+
memoize :portability_c_ldflags
|
37
|
+
|
38
|
+
# Extra flags that should always be passed to the C++ compiler
|
39
|
+
# when linking, to be included last in the command string.
|
40
|
+
def self.portability_cxx_ldflags
|
41
|
+
return portability_c_or_cxx_ldflags(:cxx)
|
43
42
|
end
|
44
|
-
memoize :
|
43
|
+
memoize :portability_cxx_ldflags
|
45
44
|
|
46
45
|
# Extra compiler flags that should always be passed to the C compiler,
|
47
46
|
# last in the command string.
|
@@ -196,6 +195,21 @@ private
|
|
196
195
|
return flags.compact.map{ |str| str.strip }.join(" ").strip
|
197
196
|
end
|
198
197
|
private_class_method :default_extra_c_or_cxxflags
|
198
|
+
|
199
|
+
def self.portability_c_or_cxx_ldflags(cc_or_cxx)
|
200
|
+
result = ''
|
201
|
+
result << cxx_11_flag if cc_or_cxx == :cxx && cxx_11_flag
|
202
|
+
if os_name =~ /solaris/
|
203
|
+
result << ' -lxnet -lsocket -lnsl -lpthread'
|
204
|
+
else
|
205
|
+
result << ' -lpthread'
|
206
|
+
end
|
207
|
+
result << ' -lrt' if has_rt_library?
|
208
|
+
result << ' -lmath' if has_math_library?
|
209
|
+
result.strip!
|
210
|
+
return result
|
211
|
+
end
|
212
|
+
private_class_method :portability_c_or_cxx_ldflags
|
199
213
|
end
|
200
214
|
|
201
215
|
end # module PhusionPassenger
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
3
|
+
PhusionPassenger.require_passenger_lib 'platform_info/linux'
|
4
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
5
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
6
|
+
PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
|
7
7
|
|
8
8
|
module PhusionPassenger
|
9
9
|
module PlatformInfo
|
@@ -261,7 +261,7 @@ module Depcheck
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def install_osx_command_line_tools
|
264
|
-
|
264
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
265
265
|
if PlatformInfo.xcode_select_version.to_s >= "2333"
|
266
266
|
install_instructions "Please install the Xcode command line tools: " +
|
267
267
|
"<b>sudo xcode-select --install</b>"
|
@@ -21,8 +21,8 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
26
26
|
|
27
27
|
module PhusionPassenger
|
28
28
|
|
@@ -22,13 +22,15 @@
|
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
24
|
require 'rbconfig'
|
25
|
-
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
26
26
|
|
27
27
|
module PhusionPassenger
|
28
28
|
|
29
29
|
module PlatformInfo
|
30
30
|
# Returns the operating system's name. This name is in lowercase and contains no spaces,
|
31
|
-
# and thus is suitable to be used in some kind of ID.
|
31
|
+
# and thus is suitable to be used in some kind of ID. It may contain a version number.
|
32
|
+
# Linux is always identified as "linux". OS X is always identified as "macosx".
|
33
|
+
# Identifiers for other operating systems may contain a version number, e.g. "freebsd10".
|
32
34
|
def self.os_name
|
33
35
|
if rb_config['target_os'] =~ /darwin/ && (sw_vers = find_command('sw_vers'))
|
34
36
|
return "macosx"
|
@@ -49,6 +51,22 @@ module PlatformInfo
|
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
54
|
+
# Returns the `uname` command, or nil if `uname` cannot be found.
|
55
|
+
# In addition to looking for `uname` in `PATH`, this method also looks
|
56
|
+
# for `uname` in /bin and /usr/bin, just in case the user didn't
|
57
|
+
# configure its PATH properly.
|
58
|
+
def self.uname_command
|
59
|
+
if result = find_command("uname")
|
60
|
+
result
|
61
|
+
elsif File.exist?("/bin/uname")
|
62
|
+
return "/bin/uname"
|
63
|
+
elsif File.exist?("/usr/bin/uname")
|
64
|
+
return "/usr/bin/uname"
|
65
|
+
else
|
66
|
+
return nil
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
52
70
|
# Returns a list of all CPU architecture names that the current machine CPU
|
53
71
|
# supports. If there are multiple such architectures then the first item in
|
54
72
|
# the result denotes that OS runtime's main/preferred architecture.
|
@@ -77,8 +95,10 @@ module PlatformInfo
|
|
77
95
|
# everything is 64-bit by default. The latter result indicates an OS X
|
78
96
|
# version older than 10.6.
|
79
97
|
def self.cpu_architectures
|
98
|
+
uname = uname_command
|
99
|
+
raise "The 'uname' command cannot be found" if !uname
|
80
100
|
if os_name == "macosx"
|
81
|
-
arch =
|
101
|
+
arch = `#{uname} -p`.strip
|
82
102
|
if arch == "i386"
|
83
103
|
# Macs have been x86 since around 2007. I think all of them come with
|
84
104
|
# a recent enough Intel CPU that supports both x86 and x86_64, and I
|
@@ -97,12 +117,12 @@ module PlatformInfo
|
|
97
117
|
arch
|
98
118
|
end
|
99
119
|
else
|
100
|
-
arch =
|
120
|
+
arch = `#{uname} -p`.strip
|
101
121
|
# On some systems 'uname -p' returns something like
|
102
122
|
# 'Intel(R) Pentium(R) M processor 1400MHz' or
|
103
123
|
# 'Intel(R)_Xeon(R)_CPU___________X7460__@_2.66GHz'.
|
104
124
|
if arch == "unknown" || arch =~ / / || arch =~ /Hz$/
|
105
|
-
arch =
|
125
|
+
arch = `#{uname} -m`.strip
|
106
126
|
end
|
107
127
|
if arch =~ /^i.86$/
|
108
128
|
arch = "x86"
|
@@ -23,8 +23,8 @@
|
|
23
23
|
|
24
24
|
require 'rbconfig'
|
25
25
|
require 'etc'
|
26
|
-
|
27
|
-
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
27
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
28
28
|
|
29
29
|
module PhusionPassenger
|
30
30
|
|
@@ -155,8 +155,11 @@ module PlatformInfo
|
|
155
155
|
# Returns whether running 'gem install' as the current user requires sudo.
|
156
156
|
def self.gem_install_requires_sudo?
|
157
157
|
`#{gem_command} env` =~ /INSTALLATION DIRECTORY: (.+)/
|
158
|
-
install_dir = $1
|
159
|
-
|
158
|
+
if install_dir = $1
|
159
|
+
return !File.writable?(install_dir)
|
160
|
+
else
|
161
|
+
return nil
|
162
|
+
end
|
160
163
|
end
|
161
164
|
memoize :gem_install_requires_sudo?
|
162
165
|
|
@@ -44,7 +44,7 @@ class << self
|
|
44
44
|
def install_framework_extensions!(*args)
|
45
45
|
require 'active_support/version' if defined?(::ActiveSupport) && !defined?(::ActiveSupport::VERSION)
|
46
46
|
if defined?(::ActiveSupport) && ::ActiveSupport::VERSION::MAJOR >= 3
|
47
|
-
|
47
|
+
PhusionPassenger.require_passenger_lib 'active_support3_extensions/init'
|
48
48
|
ActiveSupport3Extensions.init!(PhusionPassenger::App.options, *args)
|
49
49
|
end
|
50
50
|
end
|
@@ -24,15 +24,14 @@
|
|
24
24
|
|
25
25
|
require 'socket'
|
26
26
|
require 'fcntl'
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
require 'phusion_passenger/request_handler/thread_handler'
|
27
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
28
|
+
PhusionPassenger.require_passenger_lib 'public_api'
|
29
|
+
PhusionPassenger.require_passenger_lib 'message_client'
|
30
|
+
PhusionPassenger.require_passenger_lib 'debug_logging'
|
31
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
32
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
33
|
+
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
34
|
+
PhusionPassenger.require_passenger_lib 'request_handler/thread_handler'
|
36
35
|
|
37
36
|
module PhusionPassenger
|
38
37
|
|
@@ -21,11 +21,11 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
25
|
+
PhusionPassenger.require_passenger_lib 'debug_logging'
|
26
|
+
PhusionPassenger.require_passenger_lib 'message_channel'
|
27
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
28
|
+
PhusionPassenger.require_passenger_lib 'utils/unseekable_socket'
|
29
29
|
|
30
30
|
module PhusionPassenger
|
31
31
|
class RequestHandler
|
@@ -40,11 +40,12 @@ class ThreadHandler
|
|
40
40
|
end
|
41
41
|
|
42
42
|
REQUEST_METHOD = 'REQUEST_METHOD'.freeze
|
43
|
+
GET = 'GET'.freeze
|
43
44
|
PING = 'PING'.freeze
|
44
45
|
OOBW = 'OOBW'.freeze
|
45
46
|
PASSENGER_CONNECT_PASSWORD = 'PASSENGER_CONNECT_PASSWORD'.freeze
|
46
47
|
CONTENT_LENGTH = 'CONTENT_LENGTH'.freeze
|
47
|
-
|
48
|
+
HTTP_TRANSFER_ENCODING = 'HTTP_TRANSFER_ENCODING'.freeze
|
48
49
|
|
49
50
|
MAX_HEADER_SIZE = 128 * 1024
|
50
51
|
|
@@ -177,7 +178,7 @@ private
|
|
177
178
|
if connection && !connection.closed?
|
178
179
|
begin
|
179
180
|
connection.close_write
|
180
|
-
rescue SystemCallError
|
181
|
+
rescue SystemCallError, IOError
|
181
182
|
end
|
182
183
|
begin
|
183
184
|
connection.close
|
@@ -275,8 +276,7 @@ private
|
|
275
276
|
# end
|
276
277
|
|
277
278
|
def prepare_request(connection, headers)
|
278
|
-
if
|
279
|
-
headers[CONTENT_LENGTH] == 0
|
279
|
+
if !may_have_request_body?(headers)
|
280
280
|
connection.simulate_eof!
|
281
281
|
end
|
282
282
|
|
@@ -384,6 +384,18 @@ private
|
|
384
384
|
end
|
385
385
|
end
|
386
386
|
|
387
|
+
def may_have_request_body?(headers)
|
388
|
+
if headers[REQUEST_METHOD] == GET
|
389
|
+
if content_length = headers[CONTENT_LENGTH]
|
390
|
+
return content_length != 0
|
391
|
+
else
|
392
|
+
return headers.has_key?(HTTP_TRANSFER_ENCODING)
|
393
|
+
end
|
394
|
+
else
|
395
|
+
return true
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
387
399
|
def should_reraise_error?(e)
|
388
400
|
# Stubable by unit tests.
|
389
401
|
return true
|