mongrel 0.3.13.1 → 0.3.13.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. data/Rakefile +3 -1
  2. data/doc/rdoc/classes/Mongrel.html +3 -2
  3. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
  4. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000101.html +11 -14
  5. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +34 -12
  6. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000103.html +21 -5
  7. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +14 -5
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000105.html +12 -5
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000106.html +5 -6
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000107.html +18 -0
  11. data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000090.html → CGIWrapper.src/M000108.html} +5 -5
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000109.html +19 -0
  13. data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
  14. data/doc/rdoc/classes/Mongrel/Camping.src/{M000047.html → M000048.html} +0 -0
  15. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
  16. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +5 -38
  17. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +51 -0
  18. data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
  19. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +11 -29
  20. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +29 -5
  21. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +5 -5
  22. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -5
  23. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +5 -5
  24. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +5 -9
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +9 -5
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +5 -5
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +5 -11
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +11 -11
  30. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +11 -5
  31. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +18 -0
  32. data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
  33. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +7 -12
  34. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +12 -37
  35. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +50 -0
  36. data/doc/rdoc/classes/Mongrel/Configurator.html +120 -114
  37. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +14 -7
  38. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +18 -10
  39. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +7 -5
  40. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +7 -21
  41. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +10 -6
  42. data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +5 -17
  43. data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +25 -20
  44. data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +6 -5
  45. data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +17 -11
  46. data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +20 -6
  47. data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +5 -5
  48. data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +11 -9
  49. data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +6 -12
  50. data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +5 -5
  51. data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +9 -22
  52. data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +12 -5
  53. data/doc/rdoc/classes/Mongrel/Configurator.src/M000126.html +5 -20
  54. data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +22 -5
  55. data/doc/rdoc/classes/Mongrel/Configurator.src/M000128.html +18 -0
  56. data/doc/rdoc/classes/Mongrel/Configurator.src/M000129.html +33 -0
  57. data/doc/rdoc/classes/Mongrel/Configurator.src/M000130.html +18 -0
  58. data/doc/rdoc/classes/Mongrel/Const.html +1 -1
  59. data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
  60. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000096.html → M000099.html} +5 -5
  61. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000097.html → M000100.html} +14 -14
  62. data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
  63. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +8 -30
  64. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +30 -29
  65. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +29 -50
  66. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +50 -26
  67. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +26 -5
  68. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +18 -0
  69. data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
  70. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000128.html → M000131.html} +4 -4
  71. data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000129.html → M000132.html} +4 -4
  72. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  73. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000070.html → M000072.html} +4 -4
  74. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000071.html → M000073.html} +4 -4
  75. data/doc/rdoc/classes/Mongrel/HttpHandler.html +31 -10
  76. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000076.html → M000078.html} +0 -0
  77. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000079.html +17 -0
  78. data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000077.html → M000080.html} +3 -3
  79. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +25 -10
  80. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000022.html +3 -3
  81. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000023.html +4 -6
  82. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000024.html +6 -4
  83. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000025.html +17 -0
  84. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  85. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +5 -6
  86. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +7 -7
  87. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +7 -37
  88. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +37 -5
  89. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +5 -5
  90. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000056.html +5 -6
  91. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000050.html → M000057.html} +6 -6
  92. data/doc/rdoc/classes/Mongrel/HttpRequest.html +30 -21
  93. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +43 -19
  94. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000136.html → M000139.html} +6 -6
  95. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000137.html → M000140.html} +6 -6
  96. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000141.html +32 -0
  97. data/doc/rdoc/classes/Mongrel/HttpResponse.html +61 -61
  98. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +12 -9
  99. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +7 -9
  100. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +12 -9
  101. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +9 -18
  102. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +9 -8
  103. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +9 -7
  104. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +18 -7
  105. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000088.html +8 -7
  106. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000089.html +7 -5
  107. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000090.html +20 -0
  108. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000091.html +20 -0
  109. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000092.html +18 -0
  110. data/doc/rdoc/classes/Mongrel/HttpServer.html +63 -41
  111. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +12 -76
  112. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +74 -13
  113. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +18 -50
  114. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +8 -21
  115. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +38 -5
  116. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +21 -9
  117. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +18 -0
  118. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +22 -0
  119. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
  120. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +26 -12
  121. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +12 -13
  122. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +26 -0
  123. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +15 -15
  124. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +9 -38
  125. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +38 -10
  126. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +23 -0
  127. data/doc/rdoc/classes/Mongrel/RedirectHandler.html +10 -10
  128. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000133.html → M000136.html} +8 -8
  129. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000134.html → M000137.html} +13 -13
  130. data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
  131. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000130.html → M000133.html} +10 -10
  132. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000131.html → M000134.html} +10 -10
  133. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000132.html → M000135.html} +4 -4
  134. data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
  135. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +5 -29
  136. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000075.html +11 -7
  137. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000076.html +42 -0
  138. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000077.html +20 -0
  139. data/doc/rdoc/classes/Mongrel/TimeoutError.html +117 -0
  140. data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
  141. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +5 -38
  142. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000094.html +5 -23
  143. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000095.html +16 -60
  144. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000096.html +51 -0
  145. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000097.html +36 -0
  146. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000098.html +83 -0
  147. data/doc/rdoc/classes/RequestLog/Access.html +5 -5
  148. data/doc/rdoc/classes/RequestLog/Access.src/{M000139.html → M000142.html} +0 -0
  149. data/doc/rdoc/classes/RequestLog/Files.html +5 -5
  150. data/doc/rdoc/classes/RequestLog/Files.src/{M000140.html → M000143.html} +0 -0
  151. data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
  152. data/doc/rdoc/classes/RequestLog/Objects.src/{M000142.html → M000145.html} +0 -0
  153. data/doc/rdoc/classes/RequestLog/Params.html +5 -5
  154. data/doc/rdoc/classes/RequestLog/Params.src/{M000143.html → M000146.html} +0 -0
  155. data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
  156. data/doc/rdoc/classes/RequestLog/Threads.src/{M000141.html → M000144.html} +0 -0
  157. data/doc/rdoc/created.rid +1 -1
  158. data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
  159. data/doc/rdoc/files/lib/mongrel/camping_rb.html +2 -2
  160. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +2 -2
  161. data/doc/rdoc/files/lib/mongrel/command_rb.html +2 -2
  162. data/doc/rdoc/files/lib/mongrel/debug_rb.html +2 -2
  163. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
  164. data/doc/rdoc/files/lib/mongrel/init_rb.html +2 -2
  165. data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -2
  166. data/doc/rdoc/files/lib/mongrel/stats_rb.html +2 -2
  167. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +2 -2
  168. data/doc/rdoc/files/lib/mongrel_rb.html +2 -2
  169. data/doc/rdoc/fr_class_index.html +1 -0
  170. data/doc/rdoc/fr_method_index.html +125 -122
  171. data/ext/http11/http11.c +2 -2
  172. data/ext/http11/http11_parser.c +1 -1
  173. data/ext/http11/http11_parser.h +1 -1
  174. data/lib/mongrel.rb +70 -53
  175. data/lib/mongrel/camping.rb +1 -1
  176. data/lib/mongrel/cgi.rb +1 -1
  177. data/lib/mongrel/command.rb +1 -1
  178. data/lib/mongrel/debug.rb +1 -1
  179. data/lib/mongrel/handlers.rb +10 -1
  180. data/lib/mongrel/init.rb +1 -1
  181. data/lib/mongrel/rails.rb +1 -1
  182. data/lib/mongrel/stats.rb +1 -1
  183. data/lib/mongrel/tcphack.rb +1 -1
  184. data/test/test_command.rb +1 -1
  185. data/test/test_conditional.rb +1 -1
  186. data/test/test_configurator.rb +1 -1
  187. data/test/test_debug.rb +1 -1
  188. data/test/test_handlers.rb +1 -1
  189. data/test/test_http11.rb +1 -1
  190. data/test/test_response.rb +1 -1
  191. data/test/test_stats.rb +1 -1
  192. data/test/test_uriclassifier.rb +1 -1
  193. data/test/test_ws.rb +1 -1
  194. data/tools/trickletest.rb +28 -20
  195. metadata +50 -46
  196. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +0 -24
  197. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000099.html +0 -47
  198. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000100.html +0 -34
  199. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +0 -18
  200. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +0 -24
  201. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000038.html +0 -20
  202. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +0 -29
  203. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +0 -31
  204. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +0 -20
  205. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +0 -21
  206. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +0 -52
  207. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +0 -25
  208. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +0 -20
  209. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +0 -25
  210. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +0 -25
  211. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000041.html +0 -39
  212. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +0 -22
  213. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +0 -18
  214. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +0 -24
  215. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +0 -18
  216. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +0 -39
