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
@@ -25,7 +25,8 @@ SOURCE_ROOT = File.expand_path("../..", File.dirname(__FILE__))
|
|
25
25
|
Dir.chdir(SOURCE_ROOT)
|
26
26
|
$LOAD_PATH.unshift("#{SOURCE_ROOT}/lib")
|
27
27
|
require 'phusion_passenger'
|
28
|
-
|
28
|
+
PhusionPassenger.locate_directories
|
29
|
+
PhusionPassenger.require_passenger_lib 'packaging'
|
29
30
|
require 'rubygems'
|
30
31
|
require 'tmpdir'
|
31
32
|
require 'fileutils'
|
@@ -2,7 +2,8 @@ source_root = File.expand_path("../..", File.dirname(__FILE__))
|
|
2
2
|
$LOAD_PATH.unshift("#{source_root}/lib")
|
3
3
|
require 'phusion_passenger'
|
4
4
|
PhusionPassenger.locate_directories
|
5
|
-
|
5
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
6
|
+
PhusionPassenger.require_passenger_lib 'platform_info/binary_compatibility'
|
6
7
|
require 'tmpdir'
|
7
8
|
require 'fileutils'
|
8
9
|
require 'webrick'
|
@@ -16,6 +17,8 @@ ENV.delete('PASSENGER_DEBUG')
|
|
16
17
|
ENV['PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY'] = '0'
|
17
18
|
ENV['PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY'] = '0'
|
18
19
|
|
20
|
+
module PhusionPassenger
|
21
|
+
|
19
22
|
describe "Passenger Standalone" do
|
20
23
|
after :each do
|
21
24
|
ENV.delete('PASSENGER_DEBUG')
|
@@ -85,11 +88,11 @@ describe "Passenger Standalone" do
|
|
85
88
|
end
|
86
89
|
|
87
90
|
def create_dummy_nginx_binary
|
88
|
-
File.open("
|
91
|
+
File.open("PassengerWebHelper", "w") do |f|
|
89
92
|
f.puts "#!/bin/bash"
|
90
93
|
f.puts "echo nginx version: 1.0.0"
|
91
94
|
end
|
92
|
-
File.chmod(0755, "
|
95
|
+
File.chmod(0755, "PassengerWebHelper")
|
93
96
|
end
|
94
97
|
|
95
98
|
def create_file(filename, contents = nil)
|
@@ -114,10 +117,10 @@ describe "Passenger Standalone" do
|
|
114
117
|
end
|
115
118
|
|
116
119
|
describe "start command" do
|
117
|
-
SUPPORT_BINARIES_DOWNLOAD_MESSAGE = "Downloading
|
118
|
-
NGINX_BINARY_DOWNLOAD_MESSAGE = "Downloading
|
119
|
-
NGINX_SOURCE_DOWNLOAD_MESSAGE = "Downloading
|
120
|
-
COMPILING_MESSAGE = "Installing
|
120
|
+
SUPPORT_BINARIES_DOWNLOAD_MESSAGE = " --> Downloading #{PROGRAM_NAME} support binaries for your platform"
|
121
|
+
NGINX_BINARY_DOWNLOAD_MESSAGE = "Downloading web helper for your platform"
|
122
|
+
NGINX_SOURCE_DOWNLOAD_MESSAGE = "Downloading web helper source code..."
|
123
|
+
COMPILING_MESSAGE = "Installing #{PROGRAM_NAME} Standalone..."
|
121
124
|
|
122
125
|
def test_serving_application(passenger_command)
|
123
126
|
Dir.chdir(@runtime_dir) do
|
@@ -150,7 +153,7 @@ describe "Passenger Standalone" do
|
|
150
153
|
|
151
154
|
Dir.mkdir("#{@webroot}/#{version}")
|
152
155
|
Dir.chdir("#{@webroot}/#{version}") do
|
153
|
-
create_tarball("
|
156
|
+
create_tarball("webhelper-#{nginx_version}-#{compat_id}.tar.gz") do
|
154
157
|
create_dummy_nginx_binary
|
155
158
|
end
|
156
159
|
create_tarball("support-#{compat_id}.tar.gz") do
|
@@ -198,16 +201,16 @@ describe "Passenger Standalone" do
|
|
198
201
|
test_serving_application(command)
|
199
202
|
end
|
200
203
|
|
201
|
-
specify "if the downloaded support binaries work but the
|
202
|
-
"and
|
204
|
+
specify "if the downloaded support binaries work but the downloaded web helper binary doesn't, " +
|
205
|
+
"and web helper compilation doesn't succeed the first time, then web helper compilation " +
|
203
206
|
"succeeds the second time" do
|
204
207
|
Dir.chdir("#{@webroot}/#{version}") do
|
205
208
|
create_tarball("support-#{compat_id}.tar.gz") do
|
206
209
|
FileUtils.cp_r(Dir["#{PhusionPassenger.source_root}/buildout/*"],
|
207
210
|
".")
|
208
211
|
end
|
209
|
-
create_tarball("
|
210
|
-
create_file("
|
212
|
+
create_tarball("webhelper-#{nginx_version}-#{compat_id}.tar.gz") do
|
213
|
+
create_file("PassengerWebHelper",
|
211
214
|
"#!/bin/sh\n" +
|
212
215
|
"exit 1\n")
|
213
216
|
end
|
@@ -225,10 +228,10 @@ describe "Passenger Standalone" do
|
|
225
228
|
@output = `#{command} --runtime-check-only --no-compile-runtime 2>&1`
|
226
229
|
$?.exitstatus.should_not == 0
|
227
230
|
@output.should include(SUPPORT_BINARIES_DOWNLOAD_MESSAGE)
|
228
|
-
@output.should include("All
|
231
|
+
@output.should include("All good\n")
|
229
232
|
@output.should include(NGINX_BINARY_DOWNLOAD_MESSAGE)
|
230
|
-
@output.should include("
|
231
|
-
@output.should include("Refusing to compile the Phusion Passenger Standalone")
|
233
|
+
@output.should include("Not usable, will compile from source")
|
234
|
+
@output.should include("Refusing to compile the Phusion Passenger Standalone runtime")
|
232
235
|
|
233
236
|
@output = capture_output("#{command} --runtime-check-only")
|
234
237
|
@output.should include(NGINX_SOURCE_DOWNLOAD_MESSAGE)
|
@@ -255,18 +258,28 @@ describe "Passenger Standalone" do
|
|
255
258
|
context "when natively packaged" do
|
256
259
|
before :each do
|
257
260
|
sh "passenger-config --make-locations-ini > '#{@runtime_dir}/locations.ini'"
|
261
|
+
File.open("#{@runtime_dir}/locations.ini", "r+") do |f|
|
262
|
+
data = f.read
|
263
|
+
data.sub!(/natively_packaged=.*/, 'natively_packaged=true')
|
264
|
+
if !data.sub!(/native_packaging_method=.*/, 'native_packaging_method=deb')
|
265
|
+
data << "native_packaging_method=deb\n"
|
266
|
+
end
|
267
|
+
f.rewind
|
268
|
+
f.truncate(0)
|
269
|
+
f.write(data)
|
270
|
+
end
|
258
271
|
ENV['PASSENGER_LOCATION_CONFIGURATION_FILE'] = "#{@runtime_dir}/locations.ini"
|
259
|
-
create_file("#{PhusionPassenger.lib_dir}/
|
272
|
+
create_file("#{PhusionPassenger.lib_dir}/PassengerWebHelper")
|
260
273
|
end
|
261
274
|
|
262
275
|
after :each do
|
263
276
|
ENV.delete('PASSENGER_LOCATION_CONFIGURATION_FILE')
|
264
|
-
File.unlink("#{PhusionPassenger.lib_dir}/
|
277
|
+
File.unlink("#{PhusionPassenger.lib_dir}/PassengerWebHelper")
|
265
278
|
end
|
266
279
|
|
267
280
|
it "downloads only the Nginx binary from the Internet" do
|
268
|
-
File.rename("#{@webroot}/#{version}/
|
269
|
-
"#{@webroot}/#{version}/
|
281
|
+
File.rename("#{@webroot}/#{version}/webhelper-#{nginx_version}-#{compat_id}.tar.gz",
|
282
|
+
"#{@webroot}/#{version}/webhelper-0.0.1-#{compat_id}.tar.gz")
|
270
283
|
@output = capture_output("passenger start " +
|
271
284
|
"--runtime-dir '#{@runtime_dir}' " +
|
272
285
|
"--runtime-check-only " +
|
@@ -321,3 +334,5 @@ describe "Passenger Standalone" do
|
|
321
334
|
end
|
322
335
|
end
|
323
336
|
end
|
337
|
+
|
338
|
+
end # module PhusionPassenger
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
require 'fileutils'
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
4
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
5
|
+
PhusionPassenger.require_passenger_lib 'admin_tools'
|
6
|
+
PhusionPassenger.require_passenger_lib 'admin_tools/server_instance'
|
7
7
|
|
8
8
|
module PhusionPassenger
|
9
9
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
|
2
|
+
PhusionPassenger.require_passenger_lib 'debug_logging'
|
3
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
4
4
|
require 'stringio'
|
5
5
|
|
6
6
|
module PhusionPassenger
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
PhusionPassenger.require_passenger_lib 'request_handler'
|
3
|
+
PhusionPassenger.require_passenger_lib 'request_handler/thread_handler'
|
4
|
+
PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension'
|
5
|
+
PhusionPassenger.require_passenger_lib 'analytics_logger'
|
6
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
7
7
|
|
8
8
|
require 'fileutils'
|
9
9
|
|
@@ -328,78 +328,185 @@ describe RequestHandler do
|
|
328
328
|
hijack_callback_called.should == true
|
329
329
|
end
|
330
330
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
include Rack::ThreadHandlerExtension
|
335
|
-
end
|
331
|
+
specify "GET requests with Content-Length are assumed to have a request body" do
|
332
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
333
|
+
include Rack::ThreadHandlerExtension
|
336
334
|
end
|
337
335
|
|
338
|
-
|
339
|
-
lambda_called = false
|
336
|
+
lambda_called = false
|
340
337
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
338
|
+
@options["app"] = lambda do |env|
|
339
|
+
lambda_called = true
|
340
|
+
env['rack.input'].read(3).should == "abc"
|
341
|
+
[200, {}, ["ok"]]
|
342
|
+
end
|
346
343
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
344
|
+
@request_handler = RequestHandler.new(@owner_pipe[1], @options)
|
345
|
+
@request_handler.start_main_loop_thread
|
346
|
+
client = connect
|
347
|
+
begin
|
348
|
+
send_binary_request(client,
|
349
|
+
"REQUEST_METHOD" => "GET",
|
350
|
+
"PATH_INFO" => "/",
|
351
|
+
"CONTENT_LENGTH" => "3")
|
352
|
+
client.write("abc")
|
353
|
+
client.close_write
|
354
|
+
client.read.should ==
|
355
|
+
"Status: 200\r\n" +
|
356
|
+
"\r\n" +
|
357
|
+
"ok"
|
358
|
+
ensure
|
359
|
+
client.close
|
360
|
+
end
|
364
361
|
|
365
|
-
|
362
|
+
lambda_called.should be_true
|
363
|
+
end
|
364
|
+
|
365
|
+
specify "GET requests with Transfer-Encoding are assumed to have a request body" do
|
366
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
367
|
+
include Rack::ThreadHandlerExtension
|
366
368
|
end
|
369
|
+
|
370
|
+
lambda_called = false
|
371
|
+
|
372
|
+
@options["app"] = lambda do |env|
|
373
|
+
lambda_called = true
|
374
|
+
env['rack.input'].read(13).should ==
|
375
|
+
"3\r\n" +
|
376
|
+
"abc\r\n" +
|
377
|
+
"0\r\n\r\n"
|
378
|
+
[200, {}, ["ok"]]
|
379
|
+
end
|
380
|
+
|
381
|
+
@request_handler = RequestHandler.new(@owner_pipe[1], @options)
|
382
|
+
@request_handler.start_main_loop_thread
|
383
|
+
client = connect
|
384
|
+
begin
|
385
|
+
send_binary_request(client,
|
386
|
+
"REQUEST_METHOD" => "GET",
|
387
|
+
"PATH_INFO" => "/",
|
388
|
+
"HTTP_TRANSFER_ENCODING" => "chunked")
|
389
|
+
client.write(
|
390
|
+
"3\r\n" +
|
391
|
+
"abc\r\n" +
|
392
|
+
"0\r\n\r\n")
|
393
|
+
client.close_write
|
394
|
+
client.read.should ==
|
395
|
+
"Status: 200\r\n" +
|
396
|
+
"\r\n" +
|
397
|
+
"ok"
|
398
|
+
ensure
|
399
|
+
client.close
|
400
|
+
end
|
401
|
+
|
402
|
+
lambda_called.should be_true
|
367
403
|
end
|
368
404
|
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
include Rack::ThreadHandlerExtension
|
373
|
-
end
|
405
|
+
specify "GET requests with neither Content-Length nor Transfer-Encoding are assumed to have no request body" do
|
406
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
407
|
+
include Rack::ThreadHandlerExtension
|
374
408
|
end
|
375
409
|
|
376
|
-
|
377
|
-
lambda_called = false
|
410
|
+
lambda_called = false
|
378
411
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
412
|
+
@options["app"] = lambda do |env|
|
413
|
+
lambda_called = true
|
414
|
+
env['rack.input'].read(1).should be_nil
|
415
|
+
env['rack.input'].gets.should be_nil
|
416
|
+
[200, {}, ["ok"]]
|
417
|
+
end
|
385
418
|
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
419
|
+
@request_handler = RequestHandler.new(@owner_pipe[1], @options)
|
420
|
+
@request_handler.start_main_loop_thread
|
421
|
+
client = connect
|
422
|
+
begin
|
423
|
+
send_binary_request(client,
|
424
|
+
"REQUEST_METHOD" => "GET",
|
425
|
+
"PATH_INFO" => "/")
|
426
|
+
client.close_write
|
427
|
+
client.read.should ==
|
428
|
+
"Status: 200\r\n" +
|
429
|
+
"\r\n" +
|
430
|
+
"ok"
|
431
|
+
ensure
|
432
|
+
client.close
|
433
|
+
end
|
401
434
|
|
402
|
-
|
435
|
+
lambda_called.should be_true
|
436
|
+
end
|
437
|
+
|
438
|
+
specify "GET requests with Content-Length 0 are assumed to have no request body" do
|
439
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
440
|
+
include Rack::ThreadHandlerExtension
|
441
|
+
end
|
442
|
+
|
443
|
+
lambda_called = false
|
444
|
+
|
445
|
+
@options["app"] = lambda do |env|
|
446
|
+
lambda_called = true
|
447
|
+
env['rack.input'].read(1).should be_nil
|
448
|
+
env['rack.input'].gets.should be_nil
|
449
|
+
[200, {}, ["ok"]]
|
450
|
+
end
|
451
|
+
|
452
|
+
@request_handler = RequestHandler.new(@owner_pipe[1], @options)
|
453
|
+
@request_handler.start_main_loop_thread
|
454
|
+
client = connect
|
455
|
+
begin
|
456
|
+
send_binary_request(client,
|
457
|
+
"REQUEST_METHOD" => "GET",
|
458
|
+
"PATH_INFO" => "/",
|
459
|
+
"CONTENT_LENGTH" => "0")
|
460
|
+
client.close_write
|
461
|
+
client.read.should ==
|
462
|
+
"Status: 200\r\n" +
|
463
|
+
"\r\n" +
|
464
|
+
"ok"
|
465
|
+
ensure
|
466
|
+
client.close
|
467
|
+
end
|
468
|
+
|
469
|
+
lambda_called.should be_true
|
470
|
+
end
|
471
|
+
|
472
|
+
specify "non-GET requests are assumed to have a request body, even those without Content-Length and Transfer-Encoding" do
|
473
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
474
|
+
include Rack::ThreadHandlerExtension
|
475
|
+
end
|
476
|
+
|
477
|
+
lambda_called = false
|
478
|
+
|
479
|
+
@options["app"] = lambda do |env|
|
480
|
+
lambda_called = true
|
481
|
+
env['rack.input'].read(3).should == "abc"
|
482
|
+
[200, {}, ["ok"]]
|
483
|
+
end
|
484
|
+
|
485
|
+
@request_handler = RequestHandler.new(@owner_pipe[1], @options)
|
486
|
+
@request_handler.start_main_loop_thread
|
487
|
+
client = connect
|
488
|
+
begin
|
489
|
+
send_binary_request(client,
|
490
|
+
"REQUEST_METHOD" => "POST",
|
491
|
+
"PATH_INFO" => "/")
|
492
|
+
client.write("abc")
|
493
|
+
client.close_write
|
494
|
+
client.read.should ==
|
495
|
+
"Status: 200\r\n" +
|
496
|
+
"\r\n" +
|
497
|
+
"ok"
|
498
|
+
ensure
|
499
|
+
client.close
|
500
|
+
end
|
501
|
+
|
502
|
+
lambda_called.should be_true
|
503
|
+
end
|
504
|
+
|
505
|
+
describe "on GET requests that are not supposed to have a body" do
|
506
|
+
before :each do
|
507
|
+
@options["thread_handler"] = Class.new(RequestHandler::ThreadHandler) do
|
508
|
+
include Rack::ThreadHandlerExtension
|
509
|
+
end
|
403
510
|
end
|
404
511
|
|
405
512
|
it "allows reading from the client socket once the socket has been fully hijacked" do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'socket'
|
2
|
-
|
3
|
-
|
2
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
3
|
+
PhusionPassenger.require_passenger_lib 'message_channel'
|
4
4
|
|
5
5
|
module PhusionPassenger
|
6
6
|
|
@@ -234,12 +234,12 @@ shared_examples_for "a loader" do
|
|
234
234
|
result[:status].should == "Ready"
|
235
235
|
headers, body = perform_request(
|
236
236
|
"REQUEST_METHOD" => "GET",
|
237
|
-
"PATH_INFO" => "/
|
237
|
+
"PATH_INFO" => "/",
|
238
238
|
# For Rails 2
|
239
|
-
"REQUEST_URI" => "/
|
239
|
+
"REQUEST_URI" => "/"
|
240
240
|
)
|
241
241
|
headers["Status"].should == "200"
|
242
|
-
body.should == "
|
242
|
+
body.should == "front page"
|
243
243
|
end
|
244
244
|
end
|
245
245
|
|