passenger 2.1.2 → 2.1.3
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/Rakefile +7 -5
- data/doc/Architectural overview.html +729 -1
- data/doc/Architectural overview.txt +0 -5
- data/doc/Security of user switching support.html +605 -1
- data/doc/Users guide.html +110 -106
- data/doc/Users guide.txt +49 -0
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +400 -372
- data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
- data/doc/cxxapi/Application_8h-source.html +1 -1
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/CachedFileStat_8h-source.html +56 -65
- data/doc/cxxapi/Configuration_8h-source.html +40 -32
- data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
- data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
- data/doc/cxxapi/Exceptions_8h-source.html +1 -1
- data/doc/cxxapi/FileChecker_8h-source.html +29 -30
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/Logging_8h-source.html +1 -1
- data/doc/cxxapi/MessageChannel_8h-source.html +1 -1
- data/doc/cxxapi/PoolOptions_8h-source.html +1 -1
- data/doc/cxxapi/SpawnManager_8h-source.html +225 -219
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +451 -445
- data/doc/cxxapi/SystemTime_8h-source.html +1 -1
- data/doc/cxxapi/Utils_8h-source.html +201 -140
- data/doc/cxxapi/annotated.html +2 -2
- data/doc/cxxapi/classClient-members.html +1 -1
- data/doc/cxxapi/classClient.html +1 -1
- data/doc/cxxapi/classHooks-members.html +1 -1
- data/doc/cxxapi/classHooks.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
- data/doc/cxxapi/{classPassenger_1_1TempFile-members.html → classPassenger_1_1BufferedUpload-members.html} +5 -5
- data/doc/cxxapi/{classPassenger_1_1TempFile.html → classPassenger_1_1BufferedUpload.html} +33 -43
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1BusyException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileChecker.html +2 -2
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemTime.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +12 -11
- data/doc/cxxapi/functions_func.html +9 -7
- data/doc/cxxapi/functions_type.html +1 -1
- data/doc/cxxapi/functions_vars.html +2 -4
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +3 -3
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +33 -16
- data/doc/cxxapi/hierarchy.html +2 -2
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- 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 -2
- 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 +2 -1
- 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 +1 -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 -2
- data/doc/cxxapi/inherit__graph__19.md5 +1 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +2 -1
- 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.png +0 -0
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- 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 +18 -18
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +1 -1
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +1 -1
- data/doc/cxxapi/tree.html +4 -4
- data/doc/rdoc/classes/ConditionVariable.html +58 -58
- 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 +11 -11
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +1 -1
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +40 -39
- data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +15 -8
- data/doc/rdoc/classes/PlatformInfo.html +257 -253
- data/doc/rdoc/classes/RakeExtensions.html +2 -2
- data/doc/rdoc/classes/Signal.html +26 -26
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
- data/doc/rdoc/files/README.html +1 -1
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -1
- 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 +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +9 -9
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/{lib → misc}/rake/extensions_rb.html +2 -2
- data/doc/rdoc/fr_file_index.html +1 -1
- data/doc/rdoc/fr_method_index.html +22 -22
- data/ext/apache2/ApplicationPoolServer.h +43 -15
- data/ext/apache2/ApplicationPoolServerExecutable.cpp +27 -52
- data/ext/apache2/CachedFileStat.h +7 -16
- data/ext/apache2/Configuration.h +9 -1
- data/ext/apache2/FileChecker.h +4 -5
- data/ext/apache2/Hooks.cpp +20 -22
- data/ext/apache2/SpawnManager.h +6 -0
- data/ext/apache2/StandardApplicationPool.h +6 -0
- data/ext/apache2/Utils.cpp +174 -16
- data/ext/apache2/Utils.h +99 -38
- data/ext/boost/cstdint.hpp +2 -1
- data/ext/oxt/system_calls.cpp +20 -2
- data/ext/oxt/system_calls.hpp +2 -0
- data/lib/phusion_passenger/abstract_request_handler.rb +5 -1
- data/lib/phusion_passenger/admin_tools.rb +1 -1
- data/lib/phusion_passenger/admin_tools/control_process.rb +2 -1
- data/lib/phusion_passenger/dependencies.rb +7 -4
- data/lib/phusion_passenger/platform_info.rb +8 -2
- data/lib/phusion_passenger/rack/application_spawner.rb +1 -1
- data/lib/phusion_passenger/templates/version_not_found.html.erb +9 -0
- data/lib/phusion_passenger/utils.rb +13 -6
- data/lib/phusion_passenger/wsgi/application_spawner.rb +1 -1
- data/{lib → misc}/rake/cplusplus.rb +0 -0
- data/{lib → misc}/rake/extensions.rb +0 -0
- data/{lib → misc}/rake/gempackagetask.rb +0 -0
- data/{lib → misc}/rake/packagetask.rb +0 -0
- data/{lib → misc}/rake/rdoctask.rb +0 -0
- data/misc/render_error_pages.rb +6 -5
- data/test/CxxTestMain.cpp +109 -7
- data/test/UtilsTest.cpp +61 -51
- data/test/config.yml.example +6 -2
- data/test/integration_tests.rb +4 -0
- data/test/ruby/abstract_request_handler_spec.rb +9 -3
- data/test/ruby/rack/application_spawner_spec.rb +3 -2
- data/test/ruby/rails/application_spawner_spec.rb +15 -4
- data/test/ruby/rails/framework_spawner_spec.rb +4 -2
- data/test/ruby/rails/spawner_error_handling_spec.rb +4 -4
- data/test/ruby/spawn_manager_spec.rb +22 -9
- data/test/ruby/utils_spec.rb +18 -12
- data/test/ruby/wsgi/application_spawner_spec.rb +16 -7
- data/test/stub/apache2/httpd.conf.erb +1 -0
- data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
- metadata +1064 -1090
- data/doc/Users guide Apache.html +0 -3127
- data/doc/Users guide Nginx.html +0 -1458
@@ -214,7 +214,7 @@
|
|
214
214
|
<a name="l00198"></a>00198
|
215
215
|
<a name="l00199"></a>00199 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_POOL_H_ */</span>
|
216
216
|
</pre></div></div>
|
217
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
217
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
218
218
|
<a href="http://www.doxygen.org/index.html">
|
219
219
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
220
220
|
</body>
|
@@ -541,7 +541,7 @@
|
|
541
541
|
<a name="l00525"></a>00525
|
542
542
|
<a name="l00526"></a>00526 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_APPLICATION_H_ */</span>
|
543
543
|
</pre></div></div>
|
544
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
544
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
545
545
|
<a href="http://www.doxygen.org/index.html">
|
546
546
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
547
547
|
</body>
|
@@ -60,7 +60,7 @@
|
|
60
60
|
<a name="l00044"></a>00044 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_BUCKET_H_ */</span>
|
61
61
|
<a name="l00045"></a>00045
|
62
62
|
</pre></div></div>
|
63
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
63
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
64
64
|
<a href="http://www.doxygen.org/index.html">
|
65
65
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
66
66
|
</body>
|
@@ -119,72 +119,63 @@
|
|
119
119
|
<a name="l00103"></a>00103 <span class="comment"> * @return 0 if the stat() call succeeded or if no stat() was performed,</span>
|
120
120
|
<a name="l00104"></a>00104 <span class="comment"> * -1 if something went wrong while statting the file. In the latter</span>
|
121
121
|
<a name="l00105"></a>00105 <span class="comment"> * case, <tt>errno</tt> will be populated with an appropriate error code.</span>
|
122
|
-
<a name="l00106"></a>00106 <span class="comment"> * @throws SystemException Something went wrong while retrieving the
|
123
|
-
<a name="l00107"></a>00107 <span class="comment"> *
|
124
|
-
<a name="l00108"></a>00108 <span class="comment">
|
125
|
-
<a name="l00109"></a>00109
|
126
|
-
<a name="l00110"></a>00110
|
127
|
-
<a name="l00111"></a>00111
|
128
|
-
<a name="l00112"></a>00112
|
129
|
-
<a name="l00113"></a>00113
|
130
|
-
<a name="l00114"></a>00114
|
131
|
-
<a name="l00115"></a>00115
|
132
|
-
<a name="l00116"></a>00116
|
133
|
-
<a name="l00117"></a>00117
|
134
|
-
<a name="l00118"></a>00118
|
135
|
-
<a name="l00119"></a>00119 <span class="
|
136
|
-
<a name="l00120"></a>00120
|
137
|
-
<a name="l00121"></a>00121
|
138
|
-
<a name="l00122"></a>00122
|
139
|
-
<a name="l00123"></a>00123
|
140
|
-
<a name="l00124"></a>00124
|
141
|
-
<a name="l00125"></a>00125
|
142
|
-
<a name="l00126"></a>00126
|
143
|
-
<a name="l00127"></a>00127
|
144
|
-
<a name="l00128"></a>00128
|
145
|
-
<a name="l00129"></a>00129
|
146
|
-
<a name="l00130"></a>00130
|
147
|
-
<a name="l00131"></a>00131
|
148
|
-
<a name="l00132"></a>00132
|
149
|
-
<a name="l00133"></a>00133
|
150
|
-
<a name="l00134"></a>00134
|
151
|
-
<a name="l00135"></a>00135
|
152
|
-
<a name="l00136"></a>00136
|
153
|
-
<a name="l00137"></a>00137 <span class="
|
154
|
-
<a name="l00138"></a>00138
|
155
|
-
<a name="l00139"></a>00139
|
156
|
-
<a name="l00140"></a>00140 <span class="
|
157
|
-
<a name="l00141"></a>00141 <span class="
|
158
|
-
<a name="l00142"></a>00142 <span class="
|
159
|
-
<a name="l00143"></a>00143 <span class="
|
160
|
-
<a name="l00144"></a>00144 <span class="comment"
|
161
|
-
<a name="l00145"></a>00145 <span class="comment">
|
162
|
-
<a name="l00146"></a>00146 <span class="
|
163
|
-
<a name="l00147"></a>00147
|
164
|
-
<a name="l00148"></a>00148 <span class="
|
165
|
-
<a name="l00149"></a>00149 <span class="
|
166
|
-
<a name="l00150"></a>00150 <span class="
|
167
|
-
<a name="l00151"></a>00151
|
168
|
-
<a name="l00152"></a>00152
|
169
|
-
<a name="l00153"></a>00153
|
170
|
-
<a name="l00154"></a>00154
|
171
|
-
<a name="l00155"></a>00155 <span class="
|
172
|
-
<a name="l00156"></a>00156
|
173
|
-
<a name="l00157"></a>00157
|
174
|
-
<a name="l00158"></a>00158 <span class="
|
175
|
-
<a name="l00159"></a>00159 <span class="
|
176
|
-
<a name="l00160"></a>00160
|
177
|
-
<a name="l00161"></a>00161 <span class="keyword">struct</span> stat *buf,
|
178
|
-
<a name="l00162"></a>00162 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttle_rate);
|
179
|
-
<a name="l00163"></a>00163
|
180
|
-
<a name="l00164"></a>00164 <span class="preprocessor">#ifdef __cplusplus</span>
|
181
|
-
<a name="l00165"></a>00165 <span class="preprocessor"></span> }
|
182
|
-
<a name="l00166"></a>00166 <span class="preprocessor">#endif</span>
|
183
|
-
<a name="l00167"></a>00167 <span class="preprocessor"></span>
|
184
|
-
<a name="l00168"></a>00168 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CACHED_FILE_STAT_H_ */</span>
|
185
|
-
<a name="l00169"></a>00169
|
122
|
+
<a name="l00106"></a>00106 <span class="comment"> * @throws SystemException Something went wrong while retrieving the</span>
|
123
|
+
<a name="l00107"></a>00107 <span class="comment"> * system time. stat() errors will <em>not</em> result in SystemException</span>
|
124
|
+
<a name="l00108"></a>00108 <span class="comment"> * being thrown.</span>
|
125
|
+
<a name="l00109"></a>00109 <span class="comment"> * @throws boost::thread_interrupted</span>
|
126
|
+
<a name="l00110"></a>00110 <span class="comment"> */</span>
|
127
|
+
<a name="l00111"></a>00111 <span class="keywordtype">int</span> refresh(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate) {
|
128
|
+
<a name="l00112"></a>00112 time_t currentTime;
|
129
|
+
<a name="l00113"></a>00113
|
130
|
+
<a name="l00114"></a>00114 <span class="keywordflow">if</span> (expired(last_time, throttleRate, currentTime)) {
|
131
|
+
<a name="l00115"></a>00115 last_result = syscalls::stat(filename.c_str(), &info);
|
132
|
+
<a name="l00116"></a>00116 last_errno = errno;
|
133
|
+
<a name="l00117"></a>00117 last_time = currentTime;
|
134
|
+
<a name="l00118"></a>00118 <span class="keywordflow">return</span> last_result;
|
135
|
+
<a name="l00119"></a>00119 } <span class="keywordflow">else</span> {
|
136
|
+
<a name="l00120"></a>00120 errno = last_errno;
|
137
|
+
<a name="l00121"></a>00121 <span class="keywordflow">return</span> last_result;
|
138
|
+
<a name="l00122"></a>00122 }
|
139
|
+
<a name="l00123"></a>00123 }
|
140
|
+
<a name="l00124"></a>00124 };
|
141
|
+
<a name="l00125"></a>00125
|
142
|
+
<a name="l00126"></a>00126 } <span class="comment">// namespace Passenger</span>
|
143
|
+
<a name="l00127"></a>00127
|
144
|
+
<a name="l00128"></a>00128 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
|
145
|
+
<a name="l00129"></a>00129
|
146
|
+
<a name="l00130"></a>00130
|
147
|
+
<a name="l00131"></a>00131 <span class="preprocessor">#ifdef __cplusplus</span>
|
148
|
+
<a name="l00132"></a>00132 <span class="preprocessor"></span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
|
149
|
+
<a name="l00133"></a>00133 <span class="preprocessor">#endif</span>
|
150
|
+
<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="comment"></span>
|
151
|
+
<a name="l00135"></a>00135 <span class="comment">/**</span>
|
152
|
+
<a name="l00136"></a>00136 <span class="comment"> * CachedMultiFileStat allows one to stat() files at a throttled rate, in order</span>
|
153
|
+
<a name="l00137"></a>00137 <span class="comment"> * to minimize stress on the filesystem. It does this by caching the old stat</span>
|
154
|
+
<a name="l00138"></a>00138 <span class="comment"> * data for a specified amount of time.</span>
|
155
|
+
<a name="l00139"></a>00139 <span class="comment"> *</span>
|
156
|
+
<a name="l00140"></a>00140 <span class="comment"> * Unlike CachedFileStat, which can only stat() one specific file per</span>
|
157
|
+
<a name="l00141"></a>00141 <span class="comment"> * CachedFileStat object, CachedMultiFileStat can stat() any file. The</span>
|
158
|
+
<a name="l00142"></a>00142 <span class="comment"> * number of cached stat() information is limited by the given cache size.</span>
|
159
|
+
<a name="l00143"></a>00143 <span class="comment"> *</span>
|
160
|
+
<a name="l00144"></a>00144 <span class="comment"> * This class is fully thread-safe.</span>
|
161
|
+
<a name="l00145"></a>00145 <span class="comment"> */</span>
|
162
|
+
<a name="l00146"></a>00146 <span class="keyword">typedef</span> <span class="keyword">struct </span>CachedMultiFileStat CachedMultiFileStat;
|
163
|
+
<a name="l00147"></a>00147
|
164
|
+
<a name="l00148"></a>00148 CachedMultiFileStat *cached_multi_file_stat_new(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max_size);
|
165
|
+
<a name="l00149"></a>00149 <span class="keywordtype">void</span> cached_multi_file_stat_free(CachedMultiFileStat *mstat);
|
166
|
+
<a name="l00150"></a>00150 <span class="keywordtype">int</span> cached_multi_file_stat_perform(CachedMultiFileStat *mstat,
|
167
|
+
<a name="l00151"></a>00151 <span class="keyword">const</span> <span class="keywordtype">char</span> *filename,
|
168
|
+
<a name="l00152"></a>00152 <span class="keyword">struct</span> stat *buf,
|
169
|
+
<a name="l00153"></a>00153 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttle_rate);
|
170
|
+
<a name="l00154"></a>00154
|
171
|
+
<a name="l00155"></a>00155 <span class="preprocessor">#ifdef __cplusplus</span>
|
172
|
+
<a name="l00156"></a>00156 <span class="preprocessor"></span> }
|
173
|
+
<a name="l00157"></a>00157 <span class="preprocessor">#endif</span>
|
174
|
+
<a name="l00158"></a>00158 <span class="preprocessor"></span>
|
175
|
+
<a name="l00159"></a>00159 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CACHED_FILE_STAT_H_ */</span>
|
176
|
+
<a name="l00160"></a>00160
|
186
177
|
</pre></div></div>
|
187
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
178
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
188
179
|
<a href="http://www.doxygen.org/index.html">
|
189
180
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
190
181
|
</body>
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<a name="l00041"></a>00041 <span class="comment"> */</span>
|
58
58
|
<a name="l00042"></a>00042 <span class="comment"></span>
|
59
59
|
<a name="l00043"></a>00043 <span class="comment">/** Module version number. */</span>
|
60
|
-
<a name="l00044"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00044</a> <span class="preprocessor">#define PASSENGER_VERSION "2.1.
|
60
|
+
<a name="l00044"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00044</a> <span class="preprocessor">#define PASSENGER_VERSION "2.1.3"</span>
|
61
61
|
<a name="l00045"></a>00045 <span class="preprocessor"></span>
|
62
62
|
<a name="l00046"></a>00046 <span class="preprocessor">#ifdef __cplusplus</span>
|
63
63
|
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor"> #include <set></span>
|
@@ -317,40 +317,48 @@
|
|
317
317
|
<a name="l00301"></a>00301 <span class="keywordflow">return</span> <span class="stringliteral">"nobody"</span>;
|
318
318
|
<a name="l00302"></a>00302 }
|
319
319
|
<a name="l00303"></a>00303 }
|
320
|
-
<a name="l00304"></a>00304
|
321
|
-
<a name="l00305"></a>00305
|
322
|
-
<a name="l00306"></a>00306
|
323
|
-
<a name="l00307"></a>00307
|
324
|
-
<a name="l00308"></a>00308 <span class="
|
325
|
-
<a name="l00309"></a>00309
|
326
|
-
<a name="l00310"></a>00310
|
327
|
-
<a name="l00311"></a>00311
|
328
|
-
<a name="l00312"></a>00312
|
329
|
-
<a name="l00313"></a>00313
|
330
|
-
<a name="l00314"></a>00314
|
331
|
-
<a name="l00315"></a>00315 <span class="
|
332
|
-
<a name="l00316"></a>00316 <span class="
|
333
|
-
<a name="l00317"></a>00317 <span class="
|
334
|
-
<a name="l00318"></a>00318 <span class="comment"
|
335
|
-
<a name="l00319"></a>00319 <span class="
|
336
|
-
<a name="l00320"></a>00320 <span class="
|
337
|
-
<a name="l00321"></a>00321
|
338
|
-
<a name="l00322"></a>00322 <span class="keywordtype">void</span>
|
320
|
+
<a name="l00304"></a>00304
|
321
|
+
<a name="l00305"></a>00305 <span class="keyword">const</span> <span class="keywordtype">char</span> *getTempDir()<span class="keyword"> const </span>{
|
322
|
+
<a name="l00306"></a>00306 <span class="keywordflow">if</span> (tempDir != NULL) {
|
323
|
+
<a name="l00307"></a>00307 <span class="keywordflow">return</span> tempDir;
|
324
|
+
<a name="l00308"></a>00308 } <span class="keywordflow">else</span> {
|
325
|
+
<a name="l00309"></a>00309 <span class="keywordflow">return</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>();
|
326
|
+
<a name="l00310"></a>00310 }
|
327
|
+
<a name="l00311"></a>00311 }
|
328
|
+
<a name="l00312"></a>00312 };
|
329
|
+
<a name="l00313"></a>00313 }
|
330
|
+
<a name="l00314"></a>00314
|
331
|
+
<a name="l00315"></a>00315 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
|
332
|
+
<a name="l00316"></a>00316 <span class="preprocessor">#endif</span>
|
333
|
+
<a name="l00317"></a>00317 <span class="preprocessor"></span><span class="comment"></span>
|
334
|
+
<a name="l00318"></a>00318 <span class="comment">/** Configuration hook for per-directory configuration structure creation. */</span>
|
335
|
+
<a name="l00319"></a>00319 <span class="keywordtype">void</span> *<a class="code" href="group__Configuration.html#g92dc583c1fa5f8025149799e356a6c78" title="Configuration hook for per-directory configuration structure creation.">passenger_config_create_dir</a>(apr_pool_t *p, <span class="keywordtype">char</span> *dirspec);
|
336
|
+
<a name="l00320"></a>00320 <span class="comment"></span>
|
337
|
+
<a name="l00321"></a>00321 <span class="comment">/** Configuration hook for per-directory configuration structure merging. */</span>
|
338
|
+
<a name="l00322"></a>00322 <span class="keywordtype">void</span> *<a class="code" href="group__Configuration.html#g17787a036ef3f4dc46ae0acc9da2c7b0" title="Configuration hook for per-directory configuration structure merging.">passenger_config_merge_dir</a>(apr_pool_t *p, <span class="keywordtype">void</span> *basev, <span class="keywordtype">void</span> *addv);
|
339
339
|
<a name="l00323"></a>00323 <span class="comment"></span>
|
340
|
-
<a name="l00324"></a>00324 <span class="comment">/**
|
341
|
-
<a name="l00325"></a>00325 <span class="
|
342
|
-
<a name="l00326"></a>00326
|
343
|
-
<a name="l00327"></a>00327 <span class="
|
344
|
-
<a name="l00328"></a>00328 <span class="
|
345
|
-
<a name="l00329"></a>00329
|
346
|
-
<a name="l00330"></a>00330 <span class="
|
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="
|
340
|
+
<a name="l00324"></a>00324 <span class="comment">/** Configuration hook for per-server configuration structure creation. */</span>
|
341
|
+
<a name="l00325"></a>00325 <span class="keywordtype">void</span> *<a class="code" href="group__Configuration.html#ga93bd8d426649b4e86da38eb67a49178" title="Configuration hook for per-server configuration structure creation.">passenger_config_create_server</a>(apr_pool_t *p, server_rec *s);
|
342
|
+
<a name="l00326"></a>00326 <span class="comment"></span>
|
343
|
+
<a name="l00327"></a>00327 <span class="comment">/** Configuration hook for per-server configuration structure merging. */</span>
|
344
|
+
<a name="l00328"></a>00328 <span class="keywordtype">void</span> *<a class="code" href="group__Configuration.html#g95c963a61867190928d912779952b15e" title="Configuration hook for per-server configuration structure merging.">passenger_config_merge_server</a>(apr_pool_t *p, <span class="keywordtype">void</span> *basev, <span class="keywordtype">void</span> *overridesv);
|
345
|
+
<a name="l00329"></a>00329
|
346
|
+
<a name="l00330"></a>00330 <span class="keywordtype">void</span> passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server);
|
347
|
+
<a name="l00331"></a>00331 <span class="comment"></span>
|
348
|
+
<a name="l00332"></a>00332 <span class="comment">/** Apache module commands array. */</span>
|
349
|
+
<a name="l00333"></a>00333 <span class="keyword">extern</span> <span class="keyword">const</span> command_rec <a class="code" href="group__Configuration.html#g21954abbf4018583acb9d8daef3dfd95" title="Apache module commands array.">passenger_commands</a>[];
|
350
350
|
<a name="l00334"></a>00334
|
351
|
-
<a name="l00335"></a>00335 <span class="preprocessor">#
|
351
|
+
<a name="l00335"></a>00335 <span class="preprocessor">#ifdef __cplusplus</span>
|
352
|
+
<a name="l00336"></a>00336 <span class="preprocessor"></span> }
|
353
|
+
<a name="l00337"></a>00337 <span class="preprocessor">#endif</span>
|
354
|
+
<a name="l00338"></a>00338 <span class="preprocessor"></span><span class="comment"></span>
|
355
|
+
<a name="l00339"></a>00339 <span class="comment">/**</span>
|
356
|
+
<a name="l00340"></a>00340 <span class="comment"> * @}</span>
|
357
|
+
<a name="l00341"></a>00341 <span class="comment"> */</span>
|
358
|
+
<a name="l00342"></a>00342
|
359
|
+
<a name="l00343"></a>00343 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CONFIGURATION_H_ */</span>
|
352
360
|
</pre></div></div>
|
353
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
361
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
354
362
|
<a href="http://www.doxygen.org/index.html">
|
355
363
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
356
364
|
</body>
|
@@ -302,7 +302,7 @@
|
|
302
302
|
<a name="l00286"></a>00286 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_DIRECTORY_MAPPER_H_ */</span>
|
303
303
|
<a name="l00287"></a>00287
|
304
304
|
</pre></div></div>
|
305
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
305
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
306
306
|
<a href="http://www.doxygen.org/index.html">
|
307
307
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
308
308
|
</body>
|
@@ -118,7 +118,7 @@
|
|
118
118
|
<a name="l00102"></a>00102
|
119
119
|
<a name="l00103"></a>00103 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_DUMMY_SPAWN_MANAGER_H_ */</span>
|
120
120
|
</pre></div></div>
|
121
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
121
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:27 2009 for Passenger by
|
122
122
|
<a href="http://www.doxygen.org/index.html">
|
123
123
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
124
124
|
</body>
|
@@ -255,7 +255,7 @@
|
|
255
255
|
<a name="l00239"></a>00239
|
256
256
|
<a name="l00240"></a>00240 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_EXCEPTIONS_H_ */</span>
|
257
257
|
</pre></div></div>
|
258
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
258
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
259
259
|
<a href="http://www.doxygen.org/index.html">
|
260
260
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
261
261
|
</body>
|
@@ -93,37 +93,36 @@
|
|
93
93
|
<a name="l00077"></a>00077 <span class="comment"> * @param throttleRate When set to a non-zero value, throttling will be</span>
|
94
94
|
<a name="l00078"></a>00078 <span class="comment"> * enabled. stat() will be called at most once per</span>
|
95
95
|
<a name="l00079"></a>00079 <span class="comment"> * throttleRate seconds.</span>
|
96
|
-
<a name="l00080"></a>00080 <span class="comment"> * @throws SystemException Something went wrong
|
97
|
-
<a name="l00081"></a>00081 <span class="comment"> *
|
98
|
-
<a name="l00082"></a>00082 <span class="comment">
|
99
|
-
<a name="l00083"></a
|
100
|
-
<a name="l00084"></a>00084
|
101
|
-
<a name="l00085"></a>00085
|
102
|
-
<a name="l00086"></a>00086 <span class="keywordtype">
|
103
|
-
<a name="l00087"></a>00087
|
104
|
-
<a name="l00088"></a>00088 <span class="
|
105
|
-
<a name="l00089"></a>00089
|
106
|
-
<a name="l00090"></a>00090
|
107
|
-
<a name="l00091"></a>00091
|
108
|
-
<a name="l00092"></a>00092
|
109
|
-
<a name="l00093"></a>00093
|
110
|
-
<a name="l00094"></a>00094
|
111
|
-
<a name="l00095"></a>00095
|
112
|
-
<a name="l00096"></a>00096
|
113
|
-
<a name="l00097"></a>00097
|
114
|
-
<a name="l00098"></a>00098
|
115
|
-
<a name="l00099"></a>00099
|
116
|
-
<a name="l00100"></a>00100
|
117
|
-
<a name="l00101"></a>00101
|
118
|
-
<a name="l00102"></a>00102
|
119
|
-
<a name="l00103"></a>00103
|
120
|
-
<a name="l00104"></a>00104
|
121
|
-
<a name="l00105"></a>00105
|
122
|
-
<a name="l00106"></a>00106
|
123
|
-
<a name="l00107"></a>00107
|
124
|
-
<a name="l00108"></a>00108 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_FILE_CHECKER_H_ */</span>
|
96
|
+
<a name="l00080"></a>00080 <span class="comment"> * @throws SystemException Something went wrong while retrieving the</span>
|
97
|
+
<a name="l00081"></a>00081 <span class="comment"> * system time. stat() errors will <em>not</em> result in SystemException</span>
|
98
|
+
<a name="l00082"></a>00082 <span class="comment"> * being thrown.</span>
|
99
|
+
<a name="l00083"></a>00083 <span class="comment"> * @throws boost::thread_interrupted</span>
|
100
|
+
<a name="l00084"></a>00084 <span class="comment"> */</span>
|
101
|
+
<a name="l00085"></a><a class="code" href="classPassenger_1_1FileChecker.html#832ff27b4b3e5db84a9d986285e7c270">00085</a> <span class="keywordtype">bool</span> <a class="code" href="classPassenger_1_1FileChecker.html#832ff27b4b3e5db84a9d986285e7c270" title="Checks whether the file&#39;s timestamp has changed or has been created or removed...">changed</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0) {
|
102
|
+
<a name="l00086"></a>00086 <span class="keywordtype">int</span> ret;
|
103
|
+
<a name="l00087"></a>00087 time_t ctime, mtime;
|
104
|
+
<a name="l00088"></a>00088 <span class="keywordtype">bool</span> result;
|
105
|
+
<a name="l00089"></a>00089
|
106
|
+
<a name="l00090"></a>00090 ret = cstat.refresh(throttleRate);
|
107
|
+
<a name="l00091"></a>00091 <span class="keywordflow">if</span> (ret == -1) {
|
108
|
+
<a name="l00092"></a>00092 ctime = 0;
|
109
|
+
<a name="l00093"></a>00093 mtime = 0;
|
110
|
+
<a name="l00094"></a>00094 } <span class="keywordflow">else</span> {
|
111
|
+
<a name="l00095"></a>00095 ctime = cstat.info.st_ctime;
|
112
|
+
<a name="l00096"></a>00096 mtime = cstat.info.st_mtime;
|
113
|
+
<a name="l00097"></a>00097 }
|
114
|
+
<a name="l00098"></a>00098 result = lastMtime != mtime || lastCtime != ctime;
|
115
|
+
<a name="l00099"></a>00099 lastMtime = mtime;
|
116
|
+
<a name="l00100"></a>00100 lastCtime = ctime;
|
117
|
+
<a name="l00101"></a>00101 <span class="keywordflow">return</span> result;
|
118
|
+
<a name="l00102"></a>00102 }
|
119
|
+
<a name="l00103"></a>00103 };
|
120
|
+
<a name="l00104"></a>00104
|
121
|
+
<a name="l00105"></a>00105 } <span class="comment">// namespace Passenger</span>
|
122
|
+
<a name="l00106"></a>00106
|
123
|
+
<a name="l00107"></a>00107 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_FILE_CHECKER_H_ */</span>
|
125
124
|
</pre></div></div>
|
126
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
125
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
127
126
|
<a href="http://www.doxygen.org/index.html">
|
128
127
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
129
128
|
</body>
|
@@ -55,7 +55,7 @@
|
|
55
55
|
<a name="l00039"></a>00039 <span class="preprocessor"></span>
|
56
56
|
<a name="l00040"></a>00040 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_HOOKS_H_ */</span>
|
57
57
|
</pre></div></div>
|
58
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
58
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
59
59
|
<a href="http://www.doxygen.org/index.html">
|
60
60
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
61
61
|
</body>
|
@@ -132,7 +132,7 @@
|
|
132
132
|
<a name="l00116"></a>00116 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_LOGGING_H_ */</span>
|
133
133
|
<a name="l00117"></a>00117
|
134
134
|
</pre></div></div>
|
135
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
135
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
136
136
|
<a href="http://www.doxygen.org/index.html">
|
137
137
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
138
138
|
</body>
|
@@ -625,7 +625,7 @@
|
|
625
625
|
<a name="l00609"></a>00609
|
626
626
|
<a name="l00610"></a>00610 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_MESSAGE_CHANNEL_H_ */</span>
|
627
627
|
</pre></div></div>
|
628
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
628
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
629
629
|
<a href="http://www.doxygen.org/index.html">
|
630
630
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
631
631
|
</body>
|
@@ -298,7 +298,7 @@
|
|
298
298
|
<a name="l00282"></a>00282 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_SPAWN_OPTIONS_H_ */</span>
|
299
299
|
<a name="l00283"></a>00283
|
300
300
|
</pre></div></div>
|
301
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
301
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
302
302
|
<a href="http://www.doxygen.org/index.html">
|
303
303
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
304
304
|
</body>
|
@@ -342,226 +342,232 @@
|
|
342
342
|
<a name="l00326"></a>00326
|
343
343
|
<a name="l00327"></a>00327 UPDATE_TRACE_POINT();
|
344
344
|
<a name="l00328"></a>00328 <span class="keywordflow">if</span> (args[2] == <span class="stringliteral">"unix"</span>) {
|
345
|
-
<a name="l00329"></a>00329 <span class="
|
346
|
-
<a name="l00330"></a>00330
|
347
|
-
<a name="l00331"></a>00331
|
348
|
-
<a name="l00332"></a>00332
|
349
|
-
<a name="l00333"></a>00333
|
350
|
-
<a name="l00334"></a>00334
|
351
|
-
<a name="l00335"></a>00335
|
352
|
-
<a name="l00336"></a>00336
|
353
|
-
<a name="l00337"></a>00337
|
354
|
-
<a name="l00338"></a>00338
|
355
|
-
<a name="l00339"></a>00339
|
356
|
-
<a name="l00340"></a>00340
|
357
|
-
<a name="l00341"></a>00341 <span class="
|
358
|
-
<a name="l00342"></a>00342
|
359
|
-
<a name="l00343"></a>00343 <span class="
|
360
|
-
<a name="l00344"></a>00344
|
361
|
-
<a name="l00345"></a>00345
|
362
|
-
<a name="l00346"></a>00346
|
363
|
-
<a name="l00347"></a>00347
|
364
|
-
<a name="l00348"></a>00348
|
365
|
-
<a name="l00349"></a>00349
|
366
|
-
<a name="l00350"></a>00350
|
367
|
-
<a name="l00351"></a>00351
|
368
|
-
<a name="l00352"></a>00352
|
369
|
-
<a name="l00353"></a>00353
|
370
|
-
<a name="l00354"></a>00354
|
371
|
-
<a name="l00355"></a>00355 P_DEBUG(<span class="stringliteral">"
|
372
|
-
<a name="l00356"></a>00356
|
373
|
-
<a name="l00357"></a>00357
|
374
|
-
<a name="l00358"></a>00358 P_DEBUG(<span class="stringliteral">"Restart
|
375
|
-
<a name="l00359"></a>00359 restarted = <span class="keyword">
|
376
|
-
<a name="l00360"></a>00360 }
|
377
|
-
<a name="l00361"></a>00361
|
378
|
-
<a name="l00362"></a>00362 <span class="
|
379
|
-
<a name="l00363"></a>00363 } <span class="keywordflow">
|
380
|
-
<a name="l00364"></a>00364 <span class="
|
381
|
-
<a name="l00365"></a>00365
|
382
|
-
<a name="l00366"></a>00366
|
383
|
-
<a name="l00367"></a>00367
|
384
|
-
<a name="l00368"></a>00368
|
385
|
-
<a name="l00369"></a>00369 <span class="
|
386
|
-
<a name="l00370"></a>00370 <span class="
|
387
|
-
<a name="l00371"></a>00371
|
388
|
-
<a name="l00372"></a>00372
|
389
|
-
<a name="l00373"></a>00373
|
390
|
-
<a name="l00374"></a>00374
|
391
|
-
<a name="l00375"></a>00375
|
392
|
-
<a name="l00376"></a>00376
|
393
|
-
<a name="l00377"></a>00377
|
394
|
-
<a name="l00378"></a>00378
|
395
|
-
<a name="l00379"></a>00379
|
396
|
-
<a name="l00380"></a>00380
|
397
|
-
<a name="l00381"></a>00381
|
398
|
-
<a name="l00382"></a>00382
|
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 P_DEBUG(<span class="stringliteral">"Restart
|
413
|
-
<a name="l00397"></a>00397 restarted = <span class="keyword">
|
414
|
-
<a name="l00398"></a>00398 }
|
415
|
-
<a name="l00399"></a>00399
|
416
|
-
<a name="l00400"></a>00400 <span class="
|
417
|
-
<a name="l00401"></a>00401 } <span class="keywordflow">
|
418
|
-
<a name="l00402"></a>00402 <span class="
|
419
|
-
<a name="l00403"></a>00403
|
420
|
-
<a name="l00404"></a>00404
|
421
|
-
<a name="l00405"></a>00405
|
422
|
-
<a name="l00406"></a>00406
|
423
|
-
<a name="l00407"></a>00407 <span class="keywordflow">
|
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>00418
|
435
|
-
<a name="l00419"></a>00419
|
436
|
-
<a name="l00420"></a>00420 <span class="
|
437
|
-
<a name="l00421"></a>00421 <span class="
|
438
|
-
<a name="l00422"></a>00422 <span class="
|
439
|
-
<a name="l00423"></a>00423 <span class="
|
440
|
-
<a name="l00424"></a>00424 <span class="comment"
|
441
|
-
<a name="l00425"></a>00425 <span class="comment">
|
442
|
-
<a name="l00426"></a>00426 <span class="comment"> *
|
443
|
-
<a name="l00427"></a>00427 <span class="comment">
|
444
|
-
<a name="l00428"></a>00428 <span class="comment"> *
|
445
|
-
<a name="l00429"></a>00429 <span class="comment"> * @param
|
446
|
-
<a name="l00430"></a>00430 <span class="comment"> *
|
447
|
-
<a name="l00431"></a>00431 <span class="comment"> *
|
448
|
-
<a name="l00432"></a>00432 <span class="comment"> *
|
449
|
-
<a name="l00433"></a>00433 <span class="comment"> *
|
450
|
-
<a name="l00434"></a>00434 <span class="comment"> *
|
451
|
-
<a name="l00435"></a>00435 <span class="comment"> * @
|
452
|
-
<a name="l00436"></a>00436 <span class="comment"> * @
|
453
|
-
<a name="l00437"></a>00437 <span class="comment">
|
454
|
-
<a name="l00438"></a
|
455
|
-
<a name="l00439"></a>00439
|
456
|
-
<a name="l00440"></a>00440
|
457
|
-
<a name="l00441"></a>00441
|
458
|
-
<a name="l00442"></a>00442
|
459
|
-
<a name="l00443"></a>00443
|
460
|
-
<a name="l00444"></a>00444
|
461
|
-
<a name="l00445"></a>00445
|
462
|
-
<a name="l00446"></a>00446
|
463
|
-
<a name="l00447"></a>00447
|
464
|
-
<a name="l00448"></a>00448
|
465
|
-
<a name="l00449"></a>00449
|
466
|
-
<a name="l00450"></a>00450
|
467
|
-
<a name="l00451"></a>00451
|
468
|
-
<a name="l00452"></a>00452
|
469
|
-
<a name="l00453"></a>00453
|
470
|
-
<a name="l00454"></a>00454
|
471
|
-
<a name="l00455"></a>00455
|
472
|
-
<a name="l00456"></a>00456
|
473
|
-
<a name="l00457"></a>00457
|
474
|
-
<a name="l00458"></a>00458
|
475
|
-
<a name="l00459"></a>00459
|
476
|
-
<a name="l00460"></a>00460
|
477
|
-
<a name="l00461"></a>00461
|
478
|
-
<a name="l00462"></a>00462
|
479
|
-
<a name="l00463"></a>00463
|
480
|
-
<a name="l00464"></a>00464
|
481
|
-
<a name="l00465"></a>00465
|
482
|
-
<a name="l00466"></a>00466
|
483
|
-
<a name="l00467"></a>00467
|
484
|
-
<a name="l00468"></a>00468
|
485
|
-
<a name="l00469"></a>00469
|
486
|
-
<a name="l00470"></a>00470
|
487
|
-
<a name="l00471"></a>00471
|
488
|
-
<a name="l00472"></a>00472
|
489
|
-
<a name="l00473"></a>00473
|
490
|
-
<a name="l00474"></a>00474
|
491
|
-
<a name="l00475"></a>00475
|
492
|
-
<a name="l00476"></a>00476
|
493
|
-
<a name="l00477"></a>00477 <span class="
|
494
|
-
<a name="l00478"></a>00478
|
495
|
-
<a name="l00479"></a>00479
|
496
|
-
<a name="l00480"></a>00480
|
497
|
-
<a name="l00481"></a>00481 <span class="comment">
|
498
|
-
<a name="l00482"></a>00482 <span class="comment"> *
|
499
|
-
<a name="l00483"></a>00483 <span class="comment">
|
500
|
-
<a name="l00484"></a>00484 <span class="comment">
|
501
|
-
<a name="l00485"></a>00485 <span class="comment"> *
|
502
|
-
<a name="l00486"></a>00486 <span class="comment"> *
|
503
|
-
<a name="l00487"></a>00487 <span class="comment"> *
|
504
|
-
<a name="l00488"></a>00488 <span class="comment"> *
|
505
|
-
<a name="l00489"></a>00489 <span class="comment">
|
506
|
-
<a name="l00490"></a>00490 <span class="comment"> * @
|
507
|
-
<a name="l00491"></a>00491 <span class="comment">
|
508
|
-
<a name="l00492"></a
|
509
|
-
<a name="l00493"></a>00493
|
510
|
-
<a name="l00494"></a>00494
|
511
|
-
<a name="l00495"></a>00495
|
512
|
-
<a name="l00496"></a>00496
|
513
|
-
<a name="l00497"></a>00497
|
514
|
-
<a name="l00498"></a
|
515
|
-
<a name="l00499"></a>00499
|
516
|
-
<a name="l00500"></a>00500
|
517
|
-
<a name="l00501"></a>00501
|
518
|
-
<a name="l00502"></a>00502
|
519
|
-
<a name="l00503"></a>00503 }
|
520
|
-
<a name="l00504"></a>00504
|
521
|
-
<a name="l00505"></a>00505
|
522
|
-
<a name="l00506"></a>00506 <span class="
|
523
|
-
<a name="l00507"></a>00507
|
524
|
-
<a name="l00508"></a>00508
|
525
|
-
<a name="l00509"></a>00509
|
526
|
-
<a name="l00510"></a>00510
|
527
|
-
<a name="l00511"></a>00511
|
528
|
-
<a name="l00512"></a>00512 <span class="comment">
|
529
|
-
<a name="l00513"></a>00513 <span class="comment"> *
|
530
|
-
<a name="l00514"></a>00514 <span class="comment">
|
531
|
-
<a name="l00515"></a>00515 <span class="comment">
|
532
|
-
<a name="l00516"></a>00516 <span class="comment"> *
|
533
|
-
<a name="l00517"></a>00517 <span class="comment"> *
|
534
|
-
<a name="l00518"></a>00518 <span class="comment"> *
|
535
|
-
<a name="l00519"></a>00519 <span class="comment"> *
|
536
|
-
<a name="l00520"></a>00520 <span class="comment">
|
537
|
-
<a name="l00521"></a
|
538
|
-
<a name="l00522"></a>00522
|
539
|
-
<a name="l00523"></a>00523
|
540
|
-
<a name="l00524"></a>00524
|
541
|
-
<a name="l00525"></a>00525
|
542
|
-
<a name="l00526"></a>00526
|
543
|
-
<a name="l00527"></a
|
544
|
-
<a name="l00528"></a>00528
|
545
|
-
<a name="l00529"></a>00529
|
546
|
-
<a name="l00530"></a>00530
|
547
|
-
<a name="l00531"></a>00531
|
548
|
-
<a name="l00532"></a>00532
|
549
|
-
<a name="l00533"></a>00533 <span class="
|
550
|
-
<a name="l00534"></a>00534
|
551
|
-
<a name="l00535"></a>00535
|
552
|
-
<a name="l00536"></a
|
553
|
-
<a name="l00537"></a>00537
|
554
|
-
<a name="l00538"></a>00538
|
555
|
-
<a name="l00539"></a>00539
|
556
|
-
<a name="l00540"></a>00540 <span class="comment"
|
557
|
-
<a name="l00541"></a>00541 <span class="comment"
|
558
|
-
<a name="l00542"></a>00542 <span class="keyword">
|
559
|
-
<a name="l00543"></a>00543
|
560
|
-
<a name="l00544"></a>00544
|
561
|
-
<a name="l00545"></a>00545
|
562
|
-
<a name="l00546"></a>00546 <span class="
|
345
|
+
<a name="l00329"></a>00329 <span class="comment">/* Set tighter permissions on the spawned backend process's</span>
|
346
|
+
<a name="l00330"></a>00330 <span class="comment"> * Unix socket. We try to make it only readable and writable</span>
|
347
|
+
<a name="l00331"></a>00331 <span class="comment"> * by the process that contains the application pool, because</span>
|
348
|
+
<a name="l00332"></a>00332 <span class="comment"> * all attempts to connect to a backend process happens</span>
|
349
|
+
<a name="l00333"></a>00333 <span class="comment"> * through the application pool.</span>
|
350
|
+
<a name="l00334"></a>00334 <span class="comment"> */</span>
|
351
|
+
<a name="l00335"></a>00335 <span class="keywordtype">int</span> ret;
|
352
|
+
<a name="l00336"></a>00336 <span class="keywordflow">do</span> {
|
353
|
+
<a name="l00337"></a>00337 ret = chmod(args[1].c_str(), S_IRUSR | S_IWUSR);
|
354
|
+
<a name="l00338"></a>00338 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
355
|
+
<a name="l00339"></a>00339 <span class="keywordflow">do</span> {
|
356
|
+
<a name="l00340"></a>00340 ret = chown(args[1].c_str(), getuid(), getgid());
|
357
|
+
<a name="l00341"></a>00341 } <span class="keywordflow">while</span> (ret == -1 && errno == EINTR);
|
358
|
+
<a name="l00342"></a>00342 }
|
359
|
+
<a name="l00343"></a>00343 <span class="keywordflow">return</span> ApplicationPtr(<span class="keyword">new</span> <a class="code" href="classPassenger_1_1Application.html" title="Represents a single Ruby on Rails or Rack application instance.">Application</a>(PoolOptions.<a class="code" href="structPassenger_1_1PoolOptions.html#822039d204b48d9ed49184646734acf3" title="The root directory of the application to spawn.">appRoot</a>,
|
360
|
+
<a name="l00344"></a>00344 pid, args[1], args[2], ownerPipe));
|
361
|
+
<a name="l00345"></a>00345 }
|
362
|
+
<a name="l00346"></a>00346 <span class="comment"></span>
|
363
|
+
<a name="l00347"></a>00347 <span class="comment"> /**</span>
|
364
|
+
<a name="l00348"></a>00348 <span class="comment"> * @throws boost::thread_interrupted</span>
|
365
|
+
<a name="l00349"></a>00349 <span class="comment"> */</span>
|
366
|
+
<a name="l00350"></a>00350 ApplicationPtr
|
367
|
+
<a name="l00351"></a>00351 handleSpawnException(<span class="keyword">const</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a> &e, <span class="keyword">const</span> PoolOptions &PoolOptions) {
|
368
|
+
<a name="l00352"></a>00352 TRACE_POINT();
|
369
|
+
<a name="l00353"></a>00353 <span class="keywordtype">bool</span> restarted;
|
370
|
+
<a name="l00354"></a>00354 <span class="keywordflow">try</span> {
|
371
|
+
<a name="l00355"></a>00355 P_DEBUG(<span class="stringliteral">"Spawn server died. Attempting to restart it..."</span>);
|
372
|
+
<a name="l00356"></a>00356 this_thread::disable_syscall_interruption dsi;
|
373
|
+
<a name="l00357"></a>00357 restartServer();
|
374
|
+
<a name="l00358"></a>00358 P_DEBUG(<span class="stringliteral">"Restart seems to be successful."</span>);
|
375
|
+
<a name="l00359"></a>00359 restarted = <span class="keyword">true</span>;
|
376
|
+
<a name="l00360"></a>00360 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> &e) {
|
377
|
+
<a name="l00361"></a>00361 P_DEBUG(<span class="stringliteral">"Restart failed: "</span> << e.<a class="code" href="classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a">what</a>());
|
378
|
+
<a name="l00362"></a>00362 restarted = <span class="keyword">false</span>;
|
379
|
+
<a name="l00363"></a>00363 } <span class="keywordflow">catch</span> (<span class="keyword">const</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> &e) {
|
380
|
+
<a name="l00364"></a>00364 P_DEBUG(<span class="stringliteral">"Restart failed: "</span> << e.<a class="code" href="classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3">what</a>());
|
381
|
+
<a name="l00365"></a>00365 restarted = <span class="keyword">false</span>;
|
382
|
+
<a name="l00366"></a>00366 }
|
383
|
+
<a name="l00367"></a>00367 <span class="keywordflow">if</span> (restarted) {
|
384
|
+
<a name="l00368"></a>00368 <span class="keywordflow">return</span> sendSpawnCommand(PoolOptions);
|
385
|
+
<a name="l00369"></a>00369 } <span class="keywordflow">else</span> {
|
386
|
+
<a name="l00370"></a>00370 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(<span class="stringliteral">"The spawn server died unexpectedly, and restarting it failed."</span>);
|
387
|
+
<a name="l00371"></a>00371 }
|
388
|
+
<a name="l00372"></a>00372 }
|
389
|
+
<a name="l00373"></a>00373 <span class="comment"></span>
|
390
|
+
<a name="l00374"></a>00374 <span class="comment"> /**</span>
|
391
|
+
<a name="l00375"></a>00375 <span class="comment"> * Send the reload command to the spawn server.</span>
|
392
|
+
<a name="l00376"></a>00376 <span class="comment"> *</span>
|
393
|
+
<a name="l00377"></a>00377 <span class="comment"> * @param appRoot The application root to reload.</span>
|
394
|
+
<a name="l00378"></a>00378 <span class="comment"> * @throws SystemException Something went wrong.</span>
|
395
|
+
<a name="l00379"></a>00379 <span class="comment"> */</span>
|
396
|
+
<a name="l00380"></a>00380 <span class="keywordtype">void</span> sendReloadCommand(<span class="keyword">const</span> <span class="keywordtype">string</span> &appRoot) {
|
397
|
+
<a name="l00381"></a>00381 TRACE_POINT();
|
398
|
+
<a name="l00382"></a>00382 <span class="keywordflow">try</span> {
|
399
|
+
<a name="l00383"></a>00383 channel.<a class="code" href="classPassenger_1_1MessageChannel.html#150f68bc47e060dcc6ca35bee047914d" title="Send an array message, which consists of the given elements, over the underlying...">write</a>(<span class="stringliteral">"reload"</span>, appRoot.c_str(), NULL);
|
400
|
+
<a name="l00384"></a>00384 } <span class="keywordflow">catch</span> (<span class="keyword">const</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> &e) {
|
401
|
+
<a name="l00385"></a>00385 <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>(<span class="stringliteral">"Could not write 'reload' command "</span>
|
402
|
+
<a name="l00386"></a>00386 <span class="stringliteral">"to the spawn server"</span>, e.<a class="code" href="classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c" title="The value of errno at the time the error occured.">code</a>());
|
403
|
+
<a name="l00387"></a>00387 }
|
404
|
+
<a name="l00388"></a>00388 }
|
405
|
+
<a name="l00389"></a>00389
|
406
|
+
<a name="l00390"></a>00390 <span class="keywordtype">void</span> handleReloadException(<span class="keyword">const</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> &e, <span class="keyword">const</span> <span class="keywordtype">string</span> &appRoot) {
|
407
|
+
<a name="l00391"></a>00391 TRACE_POINT();
|
408
|
+
<a name="l00392"></a>00392 <span class="keywordtype">bool</span> restarted;
|
409
|
+
<a name="l00393"></a>00393 <span class="keywordflow">try</span> {
|
410
|
+
<a name="l00394"></a>00394 P_DEBUG(<span class="stringliteral">"Spawn server died. Attempting to restart it..."</span>);
|
411
|
+
<a name="l00395"></a>00395 restartServer();
|
412
|
+
<a name="l00396"></a>00396 P_DEBUG(<span class="stringliteral">"Restart seems to be successful."</span>);
|
413
|
+
<a name="l00397"></a>00397 restarted = <span class="keyword">true</span>;
|
414
|
+
<a name="l00398"></a>00398 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> &e) {
|
415
|
+
<a name="l00399"></a>00399 P_DEBUG(<span class="stringliteral">"Restart failed: "</span> << e.<a class="code" href="classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a">what</a>());
|
416
|
+
<a name="l00400"></a>00400 restarted = <span class="keyword">false</span>;
|
417
|
+
<a name="l00401"></a>00401 } <span class="keywordflow">catch</span> (<span class="keyword">const</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> &e) {
|
418
|
+
<a name="l00402"></a>00402 P_DEBUG(<span class="stringliteral">"Restart failed: "</span> << e.<a class="code" href="classPassenger_1_1SystemException.html#ee405d1078ff3aa1045bc60b1c93d7a3">what</a>());
|
419
|
+
<a name="l00403"></a>00403 restarted = <span class="keyword">false</span>;
|
420
|
+
<a name="l00404"></a>00404 }
|
421
|
+
<a name="l00405"></a>00405 <span class="keywordflow">if</span> (restarted) {
|
422
|
+
<a name="l00406"></a>00406 <span class="keywordflow">return</span> sendReloadCommand(appRoot);
|
423
|
+
<a name="l00407"></a>00407 } <span class="keywordflow">else</span> {
|
424
|
+
<a name="l00408"></a>00408 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(<span class="stringliteral">"The spawn server died unexpectedly, and restarting it failed."</span>);
|
425
|
+
<a name="l00409"></a>00409 }
|
426
|
+
<a name="l00410"></a>00410 }
|
427
|
+
<a name="l00411"></a>00411
|
428
|
+
<a name="l00412"></a>00412 <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> prependMessageToException(<span class="keyword">const</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> &e, <span class="keyword">const</span> <span class="keywordtype">string</span> &message) {
|
429
|
+
<a name="l00413"></a>00413 <span class="keywordflow">return</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>(message + <span class="stringliteral">": "</span> + e.<a class="code" href="classPassenger_1_1IOException.html#1b65d0fdb9bc5136f5b7df759c14768a">what</a>());
|
430
|
+
<a name="l00414"></a>00414 }
|
431
|
+
<a name="l00415"></a>00415
|
432
|
+
<a name="l00416"></a>00416 <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a> prependMessageToException(<span class="keyword">const</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> &e, <span class="keyword">const</span> <span class="keywordtype">string</span> &message) {
|
433
|
+
<a name="l00417"></a>00417 <span class="keywordflow">return</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 + <span class="stringliteral">": "</span> + e.<a class="code" href="classPassenger_1_1SystemException.html#84fa2ab4f5b7b96704734fcdfdaa0269" title="Returns a brief version of the exception message.">brief</a>(), e.<a class="code" href="classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c" title="The value of errno at the time the error occured.">code</a>());
|
434
|
+
<a name="l00418"></a>00418 }
|
435
|
+
<a name="l00419"></a>00419
|
436
|
+
<a name="l00420"></a>00420 <span class="keyword">public</span>:
|
437
|
+
<a name="l00421"></a>00421 <span class="preprocessor"> #ifdef TESTING_SPAWN_MANAGER</span>
|
438
|
+
<a name="l00422"></a>00422 <span class="preprocessor"></span> <span class="keywordtype">bool</span> nextRestartShouldFail;
|
439
|
+
<a name="l00423"></a>00423 <span class="preprocessor"> #endif</span>
|
440
|
+
<a name="l00424"></a>00424 <span class="preprocessor"></span><span class="comment"></span>
|
441
|
+
<a name="l00425"></a>00425 <span class="comment"> /**</span>
|
442
|
+
<a name="l00426"></a>00426 <span class="comment"> * Construct a new SpawnManager.</span>
|
443
|
+
<a name="l00427"></a>00427 <span class="comment"> *</span>
|
444
|
+
<a name="l00428"></a>00428 <span class="comment"> * @param spawnServerCommand The filename of the spawn server to use.</span>
|
445
|
+
<a name="l00429"></a>00429 <span class="comment"> * @param logFile Specify a log file that the spawn server should use.</span>
|
446
|
+
<a name="l00430"></a>00430 <span class="comment"> * Messages on its standard output and standard error channels</span>
|
447
|
+
<a name="l00431"></a>00431 <span class="comment"> * will be written to this log file. If an empty string is</span>
|
448
|
+
<a name="l00432"></a>00432 <span class="comment"> * specified, no log file will be used, and the spawn server</span>
|
449
|
+
<a name="l00433"></a>00433 <span class="comment"> * will use the same standard output/error channels as the</span>
|
450
|
+
<a name="l00434"></a>00434 <span class="comment"> * current process.</span>
|
451
|
+
<a name="l00435"></a>00435 <span class="comment"> * @param rubyCommand The Ruby interpreter's command.</span>
|
452
|
+
<a name="l00436"></a>00436 <span class="comment"> * @param user The user that the spawn manager should run as. This</span>
|
453
|
+
<a name="l00437"></a>00437 <span class="comment"> * parameter only has effect if the current process is</span>
|
454
|
+
<a name="l00438"></a>00438 <span class="comment"> * running as root. If the empty string is given, or if</span>
|
455
|
+
<a name="l00439"></a>00439 <span class="comment"> * the <tt>user</tt> is not a valid username, then</span>
|
456
|
+
<a name="l00440"></a>00440 <span class="comment"> * the spawn manager will be run as the current user.</span>
|
457
|
+
<a name="l00441"></a>00441 <span class="comment"> * @throws SystemException An error occured while trying to setup the spawn server.</span>
|
458
|
+
<a name="l00442"></a>00442 <span class="comment"> * @throws IOException The specified log file could not be opened.</span>
|
459
|
+
<a name="l00443"></a>00443 <span class="comment"> */</span>
|
460
|
+
<a name="l00444"></a><a class="code" href="classPassenger_1_1SpawnManager.html#fdefbbbad39833912ae7f9f106083099">00444</a> <a class="code" href="classPassenger_1_1SpawnManager.html#fdefbbbad39833912ae7f9f106083099" title="Construct a new SpawnManager.">SpawnManager</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &spawnServerCommand,
|
461
|
+
<a name="l00445"></a>00445 <span class="keyword">const</span> <span class="keywordtype">string</span> &logFile = <span class="stringliteral">""</span>,
|
462
|
+
<a name="l00446"></a>00446 <span class="keyword">const</span> <span class="keywordtype">string</span> &rubyCommand = <span class="stringliteral">"ruby"</span>,
|
463
|
+
<a name="l00447"></a>00447 <span class="keyword">const</span> <span class="keywordtype">string</span> &user = <span class="stringliteral">""</span>) {
|
464
|
+
<a name="l00448"></a>00448 TRACE_POINT();
|
465
|
+
<a name="l00449"></a>00449 this->spawnServerCommand = spawnServerCommand;
|
466
|
+
<a name="l00450"></a>00450 this->logFile = logFile;
|
467
|
+
<a name="l00451"></a>00451 this->rubyCommand = rubyCommand;
|
468
|
+
<a name="l00452"></a>00452 this->user = user;
|
469
|
+
<a name="l00453"></a>00453 pid = 0;
|
470
|
+
<a name="l00454"></a>00454 <span class="preprocessor"> #ifdef TESTING_SPAWN_MANAGER</span>
|
471
|
+
<a name="l00455"></a>00455 <span class="preprocessor"></span> nextRestartShouldFail = <span class="keyword">false</span>;
|
472
|
+
<a name="l00456"></a>00456 <span class="preprocessor"> #endif</span>
|
473
|
+
<a name="l00457"></a>00457 <span class="preprocessor"></span> this_thread::disable_interruption di;
|
474
|
+
<a name="l00458"></a>00458 this_thread::disable_syscall_interruption dsi;
|
475
|
+
<a name="l00459"></a>00459 <span class="keywordflow">try</span> {
|
476
|
+
<a name="l00460"></a>00460 restartServer();
|
477
|
+
<a name="l00461"></a>00461 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> &e) {
|
478
|
+
<a name="l00462"></a>00462 <span class="keywordflow">throw</span> prependMessageToException(e, <span class="stringliteral">"Could not start the spawn server"</span>);
|
479
|
+
<a name="l00463"></a>00463 } <span class="keywordflow">catch</span> (<span class="keyword">const</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> &e) {
|
480
|
+
<a name="l00464"></a>00464 <span class="keywordflow">throw</span> prependMessageToException(e, <span class="stringliteral">"Could not start the spawn server"</span>);
|
481
|
+
<a name="l00465"></a>00465 }
|
482
|
+
<a name="l00466"></a>00466 }
|
483
|
+
<a name="l00467"></a>00467
|
484
|
+
<a name="l00468"></a>00468 ~<a class="code" href="classPassenger_1_1SpawnManager.html" title="Spawning of Ruby on Rails/Rack application instances.">SpawnManager</a>() throw() {
|
485
|
+
<a name="l00469"></a>00469 TRACE_POINT();
|
486
|
+
<a name="l00470"></a>00470 <span class="keywordflow">if</span> (pid != 0) {
|
487
|
+
<a name="l00471"></a>00471 UPDATE_TRACE_POINT();
|
488
|
+
<a name="l00472"></a>00472 this_thread::disable_interruption di;
|
489
|
+
<a name="l00473"></a>00473 this_thread::disable_syscall_interruption dsi;
|
490
|
+
<a name="l00474"></a>00474 P_TRACE(2, <span class="stringliteral">"Shutting down spawn manager (PID "</span> << pid << <span class="stringliteral">")."</span>);
|
491
|
+
<a name="l00475"></a>00475 channel.<a class="code" href="classPassenger_1_1MessageChannel.html#06309e208fc5e10642a2e9bbe0f351eb" title="Close the underlying file descriptor.">close</a>();
|
492
|
+
<a name="l00476"></a>00476 syscalls::waitpid(pid, NULL, 0);
|
493
|
+
<a name="l00477"></a>00477 P_TRACE(2, <span class="stringliteral">"Spawn manager exited."</span>);
|
494
|
+
<a name="l00478"></a>00478 }
|
495
|
+
<a name="l00479"></a>00479 }
|
496
|
+
<a name="l00480"></a>00480 <span class="comment"></span>
|
497
|
+
<a name="l00481"></a>00481 <span class="comment"> /**</span>
|
498
|
+
<a name="l00482"></a>00482 <span class="comment"> * Spawn a new instance of an application. Spawning details are to be passed</span>
|
499
|
+
<a name="l00483"></a>00483 <span class="comment"> * via the <tt>PoolOptions</tt> parameter.</span>
|
500
|
+
<a name="l00484"></a>00484 <span class="comment"> *</span>
|
501
|
+
<a name="l00485"></a>00485 <span class="comment"> * If the spawn server died during the spawning process, then the server</span>
|
502
|
+
<a name="l00486"></a>00486 <span class="comment"> * will be automatically restarted, and another spawn attempt will be made.</span>
|
503
|
+
<a name="l00487"></a>00487 <span class="comment"> * If restarting the server fails, or if the second spawn attempt fails,</span>
|
504
|
+
<a name="l00488"></a>00488 <span class="comment"> * then an exception will be thrown.</span>
|
505
|
+
<a name="l00489"></a>00489 <span class="comment"> *</span>
|
506
|
+
<a name="l00490"></a>00490 <span class="comment"> * @param PoolOptions An object containing the details for this spawn operation,</span>
|
507
|
+
<a name="l00491"></a>00491 <span class="comment"> * such as which application to spawn. See PoolOptions for details.</span>
|
508
|
+
<a name="l00492"></a>00492 <span class="comment"> * @return A smart pointer to an Application object, which represents the application</span>
|
509
|
+
<a name="l00493"></a>00493 <span class="comment"> * instance that has been spawned. Use this object to communicate with the</span>
|
510
|
+
<a name="l00494"></a>00494 <span class="comment"> * spawned application.</span>
|
511
|
+
<a name="l00495"></a>00495 <span class="comment"> * @throws SpawnException Something went wrong.</span>
|
512
|
+
<a name="l00496"></a>00496 <span class="comment"> * @throws boost::thread_interrupted</span>
|
513
|
+
<a name="l00497"></a>00497 <span class="comment"> */</span>
|
514
|
+
<a name="l00498"></a><a class="code" href="classPassenger_1_1SpawnManager.html#af035d564cc4e6683508939c9d6dbb64">00498</a> ApplicationPtr <a class="code" href="classPassenger_1_1SpawnManager.html#af035d564cc4e6683508939c9d6dbb64" title="Spawn a new instance of an application.">spawn</a>(<span class="keyword">const</span> PoolOptions &PoolOptions) {
|
515
|
+
<a name="l00499"></a>00499 TRACE_POINT();
|
516
|
+
<a name="l00500"></a>00500 boost::mutex::scoped_lock l(lock);
|
517
|
+
<a name="l00501"></a>00501 <span class="keywordflow">try</span> {
|
518
|
+
<a name="l00502"></a>00502 <span class="keywordflow">return</span> sendSpawnCommand(PoolOptions);
|
519
|
+
<a name="l00503"></a>00503 } <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a> &e) {
|
520
|
+
<a name="l00504"></a>00504 <span class="keywordflow">if</span> (e.<a class="code" href="classPassenger_1_1SpawnException.html#e65dc272e183fd9e5637a4091cc6bbf4" title="Check whether an error page is available.">hasErrorPage</a>()) {
|
521
|
+
<a name="l00505"></a>00505 <span class="keywordflow">throw</span>;
|
522
|
+
<a name="l00506"></a>00506 } <span class="keywordflow">else</span> {
|
523
|
+
<a name="l00507"></a>00507 <span class="keywordflow">return</span> handleSpawnException(e, PoolOptions);
|
524
|
+
<a name="l00508"></a>00508 }
|
525
|
+
<a name="l00509"></a>00509 }
|
526
|
+
<a name="l00510"></a>00510 }
|
527
|
+
<a name="l00511"></a>00511 <span class="comment"></span>
|
528
|
+
<a name="l00512"></a>00512 <span class="comment"> /**</span>
|
529
|
+
<a name="l00513"></a>00513 <span class="comment"> * Remove the cached application instances at the given application root.</span>
|
530
|
+
<a name="l00514"></a>00514 <span class="comment"> *</span>
|
531
|
+
<a name="l00515"></a>00515 <span class="comment"> * Application code might be cached in memory. But once it a while, it will</span>
|
532
|
+
<a name="l00516"></a>00516 <span class="comment"> * be necessary to reload the code for an application, such as after</span>
|
533
|
+
<a name="l00517"></a>00517 <span class="comment"> * deploying a new version of the application. This method makes sure that</span>
|
534
|
+
<a name="l00518"></a>00518 <span class="comment"> * any cached application code is removed, so that the next time an</span>
|
535
|
+
<a name="l00519"></a>00519 <span class="comment"> * application instance is spawned, the application code will be freshly</span>
|
536
|
+
<a name="l00520"></a>00520 <span class="comment"> * loaded into memory.</span>
|
537
|
+
<a name="l00521"></a>00521 <span class="comment"> *</span>
|
538
|
+
<a name="l00522"></a>00522 <span class="comment"> * @throws SystemException Unable to communicate with the spawn server,</span>
|
539
|
+
<a name="l00523"></a>00523 <span class="comment"> * even after a restart.</span>
|
540
|
+
<a name="l00524"></a>00524 <span class="comment"> * @throws SpawnException The spawn server died unexpectedly, and a</span>
|
541
|
+
<a name="l00525"></a>00525 <span class="comment"> * restart was attempted, but it failed.</span>
|
542
|
+
<a name="l00526"></a>00526 <span class="comment"> */</span>
|
543
|
+
<a name="l00527"></a><a class="code" href="classPassenger_1_1SpawnManager.html#2e85c43042b9556ca2fd74b8d28956ce">00527</a> <span class="keywordtype">void</span> <a class="code" href="classPassenger_1_1SpawnManager.html#2e85c43042b9556ca2fd74b8d28956ce" title="Remove the cached application instances at the given application root.">reload</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &appRoot) {
|
544
|
+
<a name="l00528"></a>00528 TRACE_POINT();
|
545
|
+
<a name="l00529"></a>00529 this_thread::disable_interruption di;
|
546
|
+
<a name="l00530"></a>00530 this_thread::disable_syscall_interruption dsi;
|
547
|
+
<a name="l00531"></a>00531 <span class="keywordflow">try</span> {
|
548
|
+
<a name="l00532"></a>00532 <span class="keywordflow">return</span> sendReloadCommand(appRoot);
|
549
|
+
<a name="l00533"></a>00533 } <span class="keywordflow">catch</span> (<span class="keyword">const</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> &e) {
|
550
|
+
<a name="l00534"></a>00534 <span class="keywordflow">return</span> handleReloadException(e, appRoot);
|
551
|
+
<a name="l00535"></a>00535 }
|
552
|
+
<a name="l00536"></a>00536 }
|
553
|
+
<a name="l00537"></a>00537 <span class="comment"></span>
|
554
|
+
<a name="l00538"></a>00538 <span class="comment"> /**</span>
|
555
|
+
<a name="l00539"></a>00539 <span class="comment"> * Get the Process ID of the spawn server. This method is used in the unit tests</span>
|
556
|
+
<a name="l00540"></a>00540 <span class="comment"> * and should not be used directly.</span>
|
557
|
+
<a name="l00541"></a>00541 <span class="comment"> */</span>
|
558
|
+
<a name="l00542"></a><a class="code" href="classPassenger_1_1SpawnManager.html#1f77e2e7e6cb464028c13a29f983ad8e">00542</a> pid_t <a class="code" href="classPassenger_1_1SpawnManager.html#1f77e2e7e6cb464028c13a29f983ad8e" title="Get the Process ID of the spawn server.">getServerPid</a>()<span class="keyword"> const </span>{
|
559
|
+
<a name="l00543"></a>00543 <span class="keywordflow">return</span> pid;
|
560
|
+
<a name="l00544"></a>00544 }
|
561
|
+
<a name="l00545"></a>00545 };
|
562
|
+
<a name="l00546"></a>00546 <span class="comment"></span>
|
563
|
+
<a name="l00547"></a>00547 <span class="comment">/** Convenient alias for SpawnManager smart pointer. */</span>
|
564
|
+
<a name="l00548"></a>00548 <span class="keyword">typedef</span> shared_ptr<SpawnManager> SpawnManagerPtr;
|
565
|
+
<a name="l00549"></a>00549
|
566
|
+
<a name="l00550"></a>00550 } <span class="comment">// namespace Passenger</span>
|
567
|
+
<a name="l00551"></a>00551
|
568
|
+
<a name="l00552"></a>00552 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_SPAWN_MANAGER_H_ */</span>
|
563
569
|
</pre></div></div>
|
564
|
-
<hr size="1"><address style="text-align: right;"><small>Generated on
|
570
|
+
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by
|
565
571
|
<a href="http://www.doxygen.org/index.html">
|
566
572
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
|
567
573
|
</body>
|