passenger 2.0.3 → 2.0.4

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

Potentially problematic release.


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

Files changed (275) hide show
  1. data/Rakefile +8 -5
  2. data/bin/passenger-install-apache2-module +6 -1
  3. data/doc/ApplicationPool algorithm.txt +23 -5
  4. data/doc/Architectural overview.html +778 -0
  5. data/doc/Security of user switching support.html +1 -1
  6. data/doc/Users guide.html +113 -31
  7. data/doc/Users guide.txt +104 -10
  8. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +683 -0
  9. data/doc/cxxapi/ApplicationPool_8h-source.html +224 -0
  10. data/doc/cxxapi/Application_8h-source.html +448 -0
  11. data/doc/cxxapi/Bucket_8h-source.html +61 -0
  12. data/doc/cxxapi/Configuration_8h-source.html +195 -0
  13. data/doc/cxxapi/DummySpawnManager_8h-source.html +126 -0
  14. data/doc/cxxapi/Exceptions_8h-source.html +244 -0
  15. data/doc/cxxapi/Hooks_8h-source.html +63 -0
  16. data/doc/cxxapi/Logging_8h-source.html +136 -0
  17. data/doc/cxxapi/MessageChannel_8h-source.html +524 -0
  18. data/doc/cxxapi/SpawnManager_8h-source.html +593 -0
  19. data/doc/cxxapi/StandardApplicationPool_8h-source.html +732 -0
  20. data/doc/cxxapi/System_8h-source.html +251 -0
  21. data/doc/cxxapi/Utils_8h-source.html +283 -0
  22. data/doc/cxxapi/annotated.html +59 -0
  23. data/doc/cxxapi/classClient-members.html +35 -0
  24. data/doc/cxxapi/classClient.html +117 -0
  25. data/doc/cxxapi/classDirectoryMapper-members.html +38 -0
  26. data/doc/cxxapi/classDirectoryMapper.html +203 -0
  27. data/doc/cxxapi/classHooks-members.html +33 -0
  28. data/doc/cxxapi/classHooks.html +43 -0
  29. data/doc/cxxapi/classPassenger_1_1Application-members.html +38 -0
  30. data/doc/cxxapi/classPassenger_1_1Application.html +229 -0
  31. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +41 -0
  32. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +359 -0
  33. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +36 -0
  34. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +225 -0
  35. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -0
  36. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -0
  37. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  38. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +43 -0
  39. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +329 -0
  40. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +33 -0
  41. data/doc/cxxapi/classPassenger_1_1BusyException.html +47 -0
  42. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +33 -0
  43. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +44 -0
  44. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +33 -0
  45. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +51 -0
  46. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +33 -0
  47. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +51 -0
  48. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -0
  49. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -0
  50. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  51. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +38 -0
  52. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +61 -0
  53. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -0
  54. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -0
  55. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  56. data/doc/cxxapi/classPassenger_1_1IOException-members.html +33 -0
  57. data/doc/cxxapi/classPassenger_1_1IOException.html +54 -0
  58. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -0
  59. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -0
  60. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  61. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +47 -0
  62. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +591 -0
  63. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +35 -0
  64. data/doc/cxxapi/classPassenger_1_1SpawnException.html +77 -0
  65. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +37 -0
  66. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +255 -0
  67. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +43 -0
  68. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +400 -0
  69. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -0
  70. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -0
  71. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  72. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +37 -0
  73. data/doc/cxxapi/classPassenger_1_1SystemException.html +154 -0
  74. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -0
  75. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -0
  76. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  77. data/doc/cxxapi/classPassenger_1_1TempFile-members.html +36 -0
  78. data/doc/cxxapi/classPassenger_1_1TempFile.html +128 -0
  79. data/doc/cxxapi/classPassenger_1_1Thread-members.html +35 -0
  80. data/doc/cxxapi/classPassenger_1_1Thread.html +100 -0
  81. data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption-members.html +33 -0
  82. data/doc/cxxapi/classboost_1_1this__thread_1_1disable__syscall__interruption.html +46 -0
  83. data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption-members.html +33 -0
  84. data/doc/cxxapi/classboost_1_1this__thread_1_1enable__syscall__interruption.html +44 -0
  85. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption-members.html +33 -0
  86. data/doc/cxxapi/classboost_1_1this__thread_1_1restore__syscall__interruption.html +44 -0
  87. data/doc/cxxapi/definitions_8h-source.html +28 -0
  88. data/doc/cxxapi/doxygen.css +433 -0
  89. data/doc/cxxapi/doxygen.png +0 -0
  90. data/doc/cxxapi/files.html +42 -0
  91. data/doc/cxxapi/ftv2blank.png +0 -0
  92. data/doc/cxxapi/ftv2doc.png +0 -0
  93. data/doc/cxxapi/ftv2folderclosed.png +0 -0
  94. data/doc/cxxapi/ftv2folderopen.png +0 -0
  95. data/doc/cxxapi/ftv2lastnode.png +0 -0
  96. data/doc/cxxapi/ftv2link.png +0 -0
  97. data/doc/cxxapi/ftv2mlastnode.png +0 -0
  98. data/doc/cxxapi/ftv2mnode.png +0 -0
  99. data/doc/cxxapi/ftv2node.png +0 -0
  100. data/doc/cxxapi/ftv2plastnode.png +0 -0
  101. data/doc/cxxapi/ftv2pnode.png +0 -0
  102. data/doc/cxxapi/ftv2vertline.png +0 -0
  103. data/doc/cxxapi/functions.html +215 -0
  104. data/doc/cxxapi/functions_func.html +210 -0
  105. data/doc/cxxapi/functions_type.html +46 -0
  106. data/doc/cxxapi/functions_vars.html +48 -0
  107. data/doc/cxxapi/graph_legend.dot +22 -0
  108. data/doc/cxxapi/graph_legend.html +87 -0
  109. data/doc/cxxapi/graph_legend.png +0 -0
  110. data/doc/cxxapi/group__Configuration.html +236 -0
  111. data/doc/cxxapi/group__Configuration.png +0 -0
  112. data/doc/cxxapi/group__Core.html +51 -0
  113. data/doc/cxxapi/group__Core.png +0 -0
  114. data/doc/cxxapi/group__Exceptions.html +43 -0
  115. data/doc/cxxapi/group__Hooks.html +46 -0
  116. data/doc/cxxapi/group__Hooks.png +0 -0
  117. data/doc/cxxapi/group__Support.html +406 -0
  118. data/doc/cxxapi/hierarchy.html +67 -0
  119. data/doc/cxxapi/index.html +11 -0
  120. data/doc/cxxapi/inherit__graph__0.map +1 -0
  121. data/doc/cxxapi/inherit__graph__0.md5 +1 -0
  122. data/doc/cxxapi/inherit__graph__0.png +0 -0
  123. data/doc/cxxapi/inherit__graph__1.map +1 -0
  124. data/doc/cxxapi/inherit__graph__1.md5 +1 -0
  125. data/doc/cxxapi/inherit__graph__1.png +0 -0
  126. data/doc/cxxapi/inherit__graph__10.map +1 -0
  127. data/doc/cxxapi/inherit__graph__10.md5 +1 -0
  128. data/doc/cxxapi/inherit__graph__10.png +0 -0
  129. data/doc/cxxapi/inherit__graph__11.map +1 -0
  130. data/doc/cxxapi/inherit__graph__11.md5 +1 -0
  131. data/doc/cxxapi/inherit__graph__11.png +0 -0
  132. data/doc/cxxapi/inherit__graph__12.map +1 -0
  133. data/doc/cxxapi/inherit__graph__12.md5 +1 -0
  134. data/doc/cxxapi/inherit__graph__12.png +0 -0
  135. data/doc/cxxapi/inherit__graph__13.map +1 -0
  136. data/doc/cxxapi/inherit__graph__13.md5 +1 -0
  137. data/doc/cxxapi/inherit__graph__13.png +0 -0
  138. data/doc/cxxapi/inherit__graph__14.map +2 -0
  139. data/doc/cxxapi/inherit__graph__14.md5 +1 -0
  140. data/doc/cxxapi/inherit__graph__14.png +0 -0
  141. data/doc/cxxapi/inherit__graph__15.map +1 -0
  142. data/doc/cxxapi/inherit__graph__15.md5 +1 -0
  143. data/doc/cxxapi/inherit__graph__15.png +0 -0
  144. data/doc/cxxapi/inherit__graph__16.map +1 -0
  145. data/doc/cxxapi/inherit__graph__16.md5 +1 -0
  146. data/doc/cxxapi/inherit__graph__16.png +0 -0
  147. data/doc/cxxapi/inherit__graph__17.map +1 -0
  148. data/doc/cxxapi/inherit__graph__17.md5 +1 -0
  149. data/doc/cxxapi/inherit__graph__17.png +0 -0
  150. data/doc/cxxapi/inherit__graph__18.map +1 -0
  151. data/doc/cxxapi/inherit__graph__18.md5 +1 -0
  152. data/doc/cxxapi/inherit__graph__18.png +0 -0
  153. data/doc/cxxapi/inherit__graph__19.map +2 -0
  154. data/doc/cxxapi/inherit__graph__19.md5 +1 -0
  155. data/doc/cxxapi/inherit__graph__19.png +0 -0
  156. data/doc/cxxapi/inherit__graph__2.map +1 -0
  157. data/doc/cxxapi/inherit__graph__2.md5 +1 -0
  158. data/doc/cxxapi/inherit__graph__2.png +0 -0
  159. data/doc/cxxapi/inherit__graph__20.map +1 -0
  160. data/doc/cxxapi/inherit__graph__20.md5 +1 -0
  161. data/doc/cxxapi/inherit__graph__20.png +0 -0
  162. data/doc/cxxapi/inherit__graph__21.map +1 -0
  163. data/doc/cxxapi/inherit__graph__21.md5 +1 -0
  164. data/doc/cxxapi/inherit__graph__21.png +0 -0
  165. data/doc/cxxapi/inherit__graph__3.map +1 -0
  166. data/doc/cxxapi/inherit__graph__3.md5 +1 -0
  167. data/doc/cxxapi/inherit__graph__3.png +0 -0
  168. data/doc/cxxapi/inherit__graph__4.map +1 -0
  169. data/doc/cxxapi/inherit__graph__4.md5 +1 -0
  170. data/doc/cxxapi/inherit__graph__4.png +0 -0
  171. data/doc/cxxapi/inherit__graph__5.map +1 -0
  172. data/doc/cxxapi/inherit__graph__5.md5 +1 -0
  173. data/doc/cxxapi/inherit__graph__5.png +0 -0
  174. data/doc/cxxapi/inherit__graph__6.map +1 -0
  175. data/doc/cxxapi/inherit__graph__6.md5 +1 -0
  176. data/doc/cxxapi/inherit__graph__6.png +0 -0
  177. data/doc/cxxapi/inherit__graph__7.map +1 -0
  178. data/doc/cxxapi/inherit__graph__7.md5 +1 -0
  179. data/doc/cxxapi/inherit__graph__7.png +0 -0
  180. data/doc/cxxapi/inherit__graph__8.map +1 -0
  181. data/doc/cxxapi/inherit__graph__8.md5 +1 -0
  182. data/doc/cxxapi/inherit__graph__8.png +0 -0
  183. data/doc/cxxapi/inherit__graph__9.map +2 -0
  184. data/doc/cxxapi/inherit__graph__9.md5 +1 -0
  185. data/doc/cxxapi/inherit__graph__9.png +0 -0
  186. data/doc/cxxapi/inherits.html +102 -0
  187. data/doc/cxxapi/main.html +27 -0
  188. data/doc/cxxapi/modules.html +34 -0
  189. data/doc/cxxapi/namespacePassenger.html +208 -0
  190. data/doc/cxxapi/namespacePassenger_1_1InterruptableCalls.html +43 -0
  191. data/doc/cxxapi/namespacemembers.html +70 -0
  192. data/doc/cxxapi/namespacemembers_func.html +66 -0
  193. data/doc/cxxapi/namespacemembers_type.html +46 -0
  194. data/doc/cxxapi/namespaces.html +35 -0
  195. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +33 -0
  196. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +49 -0
  197. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +33 -0
  198. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +49 -0
  199. data/doc/cxxapi/tab_b.gif +0 -0
  200. data/doc/cxxapi/tab_l.gif +0 -0
  201. data/doc/cxxapi/tab_r.gif +0 -0
  202. data/doc/cxxapi/tabs.css +102 -0
  203. data/doc/cxxapi/tree.html +167 -0
  204. data/doc/rdoc/classes/ConditionVariable.html +160 -0
  205. data/doc/rdoc/classes/Exception.html +120 -0
  206. data/doc/rdoc/classes/GC.html +113 -0
  207. data/doc/rdoc/classes/IO.html +150 -0
  208. data/doc/rdoc/classes/Passenger.html +136 -0
  209. data/doc/rdoc/classes/Passenger/AbstractRequestHandler.html +402 -0
  210. data/doc/rdoc/classes/Passenger/AbstractServer.html +649 -0
  211. data/doc/rdoc/classes/Passenger/AbstractServer/ServerAlreadyStarted.html +97 -0
  212. data/doc/rdoc/classes/Passenger/AbstractServer/ServerError.html +96 -0
  213. data/doc/rdoc/classes/Passenger/AbstractServer/ServerNotStarted.html +97 -0
  214. data/doc/rdoc/classes/Passenger/AbstractServer/UnknownMessage.html +96 -0
  215. data/doc/rdoc/classes/Passenger/AppInitError.html +137 -0
  216. data/doc/rdoc/classes/Passenger/Application.html +298 -0
  217. data/doc/rdoc/classes/Passenger/ConsoleTextTemplate.html +172 -0
  218. data/doc/rdoc/classes/Passenger/FrameworkInitError.html +143 -0
  219. data/doc/rdoc/classes/Passenger/HTMLTemplate.html +175 -0
  220. data/doc/rdoc/classes/Passenger/InitializationError.html +141 -0
  221. data/doc/rdoc/classes/Passenger/MessageChannel.html +488 -0
  222. data/doc/rdoc/classes/Passenger/NativeSupport.html +320 -0
  223. data/doc/rdoc/classes/Passenger/SpawnManager.html +375 -0
  224. data/doc/rdoc/classes/Passenger/UnknownError.html +125 -0
  225. data/doc/rdoc/classes/Passenger/Utils.html +578 -0
  226. data/doc/rdoc/classes/Passenger/VersionNotFound.html +140 -0
  227. data/doc/rdoc/classes/PlatformInfo.html +302 -0
  228. data/doc/rdoc/classes/RakeExtensions.html +197 -0
  229. data/doc/rdoc/created.rid +1 -0
  230. data/doc/rdoc/files/DEVELOPERS_TXT.html +230 -0
  231. data/doc/rdoc/files/README.html +150 -0
  232. data/doc/rdoc/files/ext/passenger/native_support_c.html +92 -0
  233. data/doc/rdoc/files/lib/passenger/abstract_request_handler_rb.html +126 -0
  234. data/doc/rdoc/files/lib/passenger/abstract_server_rb.html +127 -0
  235. data/doc/rdoc/files/lib/passenger/application_rb.html +123 -0
  236. data/doc/rdoc/files/lib/passenger/console_text_template_rb.html +122 -0
  237. data/doc/rdoc/files/lib/passenger/constants_rb.html +114 -0
  238. data/doc/rdoc/files/lib/passenger/dependencies_rb.html +130 -0
  239. data/doc/rdoc/files/lib/passenger/exceptions_rb.html +118 -0
  240. data/doc/rdoc/files/lib/passenger/html_template_rb.html +122 -0
  241. data/doc/rdoc/files/lib/passenger/message_channel_rb.html +118 -0
  242. data/doc/rdoc/files/lib/passenger/platform_info_rb.html +122 -0
  243. data/doc/rdoc/files/lib/passenger/simple_benchmarking_rb.html +118 -0
  244. data/doc/rdoc/files/lib/passenger/spawn_manager_rb.html +139 -0
  245. data/doc/rdoc/files/lib/passenger/utils_rb.html +130 -0
  246. data/doc/rdoc/files/lib/rake/extensions_rb.html +122 -0
  247. data/doc/rdoc/fr_class_index.html +71 -0
  248. data/doc/rdoc/fr_file_index.html +63 -0
  249. data/doc/rdoc/fr_method_index.html +120 -0
  250. data/doc/rdoc/index.html +26 -0
  251. data/doc/rdoc/rdoc-style.css +187 -0
  252. data/ext/apache2/ApplicationPool.h +12 -0
  253. data/ext/apache2/ApplicationPoolServer.h +6 -0
  254. data/ext/apache2/ApplicationPoolServerExecutable.cpp +6 -0
  255. data/ext/apache2/Bucket.cpp +63 -69
  256. data/ext/apache2/Bucket.h +2 -0
  257. data/ext/apache2/Configuration.cpp +24 -0
  258. data/ext/apache2/Configuration.h +16 -1
  259. data/ext/apache2/Hooks.cpp +5 -3
  260. data/ext/apache2/StandardApplicationPool.h +30 -11
  261. data/lib/passenger/abstract_request_handler.rb +3 -0
  262. data/lib/passenger/abstract_server.rb +3 -3
  263. data/lib/passenger/application.rb +4 -2
  264. data/lib/passenger/dependencies.rb +10 -1
  265. data/lib/passenger/platform_info.rb +40 -1
  266. data/lib/passenger/rack/request_handler.rb +4 -2
  267. data/lib/passenger/railz/application_spawner.rb +7 -1
  268. data/lib/passenger/utils.rb +6 -8
  269. data/lib/rake/gempackagetask.rb +0 -6
  270. data/lib/rake/rdoctask.rb +84 -23
  271. data/test/ApplicationPoolTest.cpp +36 -0
  272. data/test/ruby/rails/minimal_spawner_spec.rb +8 -0
  273. data/test/ruby/utils_spec.rb +33 -0
  274. data/test/stub/rails_apps/foobar/config/environments/production.rb +0 -1
  275. metadata +262 -5
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
+ <title>Passenger: Bucket.h Source File</title>
4
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
5
+ <link href="tabs.css" rel="stylesheet" type="text/css">
6
+ </head><body>
7
+ <!-- Generated by Doxygen 1.5.5 -->
8
+ <div class="navigation" id="top">
9
+ <div class="tabs">
10
+ <ul>
11
+ <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12
+ <li><a href="modules.html"><span>Modules</span></a></li>
13
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
14
+ <li><a href="annotated.html"><span>Classes</span></a></li>
15
+ <li class="current"><a href="files.html"><span>Files</span></a></li>
16
+ </ul>
17
+ </div>
18
+ <h1>Bucket.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
19
+ <a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
20
+ <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
21
+ <a name="l00004"></a>00004 <span class="comment"> *</span>
22
+ <a name="l00005"></a>00005 <span class="comment"> * Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</span>
23
+ <a name="l00006"></a>00006 <span class="comment"> *</span>
24
+ <a name="l00007"></a>00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
25
+ <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
26
+ <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; version 2 of the License.</span>
27
+ <a name="l00010"></a>00010 <span class="comment"> *</span>
28
+ <a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
29
+ <a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
30
+ <a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
31
+ <a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
32
+ <a name="l00015"></a>00015 <span class="comment"> *</span>
33
+ <a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
34
+ <a name="l00017"></a>00017 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span>
35
+ <a name="l00018"></a>00018 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
36
+ <a name="l00019"></a>00019 <span class="comment"> */</span>
37
+ <a name="l00020"></a>00020 <span class="preprocessor">#ifndef _PASSENGER_BUCKET_H_</span>
38
+ <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define _PASSENGER_BUCKET_H_</span>
39
+ <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="comment"></span>
40
+ <a name="l00023"></a>00023 <span class="comment">/**</span>
41
+ <a name="l00024"></a>00024 <span class="comment"> * apr_bucket_pipe closes a pipe's file descriptor when it has reached end-of-stream,</span>
42
+ <a name="l00025"></a>00025 <span class="comment"> * but not when an error has occurred. That behavior conflicts with Phusion Passenger's</span>
43
+ <a name="l00026"></a>00026 <span class="comment"> * file descriptor management code.</span>
44
+ <a name="l00027"></a>00027 <span class="comment"> *</span>
45
+ <a name="l00028"></a>00028 <span class="comment"> * passenger_bucket is like apr_bucket_pipe, but never closes the pipe's file descriptor.</span>
46
+ <a name="l00029"></a>00029 <span class="comment"> * It also ignores the APR_NONBLOCK_READ because that's known to cause strange</span>
47
+ <a name="l00030"></a>00030 <span class="comment"> * I/O problems.</span>
48
+ <a name="l00031"></a>00031 <span class="comment"> */</span>
49
+ <a name="l00032"></a>00032
50
+ <a name="l00033"></a>00033 <span class="preprocessor">#include "apr_buckets.h"</span>
51
+ <a name="l00034"></a>00034
52
+ <a name="l00035"></a>00035 apr_bucket *passenger_bucket_create(apr_file_t *pipe, apr_bucket_alloc_t *list);
53
+ <a name="l00036"></a>00036
54
+ <a name="l00037"></a>00037 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_BUCKET_H_ */</span>
55
+ <a name="l00038"></a>00038
56
+ </pre></div></div>
57
+ <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 1 14:27:22 2008 for Passenger by&nbsp;
58
+ <a href="http://www.doxygen.org/index.html">
59
+ <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
60
+ </body>
61
+ </html>
@@ -0,0 +1,195 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
+ <title>Passenger: Configuration.h Source File</title>
4
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
5
+ <link href="tabs.css" rel="stylesheet" type="text/css">
6
+ </head><body>
7
+ <!-- Generated by Doxygen 1.5.5 -->
8
+ <div class="navigation" id="top">
9
+ <div class="tabs">
10
+ <ul>
11
+ <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12
+ <li><a href="modules.html"><span>Modules</span></a></li>
13
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
14
+ <li><a href="annotated.html"><span>Classes</span></a></li>
15
+ <li class="current"><a href="files.html"><span>Files</span></a></li>
16
+ </ul>
17
+ </div>
18
+ <h1>Configuration.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
19
+ <a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
20
+ <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
21
+ <a name="l00004"></a>00004 <span class="comment"> *</span>
22
+ <a name="l00005"></a>00005 <span class="comment"> * Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</span>
23
+ <a name="l00006"></a>00006 <span class="comment"> *</span>
24
+ <a name="l00007"></a>00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
25
+ <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
26
+ <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; version 2 of the License.</span>
27
+ <a name="l00010"></a>00010 <span class="comment"> *</span>
28
+ <a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
29
+ <a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
30
+ <a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
31
+ <a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
32
+ <a name="l00015"></a>00015 <span class="comment"> *</span>
33
+ <a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
34
+ <a name="l00017"></a>00017 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span>
35
+ <a name="l00018"></a>00018 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
36
+ <a name="l00019"></a>00019 <span class="comment"> */</span>
37
+ <a name="l00020"></a>00020 <span class="preprocessor">#ifndef _PASSENGER_CONFIGURATION_H_</span>
38
+ <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define _PASSENGER_CONFIGURATION_H_</span>
39
+ <a name="l00022"></a>00022 <span class="preprocessor"></span>
40
+ <a name="l00023"></a>00023 <span class="preprocessor">#include &lt;apr_pools.h&gt;</span>
41
+ <a name="l00024"></a>00024 <span class="preprocessor">#include &lt;httpd.h&gt;</span>
42
+ <a name="l00025"></a>00025 <span class="preprocessor">#include &lt;http_config.h&gt;</span>
43
+ <a name="l00026"></a>00026 <span class="comment"></span>
44
+ <a name="l00027"></a>00027 <span class="comment">/**</span>
45
+ <a name="l00028"></a>00028 <span class="comment"> * @defgroup Configuration Apache module configuration</span>
46
+ <a name="l00029"></a>00029 <span class="comment"> * @ingroup Core</span>
47
+ <a name="l00030"></a>00030 <span class="comment"> * @{</span>
48
+ <a name="l00031"></a>00031 <span class="comment"> */</span>
49
+ <a name="l00032"></a>00032 <span class="comment"></span>
50
+ <a name="l00033"></a>00033 <span class="comment">/** Module version number. */</span>
51
+ <a name="l00034"></a><a class="code" href="group__Configuration.html#ga19398896775408d6ab7fd8ce2acd992">00034</a> <span class="preprocessor">#define PASSENGER_VERSION "2.0.4"</span>
52
+ <a name="l00035"></a>00035 <span class="preprocessor"></span>
53
+ <a name="l00036"></a>00036 <span class="preprocessor">#ifdef __cplusplus</span>
54
+ <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;set&gt;</span>
55
+ <a name="l00038"></a>00038 <span class="preprocessor"> #include &lt;string&gt;</span>
56
+ <a name="l00039"></a>00039
57
+ <a name="l00040"></a>00040 <span class="keyword">namespace </span>Passenger {
58
+ <a name="l00041"></a>00041
59
+ <a name="l00042"></a>00042 <span class="keyword">using namespace </span>std;
60
+ <a name="l00043"></a>00043 <span class="comment"></span>
61
+ <a name="l00044"></a>00044 <span class="comment"> /**</span>
62
+ <a name="l00045"></a>00045 <span class="comment"> * Per-directory configuration information.</span>
63
+ <a name="l00046"></a>00046 <span class="comment"> */</span>
64
+ <a name="l00047"></a>00047 <span class="keyword">struct </span>DirConfig {
65
+ <a name="l00048"></a>00048 <span class="keyword">enum</span> Threeway { ENABLED, DISABLED, UNSET };
66
+ <a name="l00049"></a>00049
67
+ <a name="l00050"></a>00050 std::set&lt;std::string&gt; railsBaseURIs;
68
+ <a name="l00051"></a>00051 std::set&lt;std::string&gt; rackBaseURIs;
69
+ <a name="l00052"></a>00052 <span class="comment"></span>
70
+ <a name="l00053"></a>00053 <span class="comment"> /** Whether to autodetect Rails applications. */</span>
71
+ <a name="l00054"></a>00054 Threeway autoDetectRails;
72
+ <a name="l00055"></a>00055 <span class="comment"></span>
73
+ <a name="l00056"></a>00056 <span class="comment"> /** Whether to autodetect Rack applications. */</span>
74
+ <a name="l00057"></a>00057 Threeway autoDetectRack;
75
+ <a name="l00058"></a>00058 <span class="comment"></span>
76
+ <a name="l00059"></a>00059 <span class="comment"> /** Whether to autodetect WSGI applications. */</span>
77
+ <a name="l00060"></a>00060 Threeway autoDetectWSGI;
78
+ <a name="l00061"></a>00061 <span class="comment"></span>
79
+ <a name="l00062"></a>00062 <span class="comment"> /** Whether mod_rewrite should be allowed for Rails applications. */</span>
80
+ <a name="l00063"></a>00063 Threeway allowModRewrite;
81
+ <a name="l00064"></a>00064 <span class="comment"></span>
82
+ <a name="l00065"></a>00065 <span class="comment"> /** The environment (i.e. value for RAILS_ENV) under which</span>
83
+ <a name="l00066"></a>00066 <span class="comment"> * Rails applications should operate. */</span>
84
+ <a name="l00067"></a>00067 <span class="keyword">const</span> <span class="keywordtype">char</span> *railsEnv;
85
+ <a name="l00068"></a>00068 <span class="comment"></span>
86
+ <a name="l00069"></a>00069 <span class="comment"> /** The environment (i.e. value for RACK_ENV) under which</span>
87
+ <a name="l00070"></a>00070 <span class="comment"> * Rack applications should operate. */</span>
88
+ <a name="l00071"></a>00071 <span class="keyword">const</span> <span class="keywordtype">char</span> *rackEnv;
89
+ <a name="l00072"></a>00072
90
+ <a name="l00073"></a>00073 <span class="keyword">enum</span> SpawnMethod { SM_UNSET, SM_SMART, SM_CONSERVATIVE };<span class="comment"></span>
91
+ <a name="l00074"></a>00074 <span class="comment"> /** The Rails spawn method to use. */</span>
92
+ <a name="l00075"></a>00075 SpawnMethod spawnMethod;
93
+ <a name="l00076"></a>00076 };
94
+ <a name="l00077"></a>00077 <span class="comment"></span>
95
+ <a name="l00078"></a>00078 <span class="comment"> /**</span>
96
+ <a name="l00079"></a>00079 <span class="comment"> * Server-wide (global, not per-virtual host) configuration information.</span>
97
+ <a name="l00080"></a>00080 <span class="comment"> */</span>
98
+ <a name="l00081"></a>00081 <span class="keyword">struct </span>ServerConfig {<span class="comment"></span>
99
+ <a name="l00082"></a>00082 <span class="comment"> /** The filename of the Ruby interpreter to use. */</span>
100
+ <a name="l00083"></a>00083 <span class="keyword">const</span> <span class="keywordtype">char</span> *ruby;
101
+ <a name="l00084"></a>00084 <span class="comment"></span>
102
+ <a name="l00085"></a>00085 <span class="comment"> /** The Passenger root folder. */</span>
103
+ <a name="l00086"></a>00086 <span class="keyword">const</span> <span class="keywordtype">char</span> *root;
104
+ <a name="l00087"></a>00087 <span class="comment"></span>
105
+ <a name="l00088"></a>00088 <span class="comment"> /** The log verbosity. */</span>
106
+ <a name="l00089"></a>00089 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> logLevel;
107
+ <a name="l00090"></a>00090 <span class="comment"></span>
108
+ <a name="l00091"></a>00091 <span class="comment"> /** The maximum number of simultaneously alive application</span>
109
+ <a name="l00092"></a>00092 <span class="comment"> * instances. */</span>
110
+ <a name="l00093"></a>00093 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxPoolSize;
111
+ <a name="l00094"></a>00094 <span class="comment"></span>
112
+ <a name="l00095"></a>00095 <span class="comment"> /** Whether the maxPoolSize option was explicitly specified in</span>
113
+ <a name="l00096"></a>00096 <span class="comment"> * this server config. */</span>
114
+ <a name="l00097"></a>00097 <span class="keywordtype">bool</span> maxPoolSizeSpecified;
115
+ <a name="l00098"></a>00098 <span class="comment"></span>
116
+ <a name="l00099"></a>00099 <span class="comment"> /** The maximum number of simultaneously alive Rails application</span>
117
+ <a name="l00100"></a>00100 <span class="comment"> * that a single Rails application may occupy. */</span>
118
+ <a name="l00101"></a>00101 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxInstancesPerApp;
119
+ <a name="l00102"></a>00102 <span class="comment"></span>
120
+ <a name="l00103"></a>00103 <span class="comment"> /** Whether the maxInstancesPerApp option was explicitly specified in</span>
121
+ <a name="l00104"></a>00104 <span class="comment"> * this server config. */</span>
122
+ <a name="l00105"></a>00105 <span class="keywordtype">bool</span> maxInstancesPerAppSpecified;
123
+ <a name="l00106"></a>00106 <span class="comment"></span>
124
+ <a name="l00107"></a>00107 <span class="comment"> /** The maximum number of seconds that an application may be</span>
125
+ <a name="l00108"></a>00108 <span class="comment"> * idle before it gets terminated. */</span>
126
+ <a name="l00109"></a>00109 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> poolIdleTime;
127
+ <a name="l00110"></a>00110 <span class="comment"></span>
128
+ <a name="l00111"></a>00111 <span class="comment"> /** Whether the poolIdleTime option was explicitly specified in</span>
129
+ <a name="l00112"></a>00112 <span class="comment"> * this server config. */</span>
130
+ <a name="l00113"></a>00113 <span class="keywordtype">bool</span> poolIdleTimeSpecified;
131
+ <a name="l00114"></a>00114 <span class="comment"></span>
132
+ <a name="l00115"></a>00115 <span class="comment"> /** Whether global queuing should be used. */</span>
133
+ <a name="l00116"></a>00116 <span class="keywordtype">bool</span> useGlobalQueue;
134
+ <a name="l00117"></a>00117 <span class="comment"></span>
135
+ <a name="l00118"></a>00118 <span class="comment"> /** Whether the useGlobalQueue option was explicitly specified</span>
136
+ <a name="l00119"></a>00119 <span class="comment"> * in this server config. */</span>
137
+ <a name="l00120"></a>00120 <span class="keywordtype">bool</span> useGlobalQueueSpecified;
138
+ <a name="l00121"></a>00121 <span class="comment"></span>
139
+ <a name="l00122"></a>00122 <span class="comment"> /** Whether user switching support is enabled. */</span>
140
+ <a name="l00123"></a>00123 <span class="keywordtype">bool</span> userSwitching;
141
+ <a name="l00124"></a>00124 <span class="comment"></span>
142
+ <a name="l00125"></a>00125 <span class="comment"> /** Whether the userSwitching option was explicitly specified in</span>
143
+ <a name="l00126"></a>00126 <span class="comment"> * this server config. */</span>
144
+ <a name="l00127"></a>00127 <span class="keywordtype">bool</span> userSwitchingSpecified;
145
+ <a name="l00128"></a>00128 <span class="comment"></span>
146
+ <a name="l00129"></a>00129 <span class="comment"> /** The user that applications must run as if user switching</span>
147
+ <a name="l00130"></a>00130 <span class="comment"> * fails or is disabled. NULL means the option is not specified.</span>
148
+ <a name="l00131"></a>00131 <span class="comment"> */</span>
149
+ <a name="l00132"></a>00132 <span class="keyword">const</span> <span class="keywordtype">char</span> *defaultUser;
150
+ <a name="l00133"></a>00133
151
+ <a name="l00134"></a>00134 <span class="keywordtype">bool</span> getUseGlobalQueue()<span class="keyword"> const </span>{
152
+ <a name="l00135"></a>00135 <span class="keywordflow">if</span> (useGlobalQueueSpecified) {
153
+ <a name="l00136"></a>00136 <span class="keywordflow">return</span> useGlobalQueue;
154
+ <a name="l00137"></a>00137 } <span class="keywordflow">else</span> {
155
+ <a name="l00138"></a>00138 <span class="keywordflow">return</span> <span class="keyword">false</span>;
156
+ <a name="l00139"></a>00139 }
157
+ <a name="l00140"></a>00140 }
158
+ <a name="l00141"></a>00141 };
159
+ <a name="l00142"></a>00142 }
160
+ <a name="l00143"></a>00143
161
+ <a name="l00144"></a>00144 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
162
+ <a name="l00145"></a>00145 <span class="preprocessor">#endif</span>
163
+ <a name="l00146"></a>00146 <span class="preprocessor"></span><span class="comment"></span>
164
+ <a name="l00147"></a>00147 <span class="comment">/** Configuration hook for per-directory configuration structure creation. */</span>
165
+ <a name="l00148"></a>00148 <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);
166
+ <a name="l00149"></a>00149 <span class="comment"></span>
167
+ <a name="l00150"></a>00150 <span class="comment">/** Configuration hook for per-directory configuration structure merging. */</span>
168
+ <a name="l00151"></a>00151 <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);
169
+ <a name="l00152"></a>00152 <span class="comment"></span>
170
+ <a name="l00153"></a>00153 <span class="comment">/** Configuration hook for per-server configuration structure creation. */</span>
171
+ <a name="l00154"></a>00154 <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);
172
+ <a name="l00155"></a>00155 <span class="comment"></span>
173
+ <a name="l00156"></a>00156 <span class="comment">/** Configuration hook for per-server configuration structure merging. */</span>
174
+ <a name="l00157"></a>00157 <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);
175
+ <a name="l00158"></a>00158
176
+ <a name="l00159"></a>00159 <span class="keywordtype">void</span> passenger_config_merge_all_servers(apr_pool_t *pool, server_rec *main_server);
177
+ <a name="l00160"></a>00160 <span class="comment"></span>
178
+ <a name="l00161"></a>00161 <span class="comment">/** Apache module commands array. */</span>
179
+ <a name="l00162"></a>00162 <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>[];
180
+ <a name="l00163"></a>00163
181
+ <a name="l00164"></a>00164 <span class="preprocessor">#ifdef __cplusplus</span>
182
+ <a name="l00165"></a>00165 <span class="preprocessor"></span> }
183
+ <a name="l00166"></a>00166 <span class="preprocessor">#endif</span>
184
+ <a name="l00167"></a>00167 <span class="preprocessor"></span><span class="comment"></span>
185
+ <a name="l00168"></a>00168 <span class="comment">/**</span>
186
+ <a name="l00169"></a>00169 <span class="comment"> * @}</span>
187
+ <a name="l00170"></a>00170 <span class="comment"> */</span>
188
+ <a name="l00171"></a>00171
189
+ <a name="l00172"></a>00172 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_CONFIGURATION_H_ */</span>
190
+ </pre></div></div>
191
+ <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 1 14:27:22 2008 for Passenger by&nbsp;
192
+ <a href="http://www.doxygen.org/index.html">
193
+ <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
194
+ </body>
195
+ </html>
@@ -0,0 +1,126 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
+ <title>Passenger: DummySpawnManager.h Source File</title>
4
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
5
+ <link href="tabs.css" rel="stylesheet" type="text/css">
6
+ </head><body>
7
+ <!-- Generated by Doxygen 1.5.5 -->
8
+ <div class="navigation" id="top">
9
+ <div class="tabs">
10
+ <ul>
11
+ <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12
+ <li><a href="modules.html"><span>Modules</span></a></li>
13
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
14
+ <li><a href="annotated.html"><span>Classes</span></a></li>
15
+ <li class="current"><a href="files.html"><span>Files</span></a></li>
16
+ </ul>
17
+ </div>
18
+ <h1>DummySpawnManager.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
19
+ <a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
20
+ <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
21
+ <a name="l00004"></a>00004 <span class="comment"> *</span>
22
+ <a name="l00005"></a>00005 <span class="comment"> * Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</span>
23
+ <a name="l00006"></a>00006 <span class="comment"> *</span>
24
+ <a name="l00007"></a>00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
25
+ <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
26
+ <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; version 2 of the License.</span>
27
+ <a name="l00010"></a>00010 <span class="comment"> *</span>
28
+ <a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
29
+ <a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
30
+ <a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
31
+ <a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
32
+ <a name="l00015"></a>00015 <span class="comment"> *</span>
33
+ <a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
34
+ <a name="l00017"></a>00017 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span>
35
+ <a name="l00018"></a>00018 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
36
+ <a name="l00019"></a>00019 <span class="comment"> */</span>
37
+ <a name="l00020"></a>00020 <span class="preprocessor">#ifndef _PASSENGER_DUMMY_SPAWN_MANAGER_H_</span>
38
+ <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define _PASSENGER_DUMMY_SPAWN_MANAGER_H_</span>
39
+ <a name="l00022"></a>00022 <span class="preprocessor"></span>
40
+ <a name="l00023"></a>00023 <span class="comment">// TODO: make this path not hardcoded</span>
41
+ <a name="l00024"></a>00024 <span class="preprocessor">#define DUMMY_REQUEST_HANDLER_EXECUTABLE "/home/hongli/Projects/passenger/benchmark/DummyRequestHandler"</span>
42
+ <a name="l00025"></a>00025 <span class="preprocessor"></span>
43
+ <a name="l00026"></a>00026 <span class="preprocessor">#include &lt;string&gt;</span>
44
+ <a name="l00027"></a>00027
45
+ <a name="l00028"></a>00028 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
46
+ <a name="l00029"></a>00029 <span class="preprocessor">#include &lt;sys/wait.h&gt;</span>
47
+ <a name="l00030"></a>00030 <span class="preprocessor">#include &lt;cstdio&gt;</span>
48
+ <a name="l00031"></a>00031 <span class="preprocessor">#include &lt;unistd.h&gt;</span>
49
+ <a name="l00032"></a>00032 <span class="preprocessor">#include &lt;errno.h&gt;</span>
50
+ <a name="l00033"></a>00033
51
+ <a name="l00034"></a>00034 <span class="preprocessor">#include "Application.h"</span>
52
+ <a name="l00035"></a>00035 <span class="preprocessor">#include "Exceptions.h"</span>
53
+ <a name="l00036"></a>00036
54
+ <a name="l00037"></a>00037 <span class="keyword">namespace </span>Passenger {
55
+ <a name="l00038"></a>00038
56
+ <a name="l00039"></a>00039 <span class="keyword">using namespace </span>std;
57
+ <a name="l00040"></a>00040 <span class="comment"></span>
58
+ <a name="l00041"></a>00041 <span class="comment">/**</span>
59
+ <a name="l00042"></a>00042 <span class="comment"> * A dummy SpawnManager replacement for testing/debugging purposes.</span>
60
+ <a name="l00043"></a>00043 <span class="comment"> *</span>
61
+ <a name="l00044"></a>00044 <span class="comment"> * This class implements a dummy spawn manager, and is 100% interface-compatible with</span>
62
+ <a name="l00045"></a>00045 <span class="comment"> * SpawnManager. This spawn manager will spawn &lt;tt&gt;benchmark/DummyRequestHandler&lt;/tt&gt;,</span>
63
+ <a name="l00046"></a>00046 <span class="comment"> * which is probably the fastest possible implementation of a request handler. The purpose</span>
64
+ <a name="l00047"></a>00047 <span class="comment"> * of this class to benchmark the performance of the Apache module (i.e. not benchmarking</span>
65
+ <a name="l00048"></a>00048 <span class="comment"> * the Ruby request handler or Rails itself).</span>
66
+ <a name="l00049"></a>00049 <span class="comment"> *</span>
67
+ <a name="l00050"></a>00050 <span class="comment"> * This header file is not used by default. Define the macro &lt;tt&gt;PASSENGER_USE_DUMMY_SPAWN_MANAGER&lt;/tt&gt;</span>
68
+ <a name="l00051"></a>00051 <span class="comment"> * to make ApplicationPool use DummySpawnManager instead of SpawnManager.</span>
69
+ <a name="l00052"></a>00052 <span class="comment"> *</span>
70
+ <a name="l00053"></a>00053 <span class="comment"> * Of course, don't forget to compile benchmark/DummyRequestHandler!</span>
71
+ <a name="l00054"></a>00054 <span class="comment"> *</span>
72
+ <a name="l00055"></a>00055 <span class="comment"> * @ingroup Support</span>
73
+ <a name="l00056"></a>00056 <span class="comment"> */</span>
74
+ <a name="l00057"></a><a class="code" href="classPassenger_1_1DummySpawnManager.html">00057</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1DummySpawnManager.html" title="A dummy SpawnManager replacement for testing/debugging purposes.">DummySpawnManager</a> {
75
+ <a name="l00058"></a>00058 <span class="keyword">public</span>:
76
+ <a name="l00059"></a>00059 <a class="code" href="namespacePassenger.html#6a15fd5e8765802a0b8b077e15297e18" title="Convenient alias for Application smart pointer.">ApplicationPtr</a> spawn(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;appRoot, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;user = <span class="stringliteral">""</span>, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;group = <span class="stringliteral">""</span>) {
77
+ <a name="l00060"></a>00060 <span class="keywordtype">int</span> fds[2];
78
+ <a name="l00061"></a>00061 pid_t pid;
79
+ <a name="l00062"></a>00062
80
+ <a name="l00063"></a>00063 <span class="keywordflow">if</span>(socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == -1) {
81
+ <a name="l00064"></a>00064 <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">"Cannot create a Unix socket"</span>, errno);
82
+ <a name="l00065"></a>00065 }
83
+ <a name="l00066"></a>00066 pid = fork();
84
+ <a name="l00067"></a>00067 <span class="keywordflow">if</span> (pid == 0) {
85
+ <a name="l00068"></a>00068 pid = fork();
86
+ <a name="l00069"></a>00069 <span class="keywordflow">if</span> (pid == 0) {
87
+ <a name="l00070"></a>00070 dup2(fds[0], STDIN_FILENO);
88
+ <a name="l00071"></a>00071 close(fds[0]);
89
+ <a name="l00072"></a>00072 close(fds[1]);
90
+ <a name="l00073"></a>00073 execlp(DUMMY_REQUEST_HANDLER_EXECUTABLE, DUMMY_REQUEST_HANDLER_EXECUTABLE, NULL);
91
+ <a name="l00074"></a>00074 <span class="keywordtype">int</span> e = errno;
92
+ <a name="l00075"></a>00075 fprintf(stderr, <span class="stringliteral">"Unable to run %s: %s\n"</span>, DUMMY_REQUEST_HANDLER_EXECUTABLE, strerror(e));
93
+ <a name="l00076"></a>00076 fflush(stderr);
94
+ <a name="l00077"></a>00077 _exit(1);
95
+ <a name="l00078"></a>00078 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == -1) {
96
+ <a name="l00079"></a>00079 perror(<span class="stringliteral">"Cannot fork a new process"</span>);
97
+ <a name="l00080"></a>00080 fflush(stderr);
98
+ <a name="l00081"></a>00081 _exit(1);
99
+ <a name="l00082"></a>00082 } <span class="keywordflow">else</span> {
100
+ <a name="l00083"></a>00083 _exit(0);
101
+ <a name="l00084"></a>00084 }
102
+ <a name="l00085"></a>00085 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pid == -1) {
103
+ <a name="l00086"></a>00086 close(fds[0]);
104
+ <a name="l00087"></a>00087 close(fds[1]);
105
+ <a name="l00088"></a>00088 <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">"Cannot fork a new process"</span>, errno);
106
+ <a name="l00089"></a>00089 } <span class="keywordflow">else</span> {
107
+ <a name="l00090"></a>00090 close(fds[0]);
108
+ <a name="l00091"></a>00091 waitpid(pid, NULL, 0);
109
+ <a name="l00092"></a>00092 <span class="keywordflow">return</span> <a class="code" href="namespacePassenger.html#6a15fd5e8765802a0b8b077e15297e18" title="Convenient alias for Application smart pointer.">ApplicationPtr</a>(<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>(appRoot, pid, fds[1]));
110
+ <a name="l00093"></a>00093 }
111
+ <a name="l00094"></a>00094 }
112
+ <a name="l00095"></a>00095
113
+ <a name="l00096"></a>00096 pid_t getServerPid()<span class="keyword"> const </span>{
114
+ <a name="l00097"></a>00097 <span class="keywordflow">return</span> 0;
115
+ <a name="l00098"></a>00098 }
116
+ <a name="l00099"></a>00099 };
117
+ <a name="l00100"></a>00100
118
+ <a name="l00101"></a>00101 } <span class="comment">// namespace Passenger</span>
119
+ <a name="l00102"></a>00102
120
+ <a name="l00103"></a>00103 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_DUMMY_SPAWN_MANAGER_H_ */</span>
121
+ </pre></div></div>
122
+ <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 1 14:27:22 2008 for Passenger by&nbsp;
123
+ <a href="http://www.doxygen.org/index.html">
124
+ <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
125
+ </body>
126
+ </html>
@@ -0,0 +1,244 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
+ <title>Passenger: Exceptions.h Source File</title>
4
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
5
+ <link href="tabs.css" rel="stylesheet" type="text/css">
6
+ </head><body>
7
+ <!-- Generated by Doxygen 1.5.5 -->
8
+ <div class="navigation" id="top">
9
+ <div class="tabs">
10
+ <ul>
11
+ <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12
+ <li><a href="modules.html"><span>Modules</span></a></li>
13
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
14
+ <li><a href="annotated.html"><span>Classes</span></a></li>
15
+ <li class="current"><a href="files.html"><span>Files</span></a></li>
16
+ </ul>
17
+ </div>
18
+ <h1>Exceptions.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
19
+ <a name="l00002"></a>00002 <span class="comment"> * Phusion Passenger - http://www.modrails.com/</span>
20
+ <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008 Phusion</span>
21
+ <a name="l00004"></a>00004 <span class="comment"> *</span>
22
+ <a name="l00005"></a>00005 <span class="comment"> * Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</span>
23
+ <a name="l00006"></a>00006 <span class="comment"> *</span>
24
+ <a name="l00007"></a>00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
25
+ <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
26
+ <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; version 2 of the License.</span>
27
+ <a name="l00010"></a>00010 <span class="comment"> *</span>
28
+ <a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
29
+ <a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
30
+ <a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
31
+ <a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span>
32
+ <a name="l00015"></a>00015 <span class="comment"> *</span>
33
+ <a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
34
+ <a name="l00017"></a>00017 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span>
35
+ <a name="l00018"></a>00018 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
36
+ <a name="l00019"></a>00019 <span class="comment"> */</span>
37
+ <a name="l00020"></a>00020 <span class="preprocessor">#ifndef _PASSENGER_EXCEPTIONS_H_</span>
38
+ <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define _PASSENGER_EXCEPTIONS_H_</span>
39
+ <a name="l00022"></a>00022 <span class="preprocessor"></span>
40
+ <a name="l00023"></a>00023 <span class="preprocessor">#include &lt;exception&gt;</span>
41
+ <a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string&gt;</span>
42
+ <a name="l00025"></a>00025 <span class="preprocessor">#include &lt;sstream&gt;</span>
43
+ <a name="l00026"></a>00026 <span class="comment"></span>
44
+ <a name="l00027"></a>00027 <span class="comment">/**</span>
45
+ <a name="l00028"></a>00028 <span class="comment"> * @defgroup Exceptions Exceptions</span>
46
+ <a name="l00029"></a>00029 <span class="comment"> */</span>
47
+ <a name="l00030"></a>00030
48
+ <a name="l00031"></a>00031 <span class="keyword">namespace </span>Passenger {
49
+ <a name="l00032"></a>00032
50
+ <a name="l00033"></a>00033 <span class="keyword">using namespace </span>std;
51
+ <a name="l00034"></a>00034 <span class="comment"></span>
52
+ <a name="l00035"></a>00035 <span class="comment">/**</span>
53
+ <a name="l00036"></a>00036 <span class="comment"> * Represents an error returned by a system call or a standard library call.</span>
54
+ <a name="l00037"></a>00037 <span class="comment"> *</span>
55
+ <a name="l00038"></a>00038 <span class="comment"> * Use the code() method to find out the value of &lt;tt&gt;errno&lt;/tt&gt; at the time</span>
56
+ <a name="l00039"></a>00039 <span class="comment"> * the error occured.</span>
57
+ <a name="l00040"></a>00040 <span class="comment"> *</span>
58
+ <a name="l00041"></a>00041 <span class="comment"> * @ingroup Exceptions</span>
59
+ <a name="l00042"></a>00042 <span class="comment"> */</span>
60
+ <a name="l00043"></a><a class="code" href="classPassenger_1_1SystemException.html">00043</a> <span class="keyword">class </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="keyword">public</span> exception {
61
+ <a name="l00044"></a>00044 <span class="keyword">private</span>:
62
+ <a name="l00045"></a>00045 <span class="keywordtype">string</span> briefMessage;
63
+ <a name="l00046"></a>00046 <span class="keywordtype">string</span> systemMessage;
64
+ <a name="l00047"></a>00047 <span class="keywordtype">string</span> fullMessage;
65
+ <a name="l00048"></a>00048 <span class="keywordtype">int</span> m_code;
66
+ <a name="l00049"></a>00049 <span class="keyword">public</span>:<span class="comment"></span>
67
+ <a name="l00050"></a>00050 <span class="comment"> /**</span>
68
+ <a name="l00051"></a>00051 <span class="comment"> * Create a new SystemException.</span>
69
+ <a name="l00052"></a>00052 <span class="comment"> *</span>
70
+ <a name="l00053"></a>00053 <span class="comment"> * @param message A message describing the error.</span>
71
+ <a name="l00054"></a>00054 <span class="comment"> * @param errorCode The error code, i.e. the value of errno right after the error occured.</span>
72
+ <a name="l00055"></a>00055 <span class="comment"> * @note A system description of the error will be appended to the given message.</span>
73
+ <a name="l00056"></a>00056 <span class="comment"> * For example, if &lt;tt&gt;errorCode&lt;/tt&gt; is &lt;tt&gt;EBADF&lt;/tt&gt;, and &lt;tt&gt;message&lt;/tt&gt;</span>
74
+ <a name="l00057"></a>00057 <span class="comment"> * is &lt;em&gt;"Something happened"&lt;/em&gt;, then what() will return &lt;em&gt;"Something happened: Bad</span>
75
+ <a name="l00058"></a>00058 <span class="comment"> * file descriptor (10)"&lt;/em&gt; (if 10 is the number for EBADF).</span>
76
+ <a name="l00059"></a>00059 <span class="comment"> * @post code() == errorCode</span>
77
+ <a name="l00060"></a>00060 <span class="comment"> * @post brief() == message</span>
78
+ <a name="l00061"></a>00061 <span class="comment"> */</span>
79
+ <a name="l00062"></a><a class="code" href="classPassenger_1_1SystemException.html#4ee42f81106408c91726a62287e8471c">00062</a> <a class="code" href="classPassenger_1_1SystemException.html#4ee42f81106408c91726a62287e8471c" title="Create a new SystemException.">SystemException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message, <span class="keywordtype">int</span> errorCode) {
80
+ <a name="l00063"></a>00063 stringstream str;
81
+ <a name="l00064"></a>00064
82
+ <a name="l00065"></a>00065 briefMessage = message;
83
+ <a name="l00066"></a>00066 str &lt;&lt; strerror(errorCode) &lt;&lt; <span class="stringliteral">" ("</span> &lt;&lt; errorCode &lt;&lt; <span class="stringliteral">")"</span>;
84
+ <a name="l00067"></a>00067 systemMessage = str.str();
85
+ <a name="l00068"></a>00068
86
+ <a name="l00069"></a>00069 fullMessage = briefMessage + <span class="stringliteral">": "</span> + systemMessage;
87
+ <a name="l00070"></a>00070 m_code = errorCode;
88
+ <a name="l00071"></a>00071 }
89
+ <a name="l00072"></a>00072
90
+ <a name="l00073"></a>00073 <span class="keyword">virtual</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>() throw() {}
91
+ <a name="l00074"></a>00074
92
+ <a name="l00075"></a>00075 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> throw() {
93
+ <a name="l00076"></a>00076 <span class="keywordflow">return</span> fullMessage.c_str();
94
+ <a name="l00077"></a>00077 }
95
+ <a name="l00078"></a>00078 <span class="comment"></span>
96
+ <a name="l00079"></a>00079 <span class="comment"> /**</span>
97
+ <a name="l00080"></a>00080 <span class="comment"> * The value of &lt;tt&gt;errno&lt;/tt&gt; at the time the error occured.</span>
98
+ <a name="l00081"></a>00081 <span class="comment"> */</span>
99
+ <a name="l00082"></a><a class="code" href="classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c">00082</a> <span class="keywordtype">int</span> <a class="code" href="classPassenger_1_1SystemException.html#ee7a6672bf79b72a4c3ee70c57d6a47c" title="The value of errno at the time the error occured.">code</a>() <span class="keyword">const</span> throw() {
100
+ <a name="l00083"></a>00083 <span class="keywordflow">return</span> m_code;
101
+ <a name="l00084"></a>00084 }
102
+ <a name="l00085"></a>00085 <span class="comment"></span>
103
+ <a name="l00086"></a>00086 <span class="comment"> /**</span>
104
+ <a name="l00087"></a>00087 <span class="comment"> * Returns a brief version of the exception message. This message does</span>
105
+ <a name="l00088"></a>00088 <span class="comment"> * not include the system error description, and is equivalent to the</span>
106
+ <a name="l00089"></a>00089 <span class="comment"> * value of the &lt;tt&gt;message&lt;/tt&gt; parameter as passed to the constructor.</span>
107
+ <a name="l00090"></a>00090 <span class="comment"> */</span>
108
+ <a name="l00091"></a><a class="code" href="classPassenger_1_1SystemException.html#84fa2ab4f5b7b96704734fcdfdaa0269">00091</a> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1SystemException.html#84fa2ab4f5b7b96704734fcdfdaa0269" title="Returns a brief version of the exception message.">brief</a>() <span class="keyword">const</span> throw() {
109
+ <a name="l00092"></a>00092 <span class="keywordflow">return</span> briefMessage;
110
+ <a name="l00093"></a>00093 }
111
+ <a name="l00094"></a>00094 <span class="comment"></span>
112
+ <a name="l00095"></a>00095 <span class="comment"> /**</span>
113
+ <a name="l00096"></a>00096 <span class="comment"> * Returns the system's error message. This message contains both the</span>
114
+ <a name="l00097"></a>00097 <span class="comment"> * content of &lt;tt&gt;strerror(errno)&lt;/tt&gt; and the errno number itself.</span>
115
+ <a name="l00098"></a>00098 <span class="comment"> */</span>
116
+ <a name="l00099"></a><a class="code" href="classPassenger_1_1SystemException.html#0ef41d755fea2c9b1db2252e7c418dc8">00099</a> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1SystemException.html#0ef41d755fea2c9b1db2252e7c418dc8" title="Returns the system&amp;#39;s error message.">sys</a>() <span class="keyword">const</span> throw() {
117
+ <a name="l00100"></a>00100 <span class="keywordflow">return</span> systemMessage;
118
+ <a name="l00101"></a>00101 }
119
+ <a name="l00102"></a>00102 };
120
+ <a name="l00103"></a>00103 <span class="comment"></span>
121
+ <a name="l00104"></a>00104 <span class="comment">/**</span>
122
+ <a name="l00105"></a>00105 <span class="comment"> * A filesystem error, as returned by the operating system. This may include,</span>
123
+ <a name="l00106"></a>00106 <span class="comment"> * for example, permission errors.</span>
124
+ <a name="l00107"></a>00107 <span class="comment"> *</span>
125
+ <a name="l00108"></a>00108 <span class="comment"> * @ingroup Exceptions</span>
126
+ <a name="l00109"></a>00109 <span class="comment"> */</span>
127
+ <a name="l00110"></a><a class="code" href="classPassenger_1_1FileSystemException.html">00110</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1FileSystemException.html" title="A filesystem error, as returned by the operating system.">FileSystemException</a>: <span class="keyword">public</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> {
128
+ <a name="l00111"></a>00111 <span class="keyword">private</span>:
129
+ <a name="l00112"></a>00112 <span class="keywordtype">string</span> m_filename;
130
+ <a name="l00113"></a>00113 <span class="keyword">public</span>:
131
+ <a name="l00114"></a>00114 <a class="code" href="classPassenger_1_1FileSystemException.html" title="A filesystem error, as returned by the operating system.">FileSystemException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message, <span class="keywordtype">int</span> errorCode,
132
+ <a name="l00115"></a>00115 <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;<a class="code" href="classPassenger_1_1FileSystemException.html#7eef8fefd84a07efa9fe3a76129a4386" title="The filename that&amp;#39;s associated to the error.">filename</a>)
133
+ <a name="l00116"></a>00116 : <a class="code" href="classPassenger_1_1SystemException.html#4ee42f81106408c91726a62287e8471c" title="Create a new SystemException.">SystemException</a>(message, errorCode),
134
+ <a name="l00117"></a>00117 m_filename(filename) {}
135
+ <a name="l00118"></a>00118
136
+ <a name="l00119"></a>00119 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1FileSystemException.html" title="A filesystem error, as returned by the operating system.">FileSystemException</a>() <span class="keywordflow">throw</span>() {}
137
+ <a name="l00120"></a>00120 <span class="comment"></span>
138
+ <a name="l00121"></a>00121 <span class="comment"> /**</span>
139
+ <a name="l00122"></a>00122 <span class="comment"> * The filename that's associated to the error.</span>
140
+ <a name="l00123"></a>00123 <span class="comment"> */</span>
141
+ <a name="l00124"></a><a class="code" href="classPassenger_1_1FileSystemException.html#7eef8fefd84a07efa9fe3a76129a4386">00124</a> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1FileSystemException.html#7eef8fefd84a07efa9fe3a76129a4386" title="The filename that&amp;#39;s associated to the error.">filename</a>() <span class="keyword">const</span> throw() {
142
+ <a name="l00125"></a>00125 <span class="keywordflow">return</span> m_filename;
143
+ <a name="l00126"></a>00126 }
144
+ <a name="l00127"></a>00127 };
145
+ <a name="l00128"></a>00128 <span class="comment"></span>
146
+ <a name="l00129"></a>00129 <span class="comment">/**</span>
147
+ <a name="l00130"></a>00130 <span class="comment"> * Represents an error that occured during an I/O operation.</span>
148
+ <a name="l00131"></a>00131 <span class="comment"> *</span>
149
+ <a name="l00132"></a>00132 <span class="comment"> * @ingroup Exceptions</span>
150
+ <a name="l00133"></a>00133 <span class="comment"> */</span>
151
+ <a name="l00134"></a><a class="code" href="classPassenger_1_1IOException.html">00134</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>: <span class="keyword">public</span> exception {
152
+ <a name="l00135"></a>00135 <span class="keyword">private</span>:
153
+ <a name="l00136"></a>00136 <span class="keywordtype">string</span> msg;
154
+ <a name="l00137"></a>00137 <span class="keyword">public</span>:
155
+ <a name="l00138"></a>00138 <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message): msg(message) {}
156
+ <a name="l00139"></a>00139 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>() <span class="keywordflow">throw</span>() {}
157
+ <a name="l00140"></a>00140 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> <span class="keywordflow">throw</span>() { <span class="keywordflow">return</span> msg.c_str(); }
158
+ <a name="l00141"></a>00141 };
159
+ <a name="l00142"></a>00142 <span class="comment"></span>
160
+ <a name="l00143"></a>00143 <span class="comment">/**</span>
161
+ <a name="l00144"></a>00144 <span class="comment"> * Thrown when a certain file cannot be found.</span>
162
+ <a name="l00145"></a>00145 <span class="comment"> */</span>
163
+ <a name="l00146"></a><a class="code" href="classPassenger_1_1FileNotFoundException.html">00146</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1FileNotFoundException.html" title="Thrown when a certain file cannot be found.">FileNotFoundException</a>: <span class="keyword">public</span> <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a> {
164
+ <a name="l00147"></a>00147 <span class="keyword">public</span>:
165
+ <a name="l00148"></a>00148 <a class="code" href="classPassenger_1_1FileNotFoundException.html" title="Thrown when a certain file cannot be found.">FileNotFoundException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message): <a class="code" href="classPassenger_1_1IOException.html" title="Represents an error that occured during an I/O operation.">IOException</a>(message) {}
166
+ <a name="l00149"></a>00149 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1FileNotFoundException.html" title="Thrown when a certain file cannot be found.">FileNotFoundException</a>() <span class="keywordflow">throw</span>() {}
167
+ <a name="l00150"></a>00150 };
168
+ <a name="l00151"></a>00151 <span class="comment"></span>
169
+ <a name="l00152"></a>00152 <span class="comment">/**</span>
170
+ <a name="l00153"></a>00153 <span class="comment"> * Thrown when an invalid configuration is given.</span>
171
+ <a name="l00154"></a>00154 <span class="comment"> */</span>
172
+ <a name="l00155"></a><a class="code" href="classPassenger_1_1ConfigurationException.html">00155</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1ConfigurationException.html" title="Thrown when an invalid configuration is given.">ConfigurationException</a>: <span class="keyword">public</span> exception {
173
+ <a name="l00156"></a>00156 <span class="keyword">private</span>:
174
+ <a name="l00157"></a>00157 <span class="keywordtype">string</span> msg;
175
+ <a name="l00158"></a>00158 <span class="keyword">public</span>:
176
+ <a name="l00159"></a>00159 <a class="code" href="classPassenger_1_1ConfigurationException.html" title="Thrown when an invalid configuration is given.">ConfigurationException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message): msg(message) {}
177
+ <a name="l00160"></a>00160 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1ConfigurationException.html" title="Thrown when an invalid configuration is given.">ConfigurationException</a>() <span class="keywordflow">throw</span>() {}
178
+ <a name="l00161"></a>00161 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> <span class="keywordflow">throw</span>() { <span class="keywordflow">return</span> msg.c_str(); }
179
+ <a name="l00162"></a>00162 };
180
+ <a name="l00163"></a>00163 <span class="comment"></span>
181
+ <a name="l00164"></a>00164 <span class="comment">/**</span>
182
+ <a name="l00165"></a>00165 <span class="comment"> * Thrown when SpawnManager or ApplicationPool fails to spawn an application</span>
183
+ <a name="l00166"></a>00166 <span class="comment"> * instance. The exception may contain an error page, which is a user-friendly</span>
184
+ <a name="l00167"></a>00167 <span class="comment"> * HTML page with details about the error.</span>
185
+ <a name="l00168"></a>00168 <span class="comment"> */</span>
186
+ <a name="l00169"></a><a class="code" href="classPassenger_1_1SpawnException.html">00169</a> <span class="keyword">class </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="keyword">public</span> exception {
187
+ <a name="l00170"></a>00170 <span class="keyword">private</span>:
188
+ <a name="l00171"></a>00171 <span class="keywordtype">string</span> msg;
189
+ <a name="l00172"></a>00172 <span class="keywordtype">bool</span> m_hasErrorPage;
190
+ <a name="l00173"></a>00173 <span class="keywordtype">string</span> m_errorPage;
191
+ <a name="l00174"></a>00174 <span class="keyword">public</span>:
192
+ <a name="l00175"></a>00175 <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message)
193
+ <a name="l00176"></a>00176 : msg(message) {
194
+ <a name="l00177"></a>00177 m_hasErrorPage = <span class="keyword">false</span>;
195
+ <a name="l00178"></a>00178 }
196
+ <a name="l00179"></a>00179
197
+ <a name="l00180"></a>00180 <a class="code" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;errorPage)
198
+ <a name="l00181"></a>00181 : msg(message), m_errorPage(errorPage) {
199
+ <a name="l00182"></a>00182 m_hasErrorPage = <span class="keyword">true</span>;
200
+ <a name="l00183"></a>00183 }
201
+ <a name="l00184"></a>00184
202
+ <a name="l00185"></a>00185 <span class="keyword">virtual</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="keywordflow">throw</span>() {}
203
+ <a name="l00186"></a>00186 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> <span class="keywordflow">throw</span>() { <span class="keywordflow">return</span> msg.c_str(); }
204
+ <a name="l00187"></a>00187 <span class="comment"></span>
205
+ <a name="l00188"></a>00188 <span class="comment"> /**</span>
206
+ <a name="l00189"></a>00189 <span class="comment"> * Check whether an error page is available.</span>
207
+ <a name="l00190"></a>00190 <span class="comment"> */</span>
208
+ <a name="l00191"></a><a class="code" href="classPassenger_1_1SpawnException.html#e65dc272e183fd9e5637a4091cc6bbf4">00191</a> <span class="keywordtype">bool</span> <a class="code" href="classPassenger_1_1SpawnException.html#e65dc272e183fd9e5637a4091cc6bbf4" title="Check whether an error page is available.">hasErrorPage</a>()<span class="keyword"> const </span>{
209
+ <a name="l00192"></a>00192 <span class="keywordflow">return</span> m_hasErrorPage;
210
+ <a name="l00193"></a>00193 }
211
+ <a name="l00194"></a>00194 <span class="comment"></span>
212
+ <a name="l00195"></a>00195 <span class="comment"> /**</span>
213
+ <a name="l00196"></a>00196 <span class="comment"> * Return the error page content.</span>
214
+ <a name="l00197"></a>00197 <span class="comment"> *</span>
215
+ <a name="l00198"></a>00198 <span class="comment"> * @pre hasErrorPage()</span>
216
+ <a name="l00199"></a>00199 <span class="comment"> */</span>
217
+ <a name="l00200"></a><a class="code" href="classPassenger_1_1SpawnException.html#6f675a37edd7070875d0744e7dd010a1">00200</a> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1SpawnException.html#6f675a37edd7070875d0744e7dd010a1" title="Return the error page content.">getErrorPage</a>()<span class="keyword"> const </span>{
218
+ <a name="l00201"></a>00201 <span class="keywordflow">return</span> m_errorPage;
219
+ <a name="l00202"></a>00202 }
220
+ <a name="l00203"></a>00203 };
221
+ <a name="l00204"></a>00204 <span class="comment"></span>
222
+ <a name="l00205"></a>00205 <span class="comment">/**</span>
223
+ <a name="l00206"></a>00206 <span class="comment"> * The application pool is too busy and cannot fulfill a get() request.</span>
224
+ <a name="l00207"></a>00207 <span class="comment"> *</span>
225
+ <a name="l00208"></a>00208 <span class="comment"> * @ingroup Exceptions</span>
226
+ <a name="l00209"></a>00209 <span class="comment"> */</span>
227
+ <a name="l00210"></a><a class="code" href="classPassenger_1_1BusyException.html">00210</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1BusyException.html" title="The application pool is too busy and cannot fulfill a get() request.">BusyException</a>: <span class="keyword">public</span> exception {
228
+ <a name="l00211"></a>00211 <span class="keyword">private</span>:
229
+ <a name="l00212"></a>00212 <span class="keywordtype">string</span> msg;
230
+ <a name="l00213"></a>00213 <span class="keyword">public</span>:
231
+ <a name="l00214"></a>00214 <a class="code" href="classPassenger_1_1BusyException.html" title="The application pool is too busy and cannot fulfill a get() request.">BusyException</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;message): msg(message) {}
232
+ <a name="l00215"></a>00215 <span class="keyword">virtual</span> ~<a class="code" href="classPassenger_1_1BusyException.html" title="The application pool is too busy and cannot fulfill a get() request.">BusyException</a>() <span class="keywordflow">throw</span>() {}
233
+ <a name="l00216"></a>00216 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *what() <span class="keyword">const</span> <span class="keywordflow">throw</span>() { <span class="keywordflow">return</span> msg.c_str(); }
234
+ <a name="l00217"></a>00217 };
235
+ <a name="l00218"></a>00218
236
+ <a name="l00219"></a>00219 } <span class="comment">// namespace Passenger</span>
237
+ <a name="l00220"></a>00220
238
+ <a name="l00221"></a>00221 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_EXCEPTIONS_H_ */</span>
239
+ </pre></div></div>
240
+ <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 1 14:27:22 2008 for Passenger by&nbsp;
241
+ <a href="http://www.doxygen.org/index.html">
242
+ <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
243
+ </body>
244
+ </html>