@@ -5,85 +5,21 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>process_client (Mongrel::HttpServer)</title>
8
+ <title>new (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 516</span>
14
- 516: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
15
- 517: <span class="ruby-keyword kw">begin</span>
16
- 518: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
17
- 519: <span class="ruby-identifier">params</span> = {}
18
- 520:
19
- 521: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
20
- 522: <span class="ruby-identifier">nparsed</span> = <span class="ruby-value">0</span>
21
- 523:
22
- 524: <span class="ruby-comment cmt"># Assumption: nparsed will always be less since data will get filled with more</span>
23
- 525: <span class="ruby-comment cmt"># after each parsing. If it doesn't get more then there was a problem</span>
24
- 526: <span class="ruby-comment cmt"># with the read operation on the client socket. Effect is to stop processing when the</span>
25
- 527: <span class="ruby-comment cmt"># socket can't fill the buffer for further parsing.</span>
26
- 528: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">nparsed</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>
27
- 529: <span class="ruby-identifier">nparsed</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">nparsed</span>)
28
- 530:
29
- 531: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
30
- 532: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_URI</span>])
31
- 533:
32
- 534: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>
33
- 535: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_INFO</span>] = <span class="ruby-identifier">path_info</span>
34
- 536: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SCRIPT_NAME</span>] = <span class="ruby-identifier">script_name</span>
35
- 537: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REMOTE_ADDR</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_X_FORWARDED_FOR</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">peeraddr</span>.<span class="ruby-identifier">last</span>
36
- 538: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">data</span>[<span class="ruby-identifier">nparsed</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
37
- 539:
38
- 540: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">request_notify</span>
39
- 541: <span class="ruby-comment cmt"># this first handler wants to be notified when the process starts</span>
40
- 542: <span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">request_begins</span>(<span class="ruby-identifier">params</span>)
41
- 543: <span class="ruby-keyword kw">end</span>
42
- 544:
43
- 545: <span class="ruby-comment cmt"># TODO: Find a faster/better way to carve out the range, preferably without copying.</span>
44
- 546: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">client</span>)
45
- 547:
46
- 548: <span class="ruby-comment cmt"># in the case of large file uploads the user could close the socket, so skip those requests</span>
47
- 549: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># nil signals from HttpRequest::initialize that the request was aborted</span>
48
- 550:
49
- 551: <span class="ruby-comment cmt"># request is good so far, continue processing the response</span>
50
- 552: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
51
- 553:
52
- 554: <span class="ruby-comment cmt"># Process each handler in registered order until we run out or one finalizes the response.</span>
53
- 555: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">handler</span><span class="ruby-operator">|</span>
54
- 556: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
55
- 557: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
56
- 558: <span class="ruby-keyword kw">end</span>
57
- 559:
58
- 560: <span class="ruby-comment cmt"># And finally, if nobody closed the response off, we finalize it.</span>
59
- 561: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
60
- 562: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finished</span>
61
- 563: <span class="ruby-keyword kw">end</span>
62
- 564: <span class="ruby-keyword kw">else</span>
63
- 565: <span class="ruby-comment cmt"># Didn't find it, return a stock 404 response.</span>
64
- 566: <span class="ruby-comment cmt"># TODO: Implement customer 404 files (but really they should use a real web server).</span>
65
- 567: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span>)
66
- 568: <span class="ruby-keyword kw">end</span>
67
- 569:
68
- 570: <span class="ruby-keyword kw">break</span> <span class="ruby-comment cmt">#done</span>
69
- 571: <span class="ruby-keyword kw">else</span>
70
- 572: <span class="ruby-comment cmt"># Parser is not done, queue up more data to read and continue parsing</span>
71
- 573: <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
72
- 574: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_HEADER</span>
73
- 575: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpParserError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;HEADER is longer than allowed, aborting client early.&quot;</span>)
74
- 576: <span class="ruby-keyword kw">end</span>
75
- 577: <span class="ruby-keyword kw">end</span>
76
- 578: <span class="ruby-keyword kw">end</span>
77
- 579: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPIPE</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EINVAL</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EBADF</span>
78
- 580: <span class="ruby-comment cmt"># ignored</span>
79
- 581: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpParserError</span>
80
- 582: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{Time.now}: BAD CLIENT (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #$!&quot;</span>
81
- 583: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">details</span>
82
- 584: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{Time.now}: ERROR: #$!&quot;</span>
83
- 585: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
84
- 586: <span class="ruby-keyword kw">ensure</span>
85
- 587: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
86
- 588: <span class="ruby-keyword kw">end</span>
87
- 589: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 509</span>
14
+ 509: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">num_processors</span>=(<span class="ruby-value">2</span><span class="ruby-operator">**</span><span class="ruby-value">30</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>), <span class="ruby-identifier">timeout</span>=<span class="ruby-value">0</span>)
15
+ 510: <span class="ruby-ivar">@socket</span> = <span class="ruby-constant">TCPServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
16
+ 511: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span>
17
+ 512: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
18
+ 513: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
19
+ 514: <span class="ruby-ivar">@workers</span> = <span class="ruby-constant">ThreadGroup</span>.<span class="ruby-identifier">new</span>
20
+ 515: <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
21
+ 516: <span class="ruby-ivar">@num_processors</span> = <span class="ruby-identifier">num_processors</span>
22
+ 517: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">60</span>
23
+ 518: <span class="ruby-keyword kw">end</span></pre>
88
24
  </body>
89
25
  </html>
@@ -5,22 +5,83 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>reap_dead_workers (Mongrel::HttpServer)</title>
8
+ <title>process_client (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 594</span>
14
- 594: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">worker_list</span>)
15
- 595: <span class="ruby-identifier">mark</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
16
- 596: <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
17
- 597: <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>]
18
- 598:
19
- 599: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mark</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@timeout</span>
20
- 600: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Thread #{w.inspect} is too old, killing.&quot;</span>
21
- 601: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Timed out thread.&quot;</span>))
22
- 602: <span class="ruby-keyword kw">end</span>
23
- 603: <span class="ruby-keyword kw">end</span>
24
- 604: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 526</span>
14
+ 526: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
15
+ 527: <span class="ruby-keyword kw">begin</span>
16
+ 528: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
17
+ 529: <span class="ruby-identifier">params</span> = {}
18
+ 530: <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>
19
+ 531: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
20
+ 532: <span class="ruby-identifier">nparsed</span> = <span class="ruby-value">0</span>
21
+ 533:
22
+ 534: <span class="ruby-comment cmt"># Assumption: nparsed will always be less since data will get filled with more</span>
23
+ 535: <span class="ruby-comment cmt"># after each parsing. If it doesn't get more then there was a problem</span>
24
+ 536: <span class="ruby-comment cmt"># with the read operation on the client socket. Effect is to stop processing when the</span>
25
+ 537: <span class="ruby-comment cmt"># socket can't fill the buffer for further parsing.</span>
26
+ 538: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">nparsed</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>
27
+ 539: <span class="ruby-identifier">nparsed</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">nparsed</span>)
28
+ 540:
29
+ 541: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
30
+ 542: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_URI</span>])
31
+ 543:
32
+ 544: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>
33
+ 545: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_INFO</span>] = <span class="ruby-identifier">path_info</span>
34
+ 546: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SCRIPT_NAME</span>] = <span class="ruby-identifier">script_name</span>
35
+ 547: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REMOTE_ADDR</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_X_FORWARDED_FOR</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">peeraddr</span>.<span class="ruby-identifier">last</span>
36
+ 548: <span class="ruby-identifier">notifier</span> = <span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">request_notify</span> <span class="ruby-value">? </span><span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
37
+ 549:
38
+ 550: <span class="ruby-comment cmt"># TODO: Find a faster/better way to carve out the range, preferably without copying.</span>
39
+ 551: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">data</span>[<span class="ruby-identifier">nparsed</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
40
+ 552:
41
+ 553: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">client</span>, <span class="ruby-identifier">notifier</span>)
42
+ 554:
43
+ 555: <span class="ruby-comment cmt"># in the case of large file uploads the user could close the socket, so skip those requests</span>
44
+ 556: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># nil signals from HttpRequest::initialize that the request was aborted</span>
45
+ 557:
46
+ 558: <span class="ruby-comment cmt"># request is good so far, continue processing the response</span>
47
+ 559: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
48
+ 560:
49
+ 561: <span class="ruby-comment cmt"># Process each handler in registered order until we run out or one finalizes the response.</span>
50
+ 562: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">handler</span><span class="ruby-operator">|</span>
51
+ 563: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
52
+ 564: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
53
+ 565: <span class="ruby-keyword kw">end</span>
54
+ 566:
55
+ 567: <span class="ruby-comment cmt"># And finally, if nobody closed the response off, we finalize it.</span>
56
+ 568: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
57
+ 569: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finished</span>
58
+ 570: <span class="ruby-keyword kw">end</span>
59
+ 571: <span class="ruby-keyword kw">else</span>
60
+ 572: <span class="ruby-comment cmt"># Didn't find it, return a stock 404 response.</span>
61
+ 573: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span>)
62
+ 574: <span class="ruby-keyword kw">end</span>
63
+ 575:
64
+ 576: <span class="ruby-keyword kw">break</span> <span class="ruby-comment cmt">#done</span>
65
+ 577: <span class="ruby-keyword kw">else</span>
66
+ 578: <span class="ruby-comment cmt"># Parser is not done, queue up more data to read and continue parsing</span>
67
+ 579: <span class="ruby-identifier">data</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
68
+ 580: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_HEADER</span>
69
+ 581: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpParserError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;HEADER is longer than allowed, aborting client early.&quot;</span>)
70
+ 582: <span class="ruby-keyword kw">end</span>
71
+ 583: <span class="ruby-keyword kw">end</span>
72
+ 584: <span class="ruby-keyword kw">end</span>
73
+ 585: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPIPE</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EINVAL</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EBADF</span>
74
+ 586: <span class="ruby-comment cmt"># ignored</span>
75
+ 587: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpParserError</span>
76
+ 588: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{Time.now}: BAD CLIENT (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #$!&quot;</span>
77
+ 589: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
78
+ 590: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">'too many files'</span>)
79
+ 591: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
80
+ 592: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{Time.now}: ERROR: #$!&quot;</span>
81
+ 593: <span class="ruby-keyword kw">ensure</span>
82
+ 594: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
83
+ 595: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">delete</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Tempfile</span>
84
+ 596: <span class="ruby-keyword kw">end</span>
85
+ 597: <span class="ruby-keyword kw">end</span></pre>
25
86
  </body>
26
87
  </html>
@@ -5,59 +5,27 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>run (Mongrel::HttpServer)</title>
8
+ <title>reap_dead_workers (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 609</span>
14
- 609: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
15
- 610: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
16
- 611:
17
- 612: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
18
- 613: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
19
- 614: <span class="ruby-keyword kw">begin</span>
20
- 615: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
21
- 616: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
22
- 617:
23
- 618: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@num_processors</span>
24
- 619: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection.&quot;</span>
25
- 620: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
26
- 621: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">worker_list</span>)
27
- 622: <span class="ruby-keyword kw">else</span>
28
- 623: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
29
- 624: <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
30
- 625: <span class="ruby-keyword kw">end</span>
31
- 626:
32
- 627: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
33
- 628: <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">priority</span>=<span class="ruby-value">1</span>
34
- 629: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
35
- 630:
36
- 631: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
37
- 632: <span class="ruby-keyword kw">end</span>
38
- 633: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
39
- 634: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">closed?</span>
40
- 635: <span class="ruby-keyword kw">break</span>
41
- 636: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
42
- 637: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Too many open files. Try increasing ulimits.&quot;</span>
43
- 638: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
44
- 639: <span class="ruby-keyword kw">end</span>
45
- 640: <span class="ruby-keyword kw">end</span>
46
- 641:
47
- 642: <span class="ruby-comment cmt"># troll through the threads that are waiting and kill any that take too long</span>
48
- 643: <span class="ruby-comment cmt"># TODO: Allow for death time to be set if people ask for it.</span>
49
- 644: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">10</span>
50
- 645: <span class="ruby-identifier">shutdown_start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
51
- 646:
52
- 647: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
53
- 648: <span class="ruby-identifier">waited_for</span> = (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">shutdown_start</span>).<span class="ruby-identifier">ceil</span>
54
- 649: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Shutdown waited #{waited_for} for #{@workers.list.length} requests, could take #{@death_time + @timeout} seconds.\r&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
55
- 650: <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span>
56
- 651: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>)
57
- 652: <span class="ruby-keyword kw">end</span>
58
- 653: <span class="ruby-keyword kw">end</span>
59
- 654:
60
- 655: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
61
- 656: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 603</span>
14
+ 603: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">reason</span>=<span class="ruby-value str">'unknown'</span>)
15
+ 604: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
16
+ 605: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'&quot;</span>
17
+ 606: <span class="ruby-identifier">mark</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
18
+ 607: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
19
+ 608: <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>]
20
+ 609:
21
+ 610: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mark</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@timeout</span>
22
+ 611: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Thread #{w.inspect} is too old, killing.&quot;</span>
23
+ 612: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">TimeoutError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Timed out thread.&quot;</span>))
24
+ 613: <span class="ruby-keyword kw">end</span>
25
+ 614: <span class="ruby-keyword kw">end</span>
26
+ 615: <span class="ruby-keyword kw">end</span>
27
+ 616:
28
+ 617: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span>
29
+ 618: <span class="ruby-keyword kw">end</span></pre>
62
30
  </body>
63
31
  </html>
@@ -5,30 +5,17 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>register (Mongrel::HttpServer)</title>
8
+ <title>graceful_shutdown (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 665</span>
14
- 665: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>, <span class="ruby-identifier">in_front</span>=<span class="ruby-keyword kw">false</span>)
15
- 666: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">uri</span>)
16
- 667:
17
- 668: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">handlers</span>
18
- 669: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
19
- 670: <span class="ruby-keyword kw">else</span>
20
- 671: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">script_name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">path_info</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span>)
21
- 672: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_front</span>
22
- 673: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">handler</span>)
23
- 674: <span class="ruby-keyword kw">else</span>
24
- 675: <span class="ruby-identifier">handlers</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">handler</span>
25
- 676: <span class="ruby-keyword kw">end</span>
26
- 677: <span class="ruby-keyword kw">else</span>
27
- 678: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
28
- 679: <span class="ruby-keyword kw">end</span>
29
- 680: <span class="ruby-keyword kw">end</span>
30
- 681:
31
- 682: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
32
- 683: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 624</span>
14
+ 624: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">graceful_shutdown</span>
15
+ 625: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">&quot;shutdown&quot;</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
16
+ 626: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Waiting for #{@workers.list.length} requests to finish, could take #{@death_time + @timeout} seconds.&quot;</span>
17
+ 627: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">/</span> <span class="ruby-value">10</span>
18
+ 628: <span class="ruby-keyword kw">end</span>
19
+ 629: <span class="ruby-keyword kw">end</span></pre>
33
20
  </body>
