mongrel 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. data/Rakefile +4 -2
  2. data/bin/mongrel_rails +65 -101
  3. data/bin/mongrel_rails_service +1 -1
  4. data/bin/mongrel_rails_svc +131 -115
  5. data/doc/rdoc/classes/Class.html +197 -0
  6. data/doc/rdoc/classes/Class.src/M000001.html +24 -0
  7. data/doc/rdoc/classes/Class.src/M000002.html +62 -0
  8. data/doc/rdoc/classes/Class.src/M000003.html +21 -0
  9. data/doc/rdoc/classes/Class.src/M000004.html +20 -0
  10. data/doc/rdoc/classes/IO.html +170 -0
  11. data/doc/rdoc/classes/IO.src/M000005.html +19 -0
  12. data/doc/rdoc/classes/IO.src/M000006.html +19 -0
  13. data/doc/rdoc/classes/Kernel.html +159 -0
  14. data/doc/rdoc/classes/Kernel.src/M000025.html +19 -0
  15. data/doc/rdoc/classes/Kernel.src/M000026.html +25 -0
  16. data/doc/rdoc/classes/Mongrel.html +181 -0
  17. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +383 -0
  18. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000090.html +24 -0
  19. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000091.html +47 -0
  20. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000092.html +34 -0
  21. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000093.html +27 -0
  22. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000094.html +25 -0
  23. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000095.html +18 -0
  24. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +18 -0
  25. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +18 -0
  26. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +19 -0
  27. data/doc/rdoc/classes/Mongrel/Camping.html +177 -0
  28. data/doc/rdoc/classes/Mongrel/Camping.src/M000048.html +22 -0
  29. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +165 -0
  30. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +18 -0
  31. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +27 -0
  32. data/doc/rdoc/classes/Mongrel/Command.html +119 -0
  33. data/doc/rdoc/classes/Mongrel/Command/Base.html +337 -0
  34. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +24 -0
  35. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +41 -0
  36. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +18 -0
  37. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +18 -0
  38. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +18 -0
  39. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +22 -0
  40. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +18 -0
  41. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +18 -0
  42. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +18 -0
  43. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +18 -0
  44. data/doc/rdoc/classes/Mongrel/Command/Registry.html +192 -0
  45. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +20 -0
  46. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +25 -0
  47. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +46 -0
  48. data/doc/rdoc/classes/Mongrel/Configurator.html +563 -0
  49. data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +24 -0
  50. data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +23 -0
  51. data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +18 -0
  52. data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +32 -0
  53. data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +19 -0
  54. data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +31 -0
  55. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +33 -0
  56. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +18 -0
  57. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +25 -0
  58. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +19 -0
  59. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +22 -0
  60. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +21 -0
  61. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +18 -0
  62. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +27 -0
  63. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +46 -0
  64. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +18 -0
  65. data/doc/rdoc/classes/Mongrel/Const.html +286 -0
  66. data/doc/rdoc/classes/Mongrel/DirHandler.html +288 -0
  67. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +20 -0
  68. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +42 -0
  69. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +40 -0
  70. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +51 -0
  71. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +40 -0
  72. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +18 -0
  73. data/doc/rdoc/classes/Mongrel/Error404Handler.html +171 -0
  74. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000115.html +18 -0
  75. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000116.html +18 -0
  76. data/doc/rdoc/classes/Mongrel/HeaderOut.html +185 -0
  77. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000072.html +18 -0
  78. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000073.html +18 -0
  79. data/doc/rdoc/classes/Mongrel/HttpHandler.html +152 -0
  80. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000074.html +17 -0
  81. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +169 -0
  82. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000027.html +18 -0
  83. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000028.html +17 -0
  84. data/doc/rdoc/classes/Mongrel/HttpParser.html +271 -0
  85. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +28 -0
  86. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +29 -0
  87. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +29 -0
  88. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +41 -0
  89. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +27 -0
  90. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000056.html +27 -0
  91. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000057.html +28 -0
  92. data/doc/rdoc/classes/Mongrel/HttpRequest.html +222 -0
  93. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000117.html +28 -0
  94. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000118.html +20 -0
  95. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000119.html +20 -0
  96. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000120.html +32 -0
  97. data/doc/rdoc/classes/Mongrel/HttpResponse.html +371 -0
  98. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +26 -0
  99. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +20 -0
  100. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +25 -0
  101. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +22 -0
  102. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +22 -0
  103. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +23 -0
  104. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +18 -0
  105. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +20 -0
  106. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +18 -0
  107. data/doc/rdoc/classes/Mongrel/HttpServer.html +360 -0
  108. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +24 -0
  109. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +65 -0
  110. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +24 -0
  111. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +60 -0
  112. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +28 -0
  113. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +18 -0
  114. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +22 -0
  115. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +18 -0
  116. data/doc/rdoc/classes/Mongrel/Rails.html +112 -0
  117. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +223 -0
  118. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +35 -0
  119. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +25 -0
  120. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +32 -0
  121. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +250 -0
  122. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +22 -0
  123. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +48 -0
  124. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +23 -0
  125. data/doc/rdoc/classes/Mongrel/StopServer.html +117 -0
  126. data/doc/rdoc/classes/Mongrel/URIClassifier.html +301 -0
  127. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000084.html +18 -0
  128. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000085.html +18 -0
  129. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000086.html +39 -0
  130. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +51 -0
  131. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +36 -0
  132. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +83 -0
  133. data/doc/rdoc/classes/MongrelDbg.html +209 -0
  134. data/doc/rdoc/classes/MongrelDbg.src/M000020.html +19 -0
  135. data/doc/rdoc/classes/MongrelDbg.src/M000021.html +20 -0
  136. data/doc/rdoc/classes/MongrelDbg.src/M000022.html +22 -0
  137. data/doc/rdoc/classes/MongrelDbg.src/M000023.html +21 -0
  138. data/doc/rdoc/classes/MongrelDbg.src/M000024.html +18 -0
  139. data/doc/rdoc/classes/ObjectTracker.html +176 -0
  140. data/doc/rdoc/classes/ObjectTracker.src/M000016.html +22 -0
  141. data/doc/rdoc/classes/ObjectTracker.src/M000017.html +18 -0
  142. data/doc/rdoc/classes/ObjectTracker.src/M000018.html +18 -0
  143. data/doc/rdoc/classes/ObjectTracker.src/M000019.html +46 -0
  144. data/doc/rdoc/classes/RequestLog.html +113 -0
  145. data/doc/rdoc/classes/RequestLog/Files.html +144 -0
  146. data/doc/rdoc/classes/RequestLog/Files.src/M000121.html +19 -0
  147. data/doc/rdoc/classes/RequestLog/Objects.html +144 -0
  148. data/doc/rdoc/classes/RequestLog/Objects.src/M000122.html +19 -0
  149. data/doc/rdoc/classes/RequestLog/Params.html +144 -0
  150. data/doc/rdoc/classes/RequestLog/Params.src/M000123.html +19 -0
  151. data/doc/rdoc/classes/Stats.html +306 -0
  152. data/doc/rdoc/classes/Stats.src/M000009.html +19 -0
  153. data/doc/rdoc/classes/Stats.src/M000010.html +23 -0
  154. data/doc/rdoc/classes/Stats.src/M000011.html +26 -0
  155. data/doc/rdoc/classes/Stats.src/M000012.html +18 -0
  156. data/doc/rdoc/classes/Stats.src/M000013.html +18 -0
  157. data/doc/rdoc/classes/Stats.src/M000014.html +19 -0
  158. data/doc/rdoc/classes/Stats.src/M000015.html +20 -0
  159. data/doc/rdoc/classes/TCPServer.html +173 -0
  160. data/doc/rdoc/classes/TCPServer.src/M000007.html +19 -0
  161. data/doc/rdoc/created.rid +1 -0
  162. data/doc/rdoc/files/COPYING.html +756 -0
  163. data/doc/rdoc/files/LICENSE.html +756 -0
  164. data/doc/rdoc/files/README.html +302 -0
  165. data/doc/rdoc/files/ext/http11/http11_c.html +101 -0
  166. data/doc/rdoc/files/lib/mongrel/camping_rb.html +108 -0
  167. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +108 -0
  168. data/doc/rdoc/files/lib/mongrel/command_rb.html +111 -0
  169. data/doc/rdoc/files/lib/mongrel/debug_rb.html +110 -0
  170. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +109 -0
  171. data/doc/rdoc/files/lib/mongrel/init_rb.html +109 -0
  172. data/doc/rdoc/files/lib/mongrel/rails_rb.html +111 -0
  173. data/doc/rdoc/files/lib/mongrel/stats_rb.html +117 -0
  174. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +109 -0
  175. data/doc/rdoc/files/lib/mongrel_rb.html +118 -0
  176. data/doc/rdoc/fr_class_index.html +60 -0
  177. data/doc/rdoc/fr_file_index.html +40 -0
  178. data/doc/rdoc/fr_method_index.html +149 -0
  179. data/doc/rdoc/index.html +24 -0
  180. data/doc/rdoc/rdoc-style.css +208 -0
  181. data/examples/builder.rb +29 -0
  182. data/examples/camping/blog.rb +11 -2
  183. data/examples/simpletest.rb +20 -7
  184. data/ext/http11/http11.c +71 -14
  185. data/ext/http11/http11_parser.c +27 -24
  186. data/ext/http11/http11_parser.h +2 -1
  187. data/lib/http11.bundle +0 -0
  188. data/lib/mongrel.rb +498 -135
  189. data/lib/mongrel/command.rb +1 -1
  190. data/lib/mongrel/debug.rb +259 -0
  191. data/lib/mongrel/handlers.rb +76 -22
  192. data/lib/mongrel/rails.rb +165 -72
  193. data/lib/mongrel/stats.rb +71 -0
  194. data/test/test_configurator.rb +67 -0
  195. data/test/test_debug.rb +31 -0
  196. data/test/test_http11.rb +16 -0
  197. data/test/test_response.rb +5 -0
  198. data/test/test_stats.rb +28 -0
  199. metadata +224 -2
