passenger 2.1.3 → 2.2.0
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/DEVELOPERS.TXT +2 -0
- data/INSTALL +3 -1
- data/LICENSE +19 -355
- data/NEWS +3 -0
- data/README +11 -4
- data/Rakefile +435 -236
- data/bin/passenger-config +20 -14
- data/bin/passenger-install-apache2-module +67 -201
- data/bin/passenger-install-nginx-module +477 -0
- data/bin/passenger-make-enterprisey +17 -12
- data/bin/passenger-memory-stats +33 -23
- data/bin/passenger-spawn-server +17 -12
- data/bin/passenger-status +18 -13
- data/bin/passenger-stress-test +17 -12
- data/doc/{Users guide.html → Users guide Apache.html } +79 -61
- data/doc/{Users guide.txt → Users guide Apache.txt } +43 -939
- data/doc/Users guide Nginx.html +2276 -0
- data/doc/Users guide Nginx.txt +776 -0
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +9 -4
- data/doc/cxxapi/ApplicationPool_8h-source.html +9 -4
- data/doc/cxxapi/Application_8h-source.html +26 -21
- data/doc/cxxapi/Bucket_8h-source.html +54 -44
- data/doc/cxxapi/CachedFileStat_8h-source.html +9 -4
- data/doc/cxxapi/Configuration_8h-source.html +357 -339
- data/doc/cxxapi/DirectoryMapper_8h-source.html +294 -280
- data/doc/cxxapi/DummySpawnManager_8h-source.html +9 -4
- data/doc/cxxapi/Exceptions_8h-source.html +9 -4
- data/doc/cxxapi/FileChecker_8h-source.html +9 -4
- data/doc/cxxapi/Hooks_8h-source.html +50 -40
- data/doc/cxxapi/Logging_8h-source.html +9 -4
- data/doc/cxxapi/MessageChannel_8h-source.html +20 -15
- data/doc/cxxapi/PoolOptions_8h-source.html +10 -5
- data/doc/cxxapi/SpawnManager_8h-source.html +9 -4
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +10 -5
- data/doc/cxxapi/SystemTime_8h-source.html +9 -4
- data/doc/cxxapi/Utils_8h-source.html +242 -214
- data/doc/cxxapi/annotated.html +4 -28
- data/doc/cxxapi/classClient-members.html +4 -4
- data/doc/cxxapi/classClient.html +14 -11
- data/doc/cxxapi/classHooks-members.html +4 -5
- data/doc/cxxapi/classHooks.html +26 -24
- data/doc/cxxapi/classPassenger_1_1Application-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1Application.html +40 -37
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +95 -92
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +26 -23
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +17 -17
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +139 -136
- data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +13 -10
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1BusyException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +4 -5
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +45 -43
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +13 -10
- data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileChecker.html +22 -19
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +12 -9
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +14 -11
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1IOException.html +12 -9
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +228 -225
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +14 -11
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +50 -47
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +73 -70
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SystemException.html +17 -14
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SystemTime.html +14 -11
- data/doc/cxxapi/classes.html +35 -0
- data/doc/cxxapi/definitions_8h-source.html +9 -4
- data/doc/cxxapi/doxygen.css +311 -303
- data/doc/cxxapi/files.html +9 -18
- data/doc/cxxapi/functions.html +5 -224
- data/doc/cxxapi/functions_func.html +5 -185
- data/doc/cxxapi/functions_type.html +4 -4
- data/doc/cxxapi/functions_vars.html +4 -4
- data/doc/cxxapi/graph_legend.dot +19 -19
- data/doc/cxxapi/graph_legend.html +5 -5
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +11 -13
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +10 -12
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +5 -7
- data/doc/cxxapi/group__Hooks.html +5 -7
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +5 -624
- data/doc/cxxapi/hierarchy.html +6 -6
- data/doc/cxxapi/inherit__graph__0.map +1 -1
- data/doc/cxxapi/inherit__graph__0.md5 +1 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +1 -1
- data/doc/cxxapi/inherit__graph__1.md5 +1 -1
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -1
- data/doc/cxxapi/inherit__graph__10.md5 +1 -1
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +1 -1
- data/doc/cxxapi/inherit__graph__11.md5 +1 -1
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +1 -1
- data/doc/cxxapi/inherit__graph__12.md5 +1 -1
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +1 -2
- data/doc/cxxapi/inherit__graph__13.md5 +1 -1
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +2 -1
- data/doc/cxxapi/inherit__graph__14.md5 +1 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +1 -1
- data/doc/cxxapi/inherit__graph__15.md5 +1 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +1 -1
- data/doc/cxxapi/inherit__graph__16.md5 +1 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +1 -1
- data/doc/cxxapi/inherit__graph__17.md5 +1 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +1 -1
- data/doc/cxxapi/inherit__graph__18.md5 +1 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +1 -1
- data/doc/cxxapi/inherit__graph__19.md5 +1 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +1 -1
- data/doc/cxxapi/inherit__graph__2.md5 +1 -1
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +2 -2
- data/doc/cxxapi/inherit__graph__20.md5 +1 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +1 -1
- data/doc/cxxapi/inherit__graph__21.md5 +1 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +1 -1
- data/doc/cxxapi/inherit__graph__3.md5 +1 -1
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +1 -1
- data/doc/cxxapi/inherit__graph__4.md5 +1 -1
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +1 -2
- data/doc/cxxapi/inherit__graph__5.md5 +1 -1
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +2 -1
- data/doc/cxxapi/inherit__graph__6.md5 +1 -1
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +1 -1
- data/doc/cxxapi/inherit__graph__7.md5 +1 -1
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +1 -1
- data/doc/cxxapi/inherit__graph__8.md5 +1 -1
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +1 -1
- data/doc/cxxapi/inherit__graph__9.md5 +1 -1
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +41 -41
- data/doc/cxxapi/main.html +4 -4
- data/doc/cxxapi/modules.html +4 -5
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +4 -4
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +13 -10
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +5 -5
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +16 -13
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +4 -4
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +63 -60
- data/doc/cxxapi/tabs.css +5 -2
- data/doc/cxxapi/tree.html +7 -81
- data/doc/rdoc/classes/ConditionVariable.html +59 -59
- data/doc/rdoc/classes/Exception.html +11 -11
- data/doc/rdoc/classes/GC.html +4 -4
- data/doc/rdoc/classes/IO.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger.html +75 -20
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +153 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +125 -130
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +236 -236
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +213 -213
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +28 -28
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +91 -75
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/Application.html +64 -64
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +34 -34
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +13 -13
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +30 -30
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +136 -136
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +24 -24
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +42 -42
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +55 -53
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +25 -30
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +23 -23
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +116 -117
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +22 -22
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +118 -124
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +354 -354
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +9 -9
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +37 -37
- data/doc/rdoc/classes/PlatformInfo.html +282 -261
- data/doc/rdoc/classes/RakeExtensions.html +7 -7
- data/doc/rdoc/classes/Signal.html +26 -26
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +6 -1
- data/doc/rdoc/files/README.html +15 -6
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +20 -13
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +31 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +31 -1
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +22 -12
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +27 -21
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +21 -12
- data/doc/rdoc/files/misc/rake/extensions_rb.html +21 -12
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_file_index.html +2 -0
- data/doc/rdoc/fr_method_index.html +116 -112
- data/doc/users_guide_snippets/analysis_and_system_maintenance_tools.txt +144 -0
- data/doc/users_guide_snippets/appendix_a_about.txt +13 -0
- data/doc/users_guide_snippets/appendix_b_terminology.txt +63 -0
- data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +304 -0
- data/doc/users_guide_snippets/global_queueing_explained.txt +78 -0
- data/doc/users_guide_snippets/rackup_specifications.txt +75 -0
- data/doc/users_guide_snippets/rails_spawn_method.txt +48 -0
- data/doc/users_guide_snippets/tips.txt +173 -0
- data/ext/apache2/Bucket.cpp +17 -12
- data/ext/apache2/Bucket.h +17 -12
- data/ext/apache2/Configuration.cpp +17 -12
- data/ext/apache2/Configuration.h +27 -14
- data/ext/apache2/DirectoryMapper.h +21 -12
- data/ext/apache2/Hooks.cpp +67 -21
- data/ext/apache2/Hooks.h +17 -12
- data/ext/apache2/mod_passenger.c +17 -12
- data/ext/{apache2 → common}/Application.h +19 -14
- data/ext/{apache2 → common}/ApplicationPool.h +17 -12
- data/ext/{apache2 → common}/ApplicationPoolServer.h +18 -72
- data/ext/{apache2 → common}/ApplicationPoolServerExecutable.cpp +45 -104
- data/ext/common/ApplicationPoolStatusReporter.h +212 -0
- data/ext/{apache2 → common}/CachedFileStat.cpp +17 -12
- data/ext/{apache2 → common}/CachedFileStat.h +17 -12
- data/ext/{apache2 → common}/DummySpawnManager.h +17 -12
- data/ext/{apache2 → common}/Exceptions.h +17 -12
- data/ext/{apache2 → common}/FileChecker.h +17 -12
- data/ext/common/Logging.cpp +65 -0
- data/ext/{apache2 → common}/Logging.h +17 -12
- data/ext/{apache2 → common}/MessageChannel.h +17 -12
- data/ext/{apache2 → common}/PoolOptions.h +17 -12
- data/ext/{apache2 → common}/SpawnManager.h +17 -12
- data/ext/{apache2 → common}/StandardApplicationPool.h +17 -12
- data/ext/common/StaticString.h +147 -0
- data/ext/common/SystemTime.cpp +33 -0
- data/ext/{apache2 → common}/SystemTime.h +17 -12
- data/ext/{apache2 → common}/Utils.cpp +69 -12
- data/ext/{apache2 → common}/Utils.h +41 -12
- data/ext/nginx/Configuration.c +1091 -0
- data/ext/nginx/Configuration.h +71 -0
- data/ext/nginx/ContentHandler.c +1154 -0
- data/ext/nginx/ContentHandler.h +64 -0
- data/ext/nginx/HelperServer.cpp +857 -0
- data/ext/nginx/HttpStatusExtractor.h +161 -0
- data/ext/nginx/ScgiRequestParser.h +317 -0
- data/ext/nginx/StaticContentHandler.c +222 -0
- data/ext/nginx/StaticContentHandler.h +37 -0
- data/ext/nginx/config +41 -0
- data/ext/nginx/ngx_http_passenger_module.c +572 -0
- data/ext/nginx/ngx_http_passenger_module.h +72 -0
- data/ext/oxt/backtrace.cpp +8 -1
- data/ext/oxt/system_calls.cpp +40 -0
- data/ext/oxt/system_calls.hpp +14 -7
- data/ext/phusion_passenger/extconf.rb +17 -12
- data/ext/phusion_passenger/native_support.c +19 -12
- data/lib/phusion_passenger/abstract_installer.rb +196 -0
- data/lib/phusion_passenger/abstract_request_handler.rb +19 -24
- data/lib/phusion_passenger/abstract_server.rb +17 -12
- data/lib/phusion_passenger/abstract_server_collection.rb +17 -12
- data/lib/phusion_passenger/admin_tools.rb +23 -0
- data/lib/phusion_passenger/admin_tools/control_process.rb +39 -13
- data/lib/phusion_passenger/application.rb +17 -12
- data/lib/phusion_passenger/console_text_template.rb +17 -12
- data/lib/phusion_passenger/constants.rb +22 -11
- data/lib/phusion_passenger/dependencies.rb +47 -12
- data/lib/phusion_passenger/events.rb +17 -12
- data/lib/phusion_passenger/exceptions.rb +17 -12
- data/lib/phusion_passenger/html_template.rb +17 -12
- data/lib/phusion_passenger/message_channel.rb +17 -12
- data/lib/phusion_passenger/packaging.rb +39 -0
- data/lib/phusion_passenger/platform_info.rb +48 -22
- data/lib/phusion_passenger/rack/application_spawner.rb +22 -11
- data/lib/phusion_passenger/rack/request_handler.rb +21 -12
- data/lib/phusion_passenger/railz/application_spawner.rb +23 -23
- data/lib/phusion_passenger/railz/framework_spawner.rb +18 -14
- data/lib/phusion_passenger/railz/request_handler.rb +18 -11
- data/lib/phusion_passenger/simple_benchmarking.rb +17 -12
- data/lib/phusion_passenger/spawn_manager.rb +17 -20
- data/lib/phusion_passenger/templates/{apache_must_be_compiled_with_compatible_mpm.txt.erb → apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{apache2_config_snippets.txt.erb → apache2/config_snippets.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{deployment_example.txt.erb → apache2/deployment_example.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{no_write_permission_to_passenger_root.txt.erb → apache2/no_write_permission_to_passenger_root.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{possible_solutions_for_compilation_and_installation_problems.txt.erb → apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{run_installer_as_root.txt.erb → apache2/run_installer_as_root.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{welcome.txt.erb → apache2/welcome.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/nginx/ask_for_extra_configure_flags.txt.erb +8 -0
- data/lib/phusion_passenger/templates/nginx/cannot_write_to_dir.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +17 -0
- data/lib/phusion_passenger/templates/nginx/config_snippets_inserted.txt.erb +20 -0
- data/lib/phusion_passenger/templates/nginx/confirm_extra_configure_flags.txt.erb +5 -0
- data/lib/phusion_passenger/templates/nginx/deployment_example.txt.erb +22 -0
- data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_downloaded.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_extracted.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/possible_solutions_for_download_and_extraction_problems.txt.erb +20 -0
- data/lib/phusion_passenger/templates/nginx/query_download_and_install.txt.erb +21 -0
- data/lib/phusion_passenger/templates/nginx/run_installer_as_root.txt.erb +8 -0
- data/lib/phusion_passenger/templates/nginx/welcome.txt.erb +15 -0
- data/lib/phusion_passenger/utils.rb +20 -15
- data/lib/phusion_passenger/wsgi/application_spawner.rb +18 -11
- data/lib/phusion_passenger/wsgi/request_handler.py +23 -0
- data/misc/copy_boost_headers.rb +23 -0
- data/misc/find_owner_pipe_leaks.rb +18 -11
- data/misc/rake/cplusplus.rb +18 -11
- data/misc/rake/extensions.rb +21 -14
- data/misc/render_error_pages.rb +18 -11
- data/test/ApplicationPoolServerTest.cpp +1 -3
- data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +1 -1
- data/test/CxxTestMain.cpp +19 -3
- data/test/HttpStatusExtractorTest.cpp +181 -0
- data/test/ScgiRequestParserTest.cpp +337 -0
- data/test/StaticStringTest.cpp +51 -0
- data/test/UtilsTest.cpp +32 -0
- data/test/config.yml.example +5 -0
- data/test/{integration_tests.rb → integration_tests/apache2_tests.rb} +7 -299
- data/test/integration_tests/hello_world_rack_spec.rb +36 -0
- data/test/integration_tests/hello_world_wsgi_spec.rb +41 -0
- data/test/integration_tests/mycook_spec.rb +192 -0
- data/test/integration_tests/nginx_tests.rb +98 -0
- data/test/ruby/rack/application_spawner_spec.rb +40 -0
- data/test/stub/nginx/koi-utf +109 -0
- data/test/stub/nginx/koi-win +103 -0
- data/test/stub/nginx/mime.types +70 -0
- data/test/stub/nginx/nginx.conf.erb +57 -0
- data/test/stub/nginx/win-utf +126 -0
- data/test/stub/rails_apps/mycook/app/controllers/uploads_controller.rb +4 -0
- data/test/stub/rails_apps/mycook/config/routes.rb +1 -1
- data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
- data/test/support/Support.h +40 -0
- data/test/support/nginx_controller.rb +98 -0
- data/test/support/test_helper.rb +79 -0
- metadata +1091 -1028
- data/benchmark/DummyRequestHandler.cpp +0 -101
- data/ext/apache2/Logging.cpp +0 -60
- data/ext/apache2/SystemTime.cpp +0 -28
@@ -1,10 +1,10 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
2
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
3
3
|
<title>Passenger: StandardApplicationPool.h Source File</title>
|
4
|
-
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
5
4
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
5
|
+
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
6
6
|
</head><body>
|
7
|
-
<!-- Generated by Doxygen 1.5.
|
7
|
+
<!-- Generated by Doxygen 1.5.8 -->
|
8
8
|
<div class="navigation" id="top">
|
9
9
|
<div class="tabs">
|
10
10
|
<ul>
|
@@ -14,6 +14,11 @@
|
|
14
14
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
15
15
|
</ul>
|
16
16
|
</div>
|
17
|
+
<div class="tabs">
|
18
|
+
<ul>
|
19
|
+
<li><a href="files.html"><span>File List</span></a></li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
17
22
|
<h1>StandardApplicationPool.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
18
23
|
<a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
|
19
24
|
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
|
@@ -664,7 +669,7 @@
|
|
664
669
|
<a name="l00648"></a>00648 }
|
665
670
|
<a name="l00649"></a>00649
|
666
671
|
<a name="l00650"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#5a33f0766bbcfb2a48e08fc27bd1b684">00650</a> <span class="keyword">virtual</span> <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a> <span class="keyword">get</span>(<span class="keyword">const</span> <span class="keywordtype">string</span> &appRoot) {
|
667
|
-
<a name="l00651"></a>00651 <span class="keywordflow">return</span> <a class="code" href="
|
672
|
+
<a name="l00651"></a>00651 <span class="keywordflow">return</span> <a class="code" href="classPassenger_1_1StandardApplicationPool.html#5a33f0766bbcfb2a48e08fc27bd1b684" title="Convenience shortcut for calling get() with default spawn options.">ApplicationPool::get</a>(appRoot);
|
668
673
|
<a name="l00652"></a>00652 }
|
669
674
|
<a name="l00653"></a>00653
|
670
675
|
<a name="l00654"></a><a class="code" href="classPassenger_1_1StandardApplicationPool.html#ffc8f3ef8b1d925d203794d191d7fef4">00654</a> <span class="keyword">virtual</span> <a class="code" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9" title="Convenient alias for Session smart pointer.">Application::SessionPtr</a> <span class="keyword">get</span>(<span class="keyword">const</span> <a class="code" href="structPassenger_1_1PoolOptions.html" title="This struct encapsulates information for ApplicationPool::get() and for SpawnManager::spawn()...">PoolOptions</a> &options) {
|
@@ -830,8 +835,8 @@
|
|
830
835
|
<a name="l00814"></a>00814 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_STANDARD_APPLICATION_POOL_H_ */</span>
|
831
836
|
<a name="l00815"></a>00815
|
832
837
|
</pre></div></div>
|
833
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
838
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Apr 8 22:35:10 2009 for Passenger by
|
834
839
|
<a href="http://www.doxygen.org/index.html">
|
835
|
-
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.
|
840
|
+
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
|
836
841
|
</body>
|
837
842
|
</html>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
2
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
3
3
|
<title>Passenger: SystemTime.h Source File</title>
|
4
|
-
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
5
4
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
5
|
+
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
6
6
|
</head><body>
|
7
|
-
<!-- Generated by Doxygen 1.5.
|
7
|
+
<!-- Generated by Doxygen 1.5.8 -->
|
8
8
|
<div class="navigation" id="top">
|
9
9
|
<div class="tabs">
|
10
10
|
<ul>
|
@@ -14,6 +14,11 @@
|
|
14
14
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
15
15
|
</ul>
|
16
16
|
</div>
|
17
|
+
<div class="tabs">
|
18
|
+
<ul>
|
19
|
+
<li><a href="files.html"><span>File List</span></a></li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
17
22
|
<h1>SystemTime.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
18
23
|
<a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
|
19
24
|
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2009 Phusion</span>
|
@@ -97,8 +102,8 @@
|
|
97
102
|
<a name="l00081"></a>00081
|
98
103
|
<a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_SYSTEM_TIME_H_ */</span>
|
99
104
|
</pre></div></div>
|
100
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
105
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Apr 8 22:35:10 2009 for Passenger by
|
101
106
|
<a href="http://www.doxygen.org/index.html">
|
102
|
-
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.
|
107
|
+
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
|
103
108
|
</body>
|
104
109
|
</html>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
2
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
3
3
|
<title>Passenger: Utils.h Source File</title>
|
4
|
-
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
5
4
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
5
|
+
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
6
6
|
</head><body>
|
7
|
-
<!-- Generated by Doxygen 1.5.
|
7
|
+
<!-- Generated by Doxygen 1.5.8 -->
|
8
8
|
<div class="navigation" id="top">
|
9
9
|
<div class="tabs">
|
10
10
|
<ul>
|
@@ -14,6 +14,11 @@
|
|
14
14
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
15
15
|
</ul>
|
16
16
|
</div>
|
17
|
+
<div class="tabs">
|
18
|
+
<ul>
|
19
|
+
<li><a href="files.html"><span>File List</span></a></li>
|
20
|
+
</ul>
|
21
|
+
</div>
|
17
22
|
<h1>Utils.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
|
18
23
|
<a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
|
19
24
|
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
|
@@ -227,222 +232,245 @@
|
|
227
232
|
<a name="l00211"></a>00211 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#gf3b0a483f0a252ae08d9de9f8b267d36" title="Returns a canonical version of the specified path.">canonicalizePath</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &path);
|
228
233
|
<a name="l00212"></a>00212 <span class="comment"></span>
|
229
234
|
<a name="l00213"></a>00213 <span class="comment">/**</span>
|
230
|
-
<a name="l00214"></a>00214 <span class="comment"> *
|
231
|
-
<a name="l00215"></a>00215 <span class="comment">
|
232
|
-
<a name="l00216"></a>00216 <span class="comment"> *
|
233
|
-
<a name="l00217"></a>00217 <span class="comment">
|
234
|
-
<a name="l00218"></a>00218 <span class="comment">
|
235
|
-
<a name="l00219"></a>00219 <span class="
|
236
|
-
<a name="l00220"></a>00220 <span class="comment"
|
237
|
-
<a name="l00221"></a>00221 <span class="comment"
|
238
|
-
<a name="l00222"></a>00222 <span class="comment"> *
|
239
|
-
<a name="l00223"></a>00223 <span class="comment">
|
240
|
-
<a name="l00224"></a>00224 <span class="comment"> *
|
241
|
-
<a name="l00225"></a>00225 <span class="comment"> *
|
242
|
-
<a name="l00226"></a>00226 <span class="comment">
|
243
|
-
<a name="l00227"></a>00227 <span class="
|
244
|
-
<a name="l00228"></a>00228 <span class="
|
245
|
-
<a name="l00229"></a>00229 <span class="comment"
|
246
|
-
<a name="l00230"></a>00230 <span class="comment"
|
247
|
-
<a name="l00231"></a>00231 <span class="comment">
|
248
|
-
<a name="l00232"></a>00232 <span class="comment"> *
|
249
|
-
<a name="l00233"></a>00233 <span class="comment">
|
250
|
-
<a name="l00234"></a>00234 <span class="
|
251
|
-
<a name="l00235"></a>00235 <span class="comment"
|
252
|
-
<a name="l00236"></a>00236 <span class="comment"
|
253
|
-
<a name="l00237"></a>00237 <span class="comment">
|
254
|
-
<a name="l00238"></a>00238 <span class="
|
255
|
-
<a name="l00239"></a>00239 <span class="comment"
|
256
|
-
<a name="l00240"></a>00240 <span class="comment"
|
257
|
-
<a name="l00241"></a>00241 <span class="comment">
|
258
|
-
<a name="l00242"></a>00242 <span class="
|
259
|
-
<a name="l00243"></a>00243 <span class="comment"
|
260
|
-
<a name="l00244"></a>00244 <span class="comment"
|
261
|
-
<a name="l00245"></a>00245 <span class="comment"> *
|
262
|
-
<a name="l00246"></a>00246 <span class="comment"> *
|
263
|
-
<a name="l00247"></a>00247 <span class="comment"> *
|
264
|
-
<a name="l00248"></a>00248 <span class="comment">
|
265
|
-
<a name="l00249"></a>00249 <span class="comment"> *
|
266
|
-
<a name="l00250"></a>00250 <span class="comment">
|
267
|
-
<a name="l00251"></a>00251 <span class="
|
268
|
-
<a name="l00252"></a>00252 <span class="comment"
|
269
|
-
<a name="l00253"></a>00253 <span class="comment"
|
270
|
-
<a name="l00254"></a>00254 <span class="comment"> *
|
271
|
-
<a name="l00255"></a>00255 <span class="comment"> *
|
272
|
-
<a name="l00256"></a>00256 <span class="comment"> *
|
273
|
-
<a name="l00257"></a>00257 <span class="comment">
|
274
|
-
<a name="l00258"></a>00258 <span class="comment">
|
275
|
-
<a name="l00259"></a>00259 <span class="
|
276
|
-
<a name="l00260"></a>00260
|
277
|
-
<a name="l00261"></a>00261 <span class="
|
278
|
-
<a name="l00262"></a>00262 <span class="comment"
|
279
|
-
<a name="l00263"></a>00263 <span class="comment"
|
280
|
-
<a name="l00264"></a>00264 <span class="comment"> *
|
281
|
-
<a name="l00265"></a>00265 <span class="comment"> * to
|
282
|
-
<a name="l00266"></a>00266 <span class="comment">
|
283
|
-
<a name="l00267"></a>00267 <span class="comment">
|
284
|
-
<a name="l00268"></a>00268 <span class="comment"> *
|
285
|
-
<a name="l00269"></a>00269 <span class="comment"> *
|
286
|
-
<a name="l00270"></a>00270 <span class="comment"> *
|
287
|
-
<a name="l00271"></a>00271 <span class="comment">
|
288
|
-
<a name="l00272"></a>00272 <span class="comment"> *
|
289
|
-
<a name="l00273"></a>00273 <span class="comment"> *
|
235
|
+
<a name="l00214"></a>00214 <span class="comment"> * If <em>path</em> refers to a symlink, then this function resolves the</span>
|
236
|
+
<a name="l00215"></a>00215 <span class="comment"> * symlink for 1 level. That is, if the symlink points to another symlink,</span>
|
237
|
+
<a name="l00216"></a>00216 <span class="comment"> * then the other symlink will not be resolved. The resolved path is returned.</span>
|
238
|
+
<a name="l00217"></a>00217 <span class="comment"> *</span>
|
239
|
+
<a name="l00218"></a>00218 <span class="comment"> * If the symlink doesn't point to an absolute path, then this function will</span>
|
240
|
+
<a name="l00219"></a>00219 <span class="comment"> * prepend <em>path</em>'s directory to the result.</span>
|
241
|
+
<a name="l00220"></a>00220 <span class="comment"> *</span>
|
242
|
+
<a name="l00221"></a>00221 <span class="comment"> * If <em>path</em> doesn't refer to a symlink then this method will return</span>
|
243
|
+
<a name="l00222"></a>00222 <span class="comment"> * <em>path</em>.</span>
|
244
|
+
<a name="l00223"></a>00223 <span class="comment"> *</span>
|
245
|
+
<a name="l00224"></a>00224 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
|
246
|
+
<a name="l00225"></a>00225 <span class="comment"> * @ingroup Support</span>
|
247
|
+
<a name="l00226"></a>00226 <span class="comment"> */</span>
|
248
|
+
<a name="l00227"></a>00227 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#gc3d2b3d608188527d888e63d22c5163c" title="If path refers to a symlink, then this function resolves the symlink for 1 level...">resolveSymlink</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &path);
|
249
|
+
<a name="l00228"></a>00228 <span class="comment"></span>
|
250
|
+
<a name="l00229"></a>00229 <span class="comment">/**</span>
|
251
|
+
<a name="l00230"></a>00230 <span class="comment"> * Given a path, extracts its directory name.</span>
|
252
|
+
<a name="l00231"></a>00231 <span class="comment"> *</span>
|
253
|
+
<a name="l00232"></a>00232 <span class="comment"> * @ingroup Support</span>
|
254
|
+
<a name="l00233"></a>00233 <span class="comment"> */</span>
|
255
|
+
<a name="l00234"></a>00234 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#g744cb849cb47dbcf5f22a46ead48ae94" title="Given a path, extracts its directory name.">extractDirName</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &path);
|
256
|
+
<a name="l00235"></a>00235 <span class="comment"></span>
|
257
|
+
<a name="l00236"></a>00236 <span class="comment">/**</span>
|
258
|
+
<a name="l00237"></a>00237 <span class="comment"> * Escape the given raw string into an XML value.</span>
|
259
|
+
<a name="l00238"></a>00238 <span class="comment"> *</span>
|
260
|
+
<a name="l00239"></a>00239 <span class="comment"> * @throws std::bad_alloc Something went wrong.</span>
|
261
|
+
<a name="l00240"></a>00240 <span class="comment"> * @ingroup Support</span>
|
262
|
+
<a name="l00241"></a>00241 <span class="comment"> */</span>
|
263
|
+
<a name="l00242"></a>00242 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#ge74addedf73782a1eb1f6dd48d6fce06" title="Escape the given raw string into an XML value.">escapeForXml</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &input);
|
264
|
+
<a name="l00243"></a>00243 <span class="comment"></span>
|
265
|
+
<a name="l00244"></a>00244 <span class="comment">/**</span>
|
266
|
+
<a name="l00245"></a>00245 <span class="comment"> * Given a username that's supposed to be the "lowest user" in the user switching mechanism,</span>
|
267
|
+
<a name="l00246"></a>00246 <span class="comment"> * checks whether this username exists. If so, this users's UID and GID will be stored into</span>
|
268
|
+
<a name="l00247"></a>00247 <span class="comment"> * the arguments of the same names. If not, <em>uid</em> and <em>gid</em> will be set to</span>
|
269
|
+
<a name="l00248"></a>00248 <span class="comment"> * the UID and GID of the "nobody" user. If that user doesn't exist either, then <em>uid</em></span>
|
270
|
+
<a name="l00249"></a>00249 <span class="comment"> * and <em>gid</em> will be set to -1.</span>
|
271
|
+
<a name="l00250"></a>00250 <span class="comment"> */</span>
|
272
|
+
<a name="l00251"></a>00251 <span class="keywordtype">void</span> determineLowestUserAndGroup(<span class="keyword">const</span> <span class="keywordtype">string</span> &user, uid_t &uid, gid_t &gid);
|
273
|
+
<a name="l00252"></a>00252 <span class="comment"></span>
|
274
|
+
<a name="l00253"></a>00253 <span class="comment">/**</span>
|
275
|
+
<a name="l00254"></a>00254 <span class="comment"> * Return the path name for the directory in which the system stores general</span>
|
276
|
+
<a name="l00255"></a>00255 <span class="comment"> * temporary files. This is usually "/tmp", but might be something else depending</span>
|
277
|
+
<a name="l00256"></a>00256 <span class="comment"> * on some environment variables.</span>
|
278
|
+
<a name="l00257"></a>00257 <span class="comment"> *</span>
|
279
|
+
<a name="l00258"></a>00258 <span class="comment"> * @ensure result != NULL</span>
|
280
|
+
<a name="l00259"></a>00259 <span class="comment"> * @ingroup Support</span>
|
281
|
+
<a name="l00260"></a>00260 <span class="comment"> */</span>
|
282
|
+
<a name="l00261"></a>00261 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__Support.html#g68f4105c5a8e510520b5ea3eecb66213" title="Return the path name for the directory in which the system stores general temporary...">getSystemTempDir</a>();
|
283
|
+
<a name="l00262"></a>00262 <span class="comment"></span>
|
284
|
+
<a name="l00263"></a>00263 <span class="comment">/**</span>
|
285
|
+
<a name="l00264"></a>00264 <span class="comment"> * Return the path name for the directory in which Phusion Passenger-specific</span>
|
286
|
+
<a name="l00265"></a>00265 <span class="comment"> * temporary files are to be stored. This directory is unique for this instance</span>
|
287
|
+
<a name="l00266"></a>00266 <span class="comment"> * of the web server in which Phusion Passenger is running.</span>
|
288
|
+
<a name="l00267"></a>00267 <span class="comment"> *</span>
|
289
|
+
<a name="l00268"></a>00268 <span class="comment"> * If the environment variable PASSENGER_INSTANCE_TEMP_DIR is set, then that value</span>
|
290
|
+
<a name="l00269"></a>00269 <span class="comment"> * will be returned. If this environment variable is not set, then it will be set</span>
|
291
|
+
<a name="l00270"></a>00270 <span class="comment"> * with the return value.</span>
|
292
|
+
<a name="l00271"></a>00271 <span class="comment"> *</span>
|
293
|
+
<a name="l00272"></a>00272 <span class="comment"> * To bypass the usage of the PASSENGER_INSTANCE_TEMP_DIR environment variable,</span>
|
294
|
+
<a name="l00273"></a>00273 <span class="comment"> * set 'bypassCache' to true.</span>
|
290
295
|
<a name="l00274"></a>00274 <span class="comment"> *</span>
|
291
|
-
<a name="l00275"></a>00275 <span class="comment"> *
|
292
|
-
<a name="l00276"></a>00276 <span class="comment">
|
293
|
-
<a name="l00277"></a>00277 <span class="comment"> *
|
294
|
-
<a name="l00278"></a>00278 <span class="comment"> *
|
295
|
-
<a name="l00279"></a>00279 <span class="comment"> * (
|
296
|
-
<a name="l00280"></a>00280 <span class="comment"> *
|
297
|
-
<a name="l00281"></a>00281 <span class="comment">
|
298
|
-
<a name="l00282"></a>00282 <span class="
|
299
|
-
<a name="l00283"></a>00283
|
300
|
-
<a name="l00284"></a>00284 <span class="comment"
|
301
|
-
<a name="l00285"></a>00285 <span class="comment"> *
|
302
|
-
<a name="l00286"></a>00286 <span class="comment"> *
|
303
|
-
<a name="l00287"></a>00287 <span class="comment"> *
|
304
|
-
<a name="l00288"></a>00288 <span class="comment">
|
305
|
-
<a name="l00289"></a>00289 <span class="comment">
|
306
|
-
<a name="l00290"></a>00290 <span class="comment"> *
|
307
|
-
<a name="l00291"></a>00291 <span class="comment"> *
|
308
|
-
<a name="l00292"></a>00292 <span class="comment"> *
|
309
|
-
<a name="l00293"></a>00293 <span class="comment"> *
|
310
|
-
<a name="l00294"></a>00294 <span class="comment"> *
|
311
|
-
<a name="l00295"></a>00295 <span class="comment"> *
|
312
|
-
<a name="l00296"></a>00296 <span class="comment"> *
|
313
|
-
<a name="l00297"></a>00297 <span class="comment">
|
314
|
-
<a name="l00298"></a>00298 <span class="comment"> *
|
315
|
-
<a name="l00299"></a>00299 <span class="comment">
|
316
|
-
<a name="l00300"></a>00300 <span class="comment"> *
|
317
|
-
<a name="l00301"></a>00301 <span class="comment"> *
|
318
|
-
<a name="l00302"></a>00302 <span class="comment"> *
|
319
|
-
<a name="l00303"></a>00303 <span class="comment"> *
|
320
|
-
<a name="l00304"></a>00304 <span class="comment">
|
321
|
-
<a name="l00305"></a>00305 <span class="
|
322
|
-
<a name="l00306"></a>00306
|
323
|
-
<a name="l00307"></a>00307
|
324
|
-
<a name="l00308"></a>00308 <span class="comment"
|
325
|
-
<a name="l00309"></a>00309 <span class="comment"
|
326
|
-
<a name="l00310"></a>00310 <span class="comment"> *
|
327
|
-
<a name="l00311"></a>00311 <span class="comment">
|
328
|
-
<a name="l00312"></a>00312 <span class="comment"> *
|
329
|
-
<a name="l00313"></a>00313 <span class="comment"> *
|
330
|
-
<a name="l00314"></a>00314 <span class="comment"> *
|
331
|
-
<a name="l00315"></a>00315 <span class="comment">
|
332
|
-
<a name="l00316"></a>00316 <span class="comment"> *
|
333
|
-
<a name="l00317"></a>00317 <span class="comment">
|
334
|
-
<a name="l00318"></a>00318 <span class="comment"> * @
|
335
|
-
<a name="l00319"></a>00319 <span class="comment"> *
|
336
|
-
<a name="l00320"></a>00320 <span class="comment"> *
|
337
|
-
<a name="l00321"></a>00321 <span class="comment">
|
338
|
-
<a name="l00322"></a>00322 <span class="
|
339
|
-
<a name="l00323"></a>00323 <span class="comment"
|
340
|
-
<a name="l00324"></a>00324 <span class="comment"
|
341
|
-
<a name="l00325"></a>00325 <span class="comment"> *
|
342
|
-
<a name="l00326"></a>00326 <span class="comment">
|
343
|
-
<a name="l00327"></a>00327 <span class="comment">
|
344
|
-
<a name="l00328"></a>00328 <span class="
|
345
|
-
<a name="l00329"></a>00329
|
346
|
-
<a name="l00330"></a>00330
|
347
|
-
<a name="l00331"></a>00331 <span class="comment"
|
348
|
-
<a name="l00332"></a>00332 <span class="comment"
|
349
|
-
<a name="l00333"></a>00333 <span class="comment"> *
|
350
|
-
<a name="l00334"></a>00334 <span class="comment">
|
351
|
-
<a name="l00335"></a>00335 <span class="comment"> *
|
352
|
-
<a name="l00336"></a>00336 <span class="comment"> *
|
353
|
-
<a name="l00337"></a>00337 <span class="comment"> *
|
354
|
-
<a name="l00338"></a>00338 <span class="comment">
|
355
|
-
<a name="l00339"></a>00339 <span class="comment">
|
356
|
-
<a name="l00340"></a>00340 <span class="
|
357
|
-
<a name="l00341"></a>00341
|
358
|
-
<a name="l00342"></a>00342 <span class="comment"
|
359
|
-
<a name="l00343"></a>00343 <span class="comment"
|
360
|
-
<a name="l00344"></a>00344 <span class="comment">
|
361
|
-
<a name="l00345"></a>00345 <span class="
|
362
|
-
<a name="l00346"></a>00346 <span class="comment"
|
363
|
-
<a name="l00347"></a>00347 <span class="comment"
|
364
|
-
<a name="l00348"></a>00348 <span class="comment"> *
|
365
|
-
<a name="l00349"></a>00349 <span class="comment">
|
366
|
-
<a name="l00350"></a>00350 <span class="comment"> * @
|
296
|
+
<a name="l00275"></a>00275 <span class="comment"> * @param bypassCache Whether PASSENGER_INSTANCE_TEMP_DIR should be bypassed.</span>
|
297
|
+
<a name="l00276"></a>00276 <span class="comment"> * @param systemTempDir The directory under which the Phusion Passenger-specific</span>
|
298
|
+
<a name="l00277"></a>00277 <span class="comment"> * temp directory should be located. If set to the empty string,</span>
|
299
|
+
<a name="l00278"></a>00278 <span class="comment"> * then the return value of getSystemTempDir() will be used.</span>
|
300
|
+
<a name="l00279"></a>00279 <span class="comment"> * @ensure !result.empty()</span>
|
301
|
+
<a name="l00280"></a>00280 <span class="comment"> * @ingroup Support</span>
|
302
|
+
<a name="l00281"></a>00281 <span class="comment"> */</span>
|
303
|
+
<a name="l00282"></a>00282 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#g69deb6b299b45039dc24b60ad9175541" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>(<span class="keywordtype">bool</span> bypassCache = <span class="keyword">false</span>, <span class="keyword">const</span> <span class="keywordtype">string</span> &systemTempDir = <span class="stringliteral">""</span>);
|
304
|
+
<a name="l00283"></a>00283
|
305
|
+
<a name="l00284"></a>00284 <span class="comment">/* Create a temp directory under <em>systemTempDir</em>, for storing Phusion</span>
|
306
|
+
<a name="l00285"></a>00285 <span class="comment"> * Passenger-specific temp files, such as temporarily buffered uploads,</span>
|
307
|
+
<a name="l00286"></a>00286 <span class="comment"> * sockets for backend processes, etc. This call also sets the</span>
|
308
|
+
<a name="l00287"></a>00287 <span class="comment"> * PASSENGER_INSTANCE_TEMP_DIR environment variable, which allows subprocesses</span>
|
309
|
+
<a name="l00288"></a>00288 <span class="comment"> * to find this temp directory.</span>
|
310
|
+
<a name="l00289"></a>00289 <span class="comment"> *</span>
|
311
|
+
<a name="l00290"></a>00290 <span class="comment"> * The created temp directory will have several subdirectories:</span>
|
312
|
+
<a name="l00291"></a>00291 <span class="comment"> * - webserver_private - for storing the web server's buffered uploads.</span>
|
313
|
+
<a name="l00292"></a>00292 <span class="comment"> * - info - for storing files that allow external tools to query information</span>
|
314
|
+
<a name="l00293"></a>00293 <span class="comment"> * about a running Phusion Passenger instance.</span>
|
315
|
+
<a name="l00294"></a>00294 <span class="comment"> * - backends - for storing Unix sockets created by backend processes.</span>
|
316
|
+
<a name="l00295"></a>00295 <span class="comment"> * - var - for storing all other kinds of temp files that the backend processes</span>
|
317
|
+
<a name="l00296"></a>00296 <span class="comment"> * create.</span>
|
318
|
+
<a name="l00297"></a>00297 <span class="comment"> *</span>
|
319
|
+
<a name="l00298"></a>00298 <span class="comment"> * If a (sub)directory already exists, then it will not result in an error.</span>
|
320
|
+
<a name="l00299"></a>00299 <span class="comment"> *</span>
|
321
|
+
<a name="l00300"></a>00300 <span class="comment"> * The <em>userSwitching</em> and <em>lowestUser</em> arguments passed to</span>
|
322
|
+
<a name="l00301"></a>00301 <span class="comment"> * this method are used for determining the optimal permissions for the</span>
|
323
|
+
<a name="l00302"></a>00302 <span class="comment"> * (sub)directories. The permissions will be set as tightly as possible based</span>
|
324
|
+
<a name="l00303"></a>00303 <span class="comment"> * on the values. The <em>workerUid</em> and <em>workerGid</em> arguments</span>
|
325
|
+
<a name="l00304"></a>00304 <span class="comment"> * will be used for determining the owner of certain subdirectories.</span>
|
326
|
+
<a name="l00305"></a>00305 <span class="comment"> *</span>
|
327
|
+
<a name="l00306"></a>00306 <span class="comment"> * @note You should only call this method inside the web server's master</span>
|
328
|
+
<a name="l00307"></a>00307 <span class="comment"> * process. In case of Apache, this is the Apache control process,</span>
|
329
|
+
<a name="l00308"></a>00308 <span class="comment"> * the one that tends to run as root. This is because this function</span>
|
330
|
+
<a name="l00309"></a>00309 <span class="comment"> * will set directory permissions and owners/groups, which may require</span>
|
331
|
+
<a name="l00310"></a>00310 <span class="comment"> * root privileges.</span>
|
332
|
+
<a name="l00311"></a>00311 <span class="comment"> *</span>
|
333
|
+
<a name="l00312"></a>00312 <span class="comment"> * @param systemTempDir The directory under which the Phusion Passenger-specific</span>
|
334
|
+
<a name="l00313"></a>00313 <span class="comment"> * temp directory should be created. You should normally</span>
|
335
|
+
<a name="l00314"></a>00314 <span class="comment"> * specify the return value of getSystemTempDir().</span>
|
336
|
+
<a name="l00315"></a>00315 <span class="comment"> * @param userSwitching Whether user switching is turned on.</span>
|
337
|
+
<a name="l00316"></a>00316 <span class="comment"> * @param lowestUser The user that the spawn manager and the pool server will</span>
|
338
|
+
<a name="l00317"></a>00317 <span class="comment"> * run as, if user switching is turned off.</span>
|
339
|
+
<a name="l00318"></a>00318 <span class="comment"> * @param workerUid The UID that the web server's worker processes are running</span>
|
340
|
+
<a name="l00319"></a>00319 <span class="comment"> * as. On Apache, this is the UID that's associated with the</span>
|
341
|
+
<a name="l00320"></a>00320 <span class="comment"> * 'User' directive.</span>
|
342
|
+
<a name="l00321"></a>00321 <span class="comment"> * @param workerGid The GID that the web server's worker processes are running</span>
|
343
|
+
<a name="l00322"></a>00322 <span class="comment"> * as. On Apache, this is the GID that's associated with the</span>
|
344
|
+
<a name="l00323"></a>00323 <span class="comment"> * 'Group' directive.</span>
|
345
|
+
<a name="l00324"></a>00324 <span class="comment"> * @throws IOException Something went wrong.</span>
|
346
|
+
<a name="l00325"></a>00325 <span class="comment"> * @throws SystemException Something went wrong.</span>
|
347
|
+
<a name="l00326"></a>00326 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
|
348
|
+
<a name="l00327"></a>00327 <span class="comment"> */</span>
|
349
|
+
<a name="l00328"></a>00328 <span class="keywordtype">void</span> createPassengerTempDir(<span class="keyword">const</span> <span class="keywordtype">string</span> &systemTempDir, <span class="keywordtype">bool</span> userSwitching,
|
350
|
+
<a name="l00329"></a>00329 <span class="keyword">const</span> <span class="keywordtype">string</span> &lowestUser,
|
351
|
+
<a name="l00330"></a>00330 uid_t workerUid, gid_t workerGid);
|
352
|
+
<a name="l00331"></a>00331 <span class="comment"></span>
|
353
|
+
<a name="l00332"></a>00332 <span class="comment">/**</span>
|
354
|
+
<a name="l00333"></a>00333 <span class="comment"> * Create the directory at the given path, creating intermediate directories</span>
|
355
|
+
<a name="l00334"></a>00334 <span class="comment"> * if necessary. The created directories' permissions are as specified by the</span>
|
356
|
+
<a name="l00335"></a>00335 <span class="comment"> * 'mode' parameter. You can specify this directory's owner and group through</span>
|
357
|
+
<a name="l00336"></a>00336 <span class="comment"> * the 'owner' and 'group' parameters. A value of -1 for 'owner' or 'group'</span>
|
358
|
+
<a name="l00337"></a>00337 <span class="comment"> * means that the owner/group should not be changed.</span>
|
359
|
+
<a name="l00338"></a>00338 <span class="comment"> *</span>
|
360
|
+
<a name="l00339"></a>00339 <span class="comment"> * If 'path' already exists, then nothing will happen.</span>
|
361
|
+
<a name="l00340"></a>00340 <span class="comment"> *</span>
|
362
|
+
<a name="l00341"></a>00341 <span class="comment"> * @throws IOException Something went wrong.</span>
|
363
|
+
<a name="l00342"></a>00342 <span class="comment"> * @throws SystemException Something went wrong.</span>
|
364
|
+
<a name="l00343"></a>00343 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
|
365
|
+
<a name="l00344"></a>00344 <span class="comment"> */</span>
|
366
|
+
<a name="l00345"></a>00345 <span class="keywordtype">void</span> makeDirTree(<span class="keyword">const</span> <span class="keywordtype">string</span> &path, <span class="keyword">const</span> <span class="keywordtype">char</span> *mode = <span class="stringliteral">"u=rwx,g=,o="</span>, uid_t owner = -1, gid_t group = -1);
|
367
|
+
<a name="l00346"></a>00346 <span class="comment"></span>
|
368
|
+
<a name="l00347"></a>00347 <span class="comment">/**</span>
|
369
|
+
<a name="l00348"></a>00348 <span class="comment"> * Remove an entire directory tree recursively.</span>
|
370
|
+
<a name="l00349"></a>00349 <span class="comment"> *</span>
|
371
|
+
<a name="l00350"></a>00350 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
|
367
372
|
<a name="l00351"></a>00351 <span class="comment"> */</span>
|
368
|
-
<a name="l00352"></a>00352 <span class="keywordtype">
|
369
|
-
<a name="l00353"></a>00353
|
370
|
-
<a name="l00354"></a>00354 <span class="comment"
|
371
|
-
<a name="l00355"></a>00355 <span class="comment"
|
372
|
-
<a name="l00356"></a>00356 <span class="comment"> *
|
373
|
-
<a name="l00357"></a>00357 <span class="comment">
|
374
|
-
<a name="l00358"></a>00358 <span class="comment">
|
375
|
-
<a name="l00359"></a>00359 <span class="comment"> * @param
|
376
|
-
<a name="l00360"></a>00360 <span class="comment"> * @
|
377
|
-
<a name="l00361"></a>00361 <span class="comment"> * @
|
378
|
-
<a name="l00362"></a>00362 <span class="comment">
|
379
|
-
<a name="l00363"></a>00363 <span class="
|
380
|
-
<a name="l00364"></a>00364
|
381
|
-
<a name="l00365"></a>00365
|
382
|
-
<a name="l00366"></a>00366 <span class="comment"
|
383
|
-
<a name="l00367"></a>00367 <span class="comment"
|
384
|
-
<a name="l00368"></a>00368 <span class="comment"> *
|
373
|
+
<a name="l00352"></a>00352 <span class="keywordtype">void</span> removeDirTree(<span class="keyword">const</span> <span class="keywordtype">string</span> &path);
|
374
|
+
<a name="l00353"></a>00353 <span class="comment"></span>
|
375
|
+
<a name="l00354"></a>00354 <span class="comment">/**</span>
|
376
|
+
<a name="l00355"></a>00355 <span class="comment"> * Check whether the specified directory is a valid Ruby on Rails</span>
|
377
|
+
<a name="l00356"></a>00356 <span class="comment"> * application root directory.</span>
|
378
|
+
<a name="l00357"></a>00357 <span class="comment"> *</span>
|
379
|
+
<a name="l00358"></a>00358 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
|
380
|
+
<a name="l00359"></a>00359 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
|
381
|
+
<a name="l00360"></a>00360 <span class="comment"> * @throws FileSystemException Unable to check because of a system error.</span>
|
382
|
+
<a name="l00361"></a>00361 <span class="comment"> * @ingroup Support</span>
|
383
|
+
<a name="l00362"></a>00362 <span class="comment"> */</span>
|
384
|
+
<a name="l00363"></a>00363 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g02c80bd02d38cea295f24250ca8e2502" title="Check whether the specified directory is a valid Ruby on Rails application root directory...">verifyRailsDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &dir, CachedMultiFileStat *mstat = 0,
|
385
|
+
<a name="l00364"></a>00364 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
|
386
|
+
<a name="l00365"></a>00365 <span class="comment"></span>
|
387
|
+
<a name="l00366"></a>00366 <span class="comment">/**</span>
|
388
|
+
<a name="l00367"></a>00367 <span class="comment"> * Check whether the specified directory is a valid Rack application</span>
|
389
|
+
<a name="l00368"></a>00368 <span class="comment"> * root directory.</span>
|
385
390
|
<a name="l00369"></a>00369 <span class="comment"> *</span>
|
386
|
-
<a name="l00370"></a>00370 <span class="comment"> * @
|
387
|
-
<a name="l00371"></a>00371 <span class="comment">
|
388
|
-
<a name="l00372"></a
|
389
|
-
<a name="l00373"></a>00373 <span class="
|
390
|
-
<a name="l00374"></a>00374 <span class="comment">
|
391
|
-
<a name="l00375"></a
|
392
|
-
<a name="l00376"></a>00376
|
393
|
-
<a name="l00377"></a>00377 <span class="comment"
|
394
|
-
<a name="l00378"></a>00378 <span class="comment"
|
395
|
-
<a name="l00379"></a>00379 <span class="comment">
|
396
|
-
<a name="l00380"></a>00380 <span class="comment">
|
397
|
-
<a name="l00381"></a>00381 <span class="comment">
|
398
|
-
<a name="l00382"></a
|
399
|
-
<a name="l00383"></a>00383
|
400
|
-
<a name="l00384"></a>00384
|
401
|
-
<a name="l00385"></a>00385
|
402
|
-
<a name="l00386"></a>00386
|
403
|
-
<a name="l00387"></a>00387
|
404
|
-
<a name="l00388"></a>00388
|
405
|
-
<a name="l00389"></a>00389
|
406
|
-
<a name="l00390"></a>00390
|
407
|
-
<a name="l00391"></a>00391
|
408
|
-
<a name="l00392"></a>00392
|
409
|
-
<a name="l00393"></a>00393
|
410
|
-
<a name="l00394"></a>00394
|
411
|
-
<a name="l00395"></a>00395
|
412
|
-
<a name="l00396"></a>00396
|
413
|
-
<a name="l00397"></a>00397
|
414
|
-
<a name="l00398"></a
|
415
|
-
<a name="l00399"></a>00399
|
416
|
-
<a name="l00400"></a>00400 <span class="comment">
|
417
|
-
<a name="l00401"></a>00401 <span class="comment">
|
418
|
-
<a name="l00402"></a>00402 <span class="comment">
|
419
|
-
<a name="l00403"></a>00403 <span class="comment">
|
420
|
-
<a name="l00404"></a>00404
|
421
|
-
<a name="l00405"></a>00405
|
422
|
-
<a name="l00406"></a>00406
|
423
|
-
<a name="l00407"></a>00407 <
|
424
|
-
<a name="l00408"></a>00408
|
425
|
-
<a name="l00409"></a>00409
|
426
|
-
<a name="l00410"></a>00410
|
427
|
-
<a name="l00411"></a>00411
|
428
|
-
<a name="l00412"></a>00412
|
429
|
-
<a name="l00413"></a>00413
|
430
|
-
<a name="l00414"></a>00414
|
431
|
-
<a name="l00415"></a>00415
|
432
|
-
<a name="l00416"></a>00416 <span class="
|
433
|
-
<a name="l00417"></a>00417 <span class="
|
434
|
-
<a name="l00418"></a
|
435
|
-
<a name="l00419"></a>00419
|
436
|
-
<a name="l00420"></a>00420
|
437
|
-
<a name="l00421"></a>00421
|
438
|
-
<a name="l00422"></a>00422
|
439
|
-
<a name="l00423"></a>00423
|
440
|
-
<a name="l00424"></a>00424
|
441
|
-
<a name="l00425"></a>00425 <span class="
|
442
|
-
<a name="l00426"></a>00426
|
391
|
+
<a name="l00370"></a>00370 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
|
392
|
+
<a name="l00371"></a>00371 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
|
393
|
+
<a name="l00372"></a>00372 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
|
394
|
+
<a name="l00373"></a>00373 <span class="comment"> * @ingroup Support</span>
|
395
|
+
<a name="l00374"></a>00374 <span class="comment"> */</span>
|
396
|
+
<a name="l00375"></a>00375 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g7bb22ba786fa3c88dbbd9f84aaaed59a" title="Check whether the specified directory is a valid Rack application root directory...">verifyRackDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &dir, CachedMultiFileStat *mstat = 0,
|
397
|
+
<a name="l00376"></a>00376 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
|
398
|
+
<a name="l00377"></a>00377 <span class="comment"></span>
|
399
|
+
<a name="l00378"></a>00378 <span class="comment">/**</span>
|
400
|
+
<a name="l00379"></a>00379 <span class="comment"> * Check whether the specified directory is a valid WSGI application</span>
|
401
|
+
<a name="l00380"></a>00380 <span class="comment"> * root directory.</span>
|
402
|
+
<a name="l00381"></a>00381 <span class="comment"> *</span>
|
403
|
+
<a name="l00382"></a>00382 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
|
404
|
+
<a name="l00383"></a>00383 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
|
405
|
+
<a name="l00384"></a>00384 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
|
406
|
+
<a name="l00385"></a>00385 <span class="comment"> * @ingroup Support</span>
|
407
|
+
<a name="l00386"></a>00386 <span class="comment"> */</span>
|
408
|
+
<a name="l00387"></a>00387 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g8bfea2692733dfd80703707a120bce86" title="Check whether the specified directory is a valid WSGI application root directory...">verifyWSGIDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &dir, CachedMultiFileStat *mstat = 0,
|
409
|
+
<a name="l00388"></a>00388 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
|
410
|
+
<a name="l00389"></a>00389 <span class="comment"></span>
|
411
|
+
<a name="l00390"></a>00390 <span class="comment">/**</span>
|
412
|
+
<a name="l00391"></a>00391 <span class="comment"> * Represents a buffered upload file.</span>
|
413
|
+
<a name="l00392"></a>00392 <span class="comment"> *</span>
|
414
|
+
<a name="l00393"></a>00393 <span class="comment"> * @ingroup Support</span>
|
415
|
+
<a name="l00394"></a>00394 <span class="comment"> */</span>
|
416
|
+
<a name="l00395"></a><a class="code" href="classPassenger_1_1BufferedUpload.html">00395</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a> {
|
417
|
+
<a name="l00396"></a>00396 <span class="keyword">public</span>:<span class="comment"></span>
|
418
|
+
<a name="l00397"></a>00397 <span class="comment"> /** The file handle. */</span>
|
419
|
+
<a name="l00398"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac">00398</a> FILE *<a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>;
|
420
|
+
<a name="l00399"></a>00399 <span class="comment"></span>
|
421
|
+
<a name="l00400"></a>00400 <span class="comment"> /**</span>
|
422
|
+
<a name="l00401"></a>00401 <span class="comment"> * Create an empty upload bufer file, and open it for reading and writing.</span>
|
423
|
+
<a name="l00402"></a>00402 <span class="comment"> *</span>
|
424
|
+
<a name="l00403"></a>00403 <span class="comment"> * @throws SystemException Something went wrong.</span>
|
425
|
+
<a name="l00404"></a>00404 <span class="comment"> */</span>
|
426
|
+
<a name="l00405"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#b85f5986340242fd2389b81ce4304e6b">00405</a> <a class="code" href="classPassenger_1_1BufferedUpload.html#b85f5986340242fd2389b81ce4304e6b" title="Create an empty upload bufer file, and open it for reading and writing.">BufferedUpload</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *identifier = <span class="stringliteral">"temp"</span>) {
|
427
|
+
<a name="l00406"></a>00406 <span class="keywordtype">char</span> templ[PATH_MAX];
|
428
|
+
<a name="l00407"></a>00407 <span class="keywordtype">int</span> fd;
|
429
|
+
<a name="l00408"></a>00408
|
430
|
+
<a name="l00409"></a>00409 snprintf(templ, <span class="keyword">sizeof</span>(templ), <span class="stringliteral">"%s/%s.XXXXXX"</span>, <a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9" title="Returns the directory in which upload buffer files are stored.">getDir</a>().c_str(), identifier);
|
431
|
+
<a name="l00410"></a>00410 templ[<span class="keyword">sizeof</span>(templ) - 1] = <span class="charliteral">'\0'</span>;
|
432
|
+
<a name="l00411"></a>00411 fd = mkstemp(templ);
|
433
|
+
<a name="l00412"></a>00412 <span class="keywordflow">if</span> (fd == -1) {
|
434
|
+
<a name="l00413"></a>00413 <span class="keywordtype">char</span> message[1024];
|
435
|
+
<a name="l00414"></a>00414 <span class="keywordtype">int</span> e = errno;
|
436
|
+
<a name="l00415"></a>00415
|
437
|
+
<a name="l00416"></a>00416 snprintf(message, <span class="keyword">sizeof</span>(message), <span class="stringliteral">"Cannot create a temporary file '%s'"</span>, templ);
|
438
|
+
<a name="l00417"></a>00417 message[<span class="keyword">sizeof</span>(message) - 1] = <span class="charliteral">'\0'</span>;
|
439
|
+
<a name="l00418"></a>00418 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(message, e);
|
440
|
+
<a name="l00419"></a>00419 }
|
441
|
+
<a name="l00420"></a>00420
|
442
|
+
<a name="l00421"></a>00421 <span class="comment">/* We use a POSIX trick here: the file's permissions are set to "u=,g=,o="</span>
|
443
|
+
<a name="l00422"></a>00422 <span class="comment"> * and the file is deleted immediately from the filesystem, while we</span>
|
444
|
+
<a name="l00423"></a>00423 <span class="comment"> * keep its file handle open. The result is that no other processes</span>
|
445
|
+
<a name="l00424"></a>00424 <span class="comment"> * will be able to access this file's contents anymore, except us.</span>
|
446
|
+
<a name="l00425"></a>00425 <span class="comment"> * We now have an anonymous disk-backed buffer.</span>
|
447
|
+
<a name="l00426"></a>00426 <span class="comment"> */</span>
|
448
|
+
<a name="l00427"></a>00427 fchmod(fd, 0000);
|
449
|
+
<a name="l00428"></a>00428 unlink(templ);
|
450
|
+
<a name="l00429"></a>00429
|
451
|
+
<a name="l00430"></a>00430 <a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a> = fdopen(fd, <span class="stringliteral">"w+"</span>);
|
452
|
+
<a name="l00431"></a>00431 }
|
453
|
+
<a name="l00432"></a>00432
|
454
|
+
<a name="l00433"></a>00433 ~<a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a>() {
|
455
|
+
<a name="l00434"></a>00434 fclose(<a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>);
|
456
|
+
<a name="l00435"></a>00435 }
|
457
|
+
<a name="l00436"></a>00436 <span class="comment"></span>
|
458
|
+
<a name="l00437"></a>00437 <span class="comment"> /**</span>
|
459
|
+
<a name="l00438"></a>00438 <span class="comment"> * Returns the directory in which upload buffer files are stored.</span>
|
460
|
+
<a name="l00439"></a>00439 <span class="comment"> * This is a subdirectory of the directory returned by getPassengerTempDir(). </span>
|
461
|
+
<a name="l00440"></a>00440 <span class="comment"> */</span>
|
462
|
+
<a name="l00441"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9">00441</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9" title="Returns the directory in which upload buffer files are stored.">getDir</a>() {
|
463
|
+
<a name="l00442"></a>00442 <span class="keywordflow">return</span> <a class="code" href="group__Support.html#g69deb6b299b45039dc24b60ad9175541" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>() + <span class="stringliteral">"/webserver_private"</span>;
|
464
|
+
<a name="l00443"></a>00443 }
|
465
|
+
<a name="l00444"></a>00444 };
|
466
|
+
<a name="l00445"></a>00445
|
467
|
+
<a name="l00446"></a>00446 } <span class="comment">// namespace Passenger</span>
|
468
|
+
<a name="l00447"></a>00447
|
469
|
+
<a name="l00448"></a>00448 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_UTILS_H_ */</span>
|
470
|
+
<a name="l00449"></a>00449
|
443
471
|
</pre></div></div>
|
444
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
472
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Apr 8 22:35:10 2009 for Passenger by
|
445
473
|
<a href="http://www.doxygen.org/index.html">
|
446
|
-
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.
|
474
|
+
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
|
447
475
|
</body>
|
448
476
|
</html>
|