34
21
  </html>
@@ -5,14 +5,47 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>unregister (Mongrel::HttpServer)</title>
8
+ <title>run (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 688</span>
14
- 688: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
15
- 689: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
16
- 690: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 634</span>
14
+ 634: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
15
+ 635: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
16
+ 636:
17
+ 637: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
18
+ 638: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
19
+ 639: <span class="ruby-keyword kw">begin</span>
20
+ 640: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
21
+ 641: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
22
+ 642:
23
+ 643: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@num_processors</span>
24
+ 644: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection.&quot;</span>
25
+ 645: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
26
+ 646: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">&quot;max processors&quot;</span>)
27
+ 647: <span class="ruby-keyword kw">else</span>
28
+ 648: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> { <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>) }
29
+ 649:
30
+ 650: <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">abort_on_exception</span> = <span class="ruby-keyword kw">true</span>
31
+ 651: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
32
+ 652: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
33
+ 653:
34
+ 654: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
35
+ 655: <span class="ruby-keyword kw">end</span>
36
+ 656: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
37
+ 657: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">closed?</span>
38
+ 658: <span class="ruby-keyword kw">break</span>
39
+ 659: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
40
+ 660: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">&quot;too many open files&quot;</span>)
41
+ 661: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
42
+ 662: <span class="ruby-keyword kw">end</span>
43
+ 663: <span class="ruby-keyword kw">end</span>
44
+ 664:
45
+ 665: <span class="ruby-identifier">graceful_shutdown</span>
46
+ 666: <span class="ruby-keyword kw">end</span>
47
+ 667:
48
+ 668: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
49
+ 669: <span class="ruby-keyword kw">end</span></pre>
17
50
  </body>