@@ -0,0 +1,20 @@
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>start (Mongrel::HttpResponse)</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 280</span>
14
+ 280: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">status</span>=<span class="ruby-value">200</span>, <span class="ruby-identifier">finalize</span>=<span class="ruby-keyword kw">false</span>)
15
+ 281: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span>
16
+ 282: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@header</span>, <span class="ruby-ivar">@body</span>
17
+ 283: <span class="ruby-identifier">finished</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">finalize</span>
18
+ 284: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,25 @@
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>reset (Mongrel::HttpResponse)</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 289</span>
14
+ 289: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
15
+ 290: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body_sent</span>
16
+ 291: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;You have already sent the request body.&quot;</span>
17
+ 292: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@header_sent</span>
18
+ 293: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;You have already sent the request headers.&quot;</span>
19
+ 294: <span class="ruby-keyword kw">else</span>
20
+ 295: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
21
+ 296: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
22
+ 297: <span class="ruby-keyword kw">end</span>
23
+ 298: <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </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>send_status (Mongrel::HttpResponse)</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 300</span>
14
+ 300: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_status</span>(<span class="ruby-identifier">content_length</span>=<span class="ruby-keyword kw">nil</span>)
15
+ 301: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@status_sent</span>
16
+ 302: <span class="ruby-identifier">content_length</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span>
17
+ 303: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">STATUS_FORMAT</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">status</span>, <span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-ivar">@status</span>], <span class="ruby-identifier">content_length</span>])
18
+ 304: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">true</span>
19
+ 305: <span class="ruby-keyword kw">end</span>
20
+ 306: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </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>send_header (Mongrel::HttpResponse)</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 308</span>
14
+ 308: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_header</span>
15
+ 309: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@header_sent</span>
16
+ 310: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
17
+ 311: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">read</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LINE_END</span>)
18
+ 312: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">true</span>
19
+ 313: <span class="ruby-keyword kw">end</span>
20
+ 314: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,23 @@
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>send_body (Mongrel::HttpResponse)</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 316</span>
14
+ 316: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_body</span>
15
+ 317: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@body_sent</span>
16
+ 318: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
17
+ 319: <span class="ruby-comment cmt"># connection: close is also added to ensure that the client does not pipeline.</span>
18
+ 320: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@body</span>.<span class="ruby-identifier">read</span>)
19
+ 321: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
20
+ 322: <span class="ruby-keyword kw">end</span>
21
+ 323: <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </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>write (Mongrel::HttpResponse)</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 325</span>
14
+ 325: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
15
+ 326: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
16
+ 327: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,20 @@
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>finished (Mongrel::HttpResponse)</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 331</span>
14
+ 331: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finished</span>
15
+ 332: <span class="ruby-identifier">send_status</span>
16
+ 333: <span class="ruby-identifier">send_header</span>
17
+ 334: <span class="ruby-identifier">send_body</span>
18
+ 335: <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </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>done (Mongrel::HttpResponse)</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 337</span>
14
+ 337: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done</span>
15
+ 338: (<span class="ruby-ivar">@status_sent</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@header_sent</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@body_sent</span>)
16
+ 339: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,360 @@
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Mongrel::HttpServer</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Mongrel::HttpServer</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/mongrel_rb.html">
59
+ lib/mongrel.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ This is the main driver of <a href="../Mongrel.html">Mongrel</a>, while the
84
+ Mognrel::HttpParser and <a
85
+ href="URIClassifier.html">Mongrel::URIClassifier</a> make up the majority
86
+ of how the server functions. It&#8217;s a very simple class that just has a
87
+ thread accepting connections and a simple <a
88
+ href="HttpServer.html#M000065">HttpServer.process_client</a> function to do
89
+ the heavy lifting with the <a href="../IO.html">IO</a> and Ruby.
90
+ </p>
91
+ <p>
92
+ You use it by doing the following:
93
+ </p>
94
+ <pre>
95
+ server = HttpServer.new(&quot;0.0.0.0&quot;, 3000)
96
+ server.register(&quot;/stuff&quot;, MyNifterHandler.new)
97
+ server.run.join
98
+ </pre>
99
+ <p>
100
+ The last line can be just server.run if you don&#8217;t want to join the
101
+ thread used. If you don&#8217;t though Ruby will mysteriously just exit on
102
+ you.
103
+ </p>
104
+ <p>
105
+ Ruby&#8217;s thread implementation is &quot;interesting&quot; to say the
106
+ least. Experiments with <b>many</b> different types of <a
107
+ href="../IO.html">IO</a> processing simply cannot make a dent in it. Future
108
+ releases of <a href="../Mongrel.html">Mongrel</a> will find other creative
109
+ ways to make threads faster, but don&#8217;t hold your breath until Ruby
110
+ 1.9 is actually finally useful.
111
+ </p>
112
+
113
+ </div>
114
+
115
+
116
+ </div>
117
+
118
+ <div id="method-list">
119
+ <h3 class="section-bar">Methods</h3>
120
+
121
+ <div class="name-list">
122
+ <a href="#M000071">httpdate</a>&nbsp;&nbsp;
123
+ <a href="#M000064">new</a>&nbsp;&nbsp;
124
+ <a href="#M000065">process_client</a>&nbsp;&nbsp;
125
+ <a href="#M000066">reap_dead_workers</a>&nbsp;&nbsp;
126
+ <a href="#M000068">register</a>&nbsp;&nbsp;
127
+ <a href="#M000067">run</a>&nbsp;&nbsp;
128
+ <a href="#M000070">stop</a>&nbsp;&nbsp;
129
+ <a href="#M000069">unregister</a>&nbsp;&nbsp;
130
+ </div>
131
+ </div>
132
+
133
+ </div>
134
+
135
+
136
+ <!-- if includes -->
137
+
138
+ <div id="section">
139
+
140
+
141
+
142
+
143
+
144
+ <div id="attribute-list">
145
+ <h3 class="section-bar">Attributes</h3>
146
+
147
+ <div class="name-list">
148
+ <table>
149
+ <tr class="top-aligned-row context-row">
150
+ <td class="context-item-name">acceptor</td>
151
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
152
+ <td class="context-item-desc"></td>
153
+ </tr>
154
+ <tr class="top-aligned-row context-row">
155
+ <td class="context-item-name">classifier</td>
156
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
157
+ <td class="context-item-desc"></td>
158
+ </tr>
159
+ <tr class="top-aligned-row context-row">
160
+ <td class="context-item-name">workers</td>
161
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
162
+ <td class="context-item-desc"></td>
163
+ </tr>
164
+ </table>
165
+ </div>
166
+ </div>
167
+
168
+
169
+
170
+ <!-- if method_list -->
171
+ <div id="methods">
172
+ <h3 class="section-bar">Public Class methods</h3>
173
+
174
+ <div id="method-M000071" class="method-detail">
175
+ <a name="M000071"></a>
176
+
177
+ <div class="method-heading">
178
+ <a href="HttpServer.src/M000071.html" target="Code" class="method-signature"
179
+ onclick="popupCode('HttpServer.src/M000071.html');return false;">
180
+ <span class="method-name">httpdate</span><span class="method-args">(date)</span>
181
+ </a>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+ <p>
186
+ Given the a time object it converts it to GMT and applies the RFC1123
187
+ format to it.
188
+ </p>
189
+ </div>
190
+ </div>
191
+
192
+ <div id="method-M000064" class="method-detail">
193
+ <a name="M000064"></a>
194
+
195
+ <div class="method-heading">
196
+ <a href="HttpServer.src/M000064.html" target="Code" class="method-signature"
197
+ onclick="popupCode('HttpServer.src/M000064.html');return false;">
198
+ <span class="method-name">new</span><span class="method-args">(host, port, num_processors=(2**30-1), timeout=0)</span>
199
+ </a>
200
+ </div>
201
+
202
+ <div class="method-description">
203
+ <p>
204
+ Creates a working server on host:port (strange things happen if port
205
+ isn&#8217;t a Number). Use HttpServer::run to start the server and
206
+ HttpServer.acceptor.join to join the thread that&#8217;s processing
207
+ incoming requests on the socket.
208
+ </p>
209
+ <p>
210
+ The num_processors optional argument is the maximum number of concurrent
211
+ processors to accept, anything over this is closed immediately to maintain
212
+ server processing performance. This may seem mean but it is the most
213
+ efficient way to deal with overload. Other schemes involve still parsing
214
+ the client&#8217;s request which defeats the point of an overload handling
215
+ system.
216
+ </p>
217
+ <p>
218
+ The timeout parameter is a sleep timeout (in hundredths of a second) that
219
+ is placed between socket.accept calls in order to give the server a cheap
220
+ throttle time. It defaults to 0 and actually if it is 0 then the sleep is
221
+ not done at all.
222
+ </p>
223
+ </div>
224
+ </div>
225
+
226
+ <h3 class="section-bar">Public Instance methods</h3>
227
+
228
+ <div id="method-M000065" class="method-detail">
229
+ <a name="M000065"></a>
230
+
231
+ <div class="method-heading">
232
+ <a href="HttpServer.src/M000065.html" target="Code" class="method-signature"
233
+ onclick="popupCode('HttpServer.src/M000065.html');return false;">
234
+ <span class="method-name">process_client</span><span class="method-args">(client)</span>
235
+ </a>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+ <p>
240
+ Does the majority of the <a href="../IO.html">IO</a> processing. It has
241
+ been written in Ruby using about 7 different <a href="../IO.html">IO</a>
242
+ processing strategies and no matter how it&#8217;s done the performance
243
+ just does not improve. It is currently carefully constructed to make sure
244
+ that it gets the best possible performance, but anyone who thinks they can
245
+ make it faster is more than welcome to take a crack at it.
246
+ </p>
247
+ </div>
248
+ </div>
249
+
250
+ <div id="method-M000066" class="method-detail">
251
+ <a name="M000066"></a>
252
+
253
+ <div class="method-heading">
254
+ <a href="HttpServer.src/M000066.html" target="Code" class="method-signature"
255
+ onclick="popupCode('HttpServer.src/M000066.html');return false;">
256
+ <span class="method-name">reap_dead_workers</span><span class="method-args">(worker_list)</span>
257
+ </a>
258
+ </div>
259
+
260
+ <div class="method-description">
261
+ <p>
262
+ Used internally to kill off any worker threads that have taken too long to
263
+ complete processing. Only called if there are too many processors currently
264
+ servicing.
265
+ </p>
266
+ </div>
267
+ </div>
268
+
269
+ <div id="method-M000068" class="method-detail">
270
+ <a name="M000068"></a>
271
+
272
+ <div class="method-heading">
273
+ <a href="HttpServer.src/M000068.html" target="Code" class="method-signature"
274
+ onclick="popupCode('HttpServer.src/M000068.html');return false;">
275
+ <span class="method-name">register</span><span class="method-args">(uri, handler)</span>
276
+ </a>
277
+ </div>
278
+
279
+ <div class="method-description">
280
+ <p>
281
+ Simply registers a handler with the internal <a
282
+ href="URIClassifier.html">URIClassifier</a>. When the URI is found in the
283
+ prefix of a request then your handler&#8217;s HttpHandler::process method
284
+ is called. See <a
285
+ href="URIClassifier.html#M000087">Mongrel::URIClassifier#register</a> for
286
+ more information.
287
+ </p>
288
+ </div>
289
+ </div>
290
+
291
+ <div id="method-M000067" class="method-detail">
292
+ <a name="M000067"></a>
293
+
294
+ <div class="method-heading">
295
+ <a href="HttpServer.src/M000067.html" target="Code" class="method-signature"
296
+ onclick="popupCode('HttpServer.src/M000067.html');return false;">
297
+ <span class="method-name">run</span><span class="method-args">()</span>
298
+ </a>
299
+ </div>
300
+
301
+ <div class="method-description">
302
+ <p>
303
+ Runs the thing. It returns the thread used so you can &quot;join&quot; it.
304
+ You can also access the HttpServer::acceptor attribute to get the thread
305
+ later.
306
+ </p>
307
+ </div>
308
+ </div>
309
+
310
+ <div id="method-M000070" class="method-detail">
311
+ <a name="M000070"></a>
312
+
313
+ <div class="method-heading">
314
+ <a href="HttpServer.src/M000070.html" target="Code" class="method-signature"
315
+ onclick="popupCode('HttpServer.src/M000070.html');return false;">
316
+ <span class="method-name">stop</span><span class="method-args">()</span>
317
+ </a>
318
+ </div>
319
+
320
+ <div class="method-description">
321
+ <p>
322
+ Stops the acceptor thread and then causes the worker threads to finish off
323
+ the request queue before finally exiting.
324
+ </p>
325
+ </div>
326
+ </div>
327
+
328
+ <div id="method-M000069" class="method-detail">
329
+ <a name="M000069"></a>
330
+
331
+ <div class="method-heading">
332
+ <a href="HttpServer.src/M000069.html" target="Code" class="method-signature"
333
+ onclick="popupCode('HttpServer.src/M000069.html');return false;">
334
+ <span class="method-name">unregister</span><span class="method-args">(uri)</span>
335
+ </a>
336
+ </div>
337
+
338
+ <div class="method-description">
339
+ <p>
340
+ Removes any handlers registered at the given URI. See <a
341
+ href="URIClassifier.html#M000088">Mongrel::URIClassifier#unregister</a> for
342
+ more information. Remember this removes them <b>all</b> so the entire
343
+ processing chain goes away.
344
+ </p>
345
+ </div>
346
+ </div>
347
+
348
+
349
+ </div>
350
+
351
+
352
+ </div>
353
+
354
+
355
+ <div id="validator-badges">
356
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
357
+ </div>
358
+
359
+ </body>
360
+ </html>