18
51
  </html>
@@ -5,18 +5,30 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>stop (Mongrel::HttpServer)</title>
8
+ <title>register (Mongrel::HttpServer)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 694</span>
14
- 694: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
15
- 695: <span class="ruby-identifier">stopper</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
16
- 696: <span class="ruby-identifier">exc</span> = <span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>
17
- 697: <span class="ruby-ivar">@acceptor</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-identifier">exc</span>)
18
- 698: <span class="ruby-keyword kw">end</span>
19
- 699: <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">10</span>
20
- 700: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 678</span>
14
+ 678: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>, <span class="ruby-identifier">in_front</span>=<span class="ruby-keyword kw">false</span>)
15
+ 679: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">uri</span>)
16
+ 680:
17
+ 681: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">handlers</span>
18
+ 682: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
19
+ 683: <span class="ruby-keyword kw">else</span>
20
+ 684: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">script_name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">path_info</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span>)
21
+ 685: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_front</span>
22
+ 686: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">handler</span>)
23
+ 687: <span class="ruby-keyword kw">else</span>
24
+ 688: <span class="ruby-identifier">handlers</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">handler</span>
25
+ 689: <span class="ruby-keyword kw">end</span>
26
+ 690: <span class="ruby-keyword kw">else</span>
27
+ 691: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
28
+ 692: <span class="ruby-keyword kw">end</span>
29
+ 693: <span class="ruby-keyword kw">end</span>
30
+ 694:
31
+ 695: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
32
+ 696: <span class="ruby-keyword kw">end</span></pre>
21
33
  </body>
22
34
  </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>unregister (Mongrel::HttpServer)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 701</span>
14
+ 701: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
15
+ 702: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
16
+ 703: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>stop (Mongrel::HttpServer)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 707</span>
14
+ 707: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
15
+ 708: <span class="ruby-identifier">stopper</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
16
+ 709: <span class="ruby-identifier">exc</span> = <span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>
17
+ 710: <span class="ruby-ivar">@acceptor</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-identifier">exc</span>)
18
+ 711: <span class="ruby-keyword kw">end</span>
19
+ 712: <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">10</span>
20
+ 713: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>