mongrel 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/README +4 -3
  2. data/Rakefile +7 -5
  3. data/bin/mongrel_rails +5 -4
  4. data/bin/mongrel_rails_service +237 -0
  5. data/bin/mongrel_rails_svc +194 -0
  6. data/doc/rdoc/classes/Mongrel.html +1 -4
  7. data/doc/rdoc/classes/Mongrel/Const.html +13 -3
  8. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  9. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000033.html → M000028.html} +4 -4
  10. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000034.html → M000029.html} +7 -7
  11. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  12. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000041.html +39 -0
  13. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  14. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000034.html +21 -0
  15. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000041.html → M000035.html} +6 -6
  16. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000042.html → M000036.html} +5 -5
  17. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000043.html → M000037.html} +5 -5
  18. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000044.html → M000038.html} +6 -6
  19. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000045.html → M000039.html} +6 -6
  20. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000040.html +7 -8
  21. data/doc/rdoc/classes/Mongrel/HttpServer.html +47 -28
  22. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000022.html +33 -0
  23. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000023.html +57 -0
  24. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000024.html +46 -0
  25. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000031.html → M000025.html} +4 -4
  26. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000032.html → M000026.html} +4 -4
  27. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000027.html +19 -0
  28. data/doc/rdoc/classes/Mongrel/{HttpHandler.html → StopServer.html} +4 -33
  29. data/doc/rdoc/classes/Mongrel/URIClassifier.html +22 -23
  30. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000035.html → M000030.html} +0 -0
  31. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000036.html → M000031.html} +0 -0
  32. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000037.html → M000032.html} +0 -0
  33. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000038.html → M000033.html} +0 -0
  34. data/doc/rdoc/created.rid +1 -1
  35. data/doc/rdoc/files/README.html +9 -7
  36. data/doc/rdoc/files/lib/mongrel_rb.html +3 -3
  37. data/doc/rdoc/fr_class_index.html +1 -4
  38. data/doc/rdoc/fr_method_index.html +20 -37
  39. data/examples/mongrel_simple_ctrl.rb +92 -0
  40. data/examples/mongrel_simple_service.rb +116 -0
  41. data/examples/simpletest.rb +3 -1
  42. data/ext/http11/http11_parser.c +176 -263
  43. data/lib/mongrel.rb +56 -343
  44. data/lib/mongrel/cgi.rb +147 -0
  45. data/lib/mongrel/handlers.rb +180 -0
  46. metadata +28 -46
  47. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -346
  48. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000047.html +0 -24
  49. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000048.html +0 -48
  50. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000049.html +0 -34
  51. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000050.html +0 -27
  52. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000051.html +0 -26
  53. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000052.html +0 -18
  54. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000053.html +0 -18
  55. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000054.html +0 -18
  56. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000055.html +0 -19
  57. data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -283
  58. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000022.html +0 -20
  59. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000023.html +0 -42
  60. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000024.html +0 -40
  61. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000025.html +0 -31
  62. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000026.html +0 -38
  63. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000027.html +0 -18
  64. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  65. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000056.html +0 -18
  66. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000057.html +0 -18
  67. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000039.html +0 -17
  68. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000058.html +0 -31
  69. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000046.html +0 -20
  70. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000028.html +0 -38
  71. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000029.html +0 -64
  72. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000030.html +0 -23
@@ -1,64 +0,0 @@
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>process_client (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 350</span>
14
- 350: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
15
- 351: <span class="ruby-keyword kw">begin</span>
16
- 352: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
17
- 353: <span class="ruby-identifier">params</span> = {}
18
- 354: <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>)
19
- 355:
20
- 356: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
21
- 357: <span class="ruby-identifier">nread</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>)
22
- 358: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
23
- 359: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handler</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>])
24
- 360:
25
- 361: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handler</span>
26
- 362: <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>
27
- 363: <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>
28
- 364: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GATEWAY_INTERFACE</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GATEWAY_INTERFACE_VALUE</span>
29
- 365: <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">client</span>.<span class="ruby-identifier">peeraddr</span>[<span class="ruby-value">3</span>]
30
- 366: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_NAME</span>]=<span class="ruby-ivar">@host</span>
31
- 367: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PORT</span>]=<span class="ruby-ivar">@port</span>
32
- 368: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PROTOCOL</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PROTOCOL_VALUE</span>
33
- 369: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_SOFTWARE</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">MONGREL_VERSION</span>
34
- 370:
35
- 371: <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">nread</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>], <span class="ruby-identifier">client</span>)
36
- 372: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
37
- 373: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
38
- 374: <span class="ruby-keyword kw">else</span>
39
- 375: <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>)
40
- 376: <span class="ruby-keyword kw">end</span>
41
- 377:
42
- 378: <span class="ruby-keyword kw">break</span>
43
- 379: <span class="ruby-keyword kw">else</span>
44
- 380: <span class="ruby-comment cmt"># gotta stream and read again until we can get the parser to be character safe</span>
45
- 381: <span class="ruby-comment cmt"># TODO: make this more efficient since this means we're parsing a lot repeatedly</span>
46
- 382: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">reset</span>
47
- 383: <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>)
48
- 384: <span class="ruby-keyword kw">end</span>
49
- 385: <span class="ruby-keyword kw">end</span>
50
- 386: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
51
- 387: <span class="ruby-comment cmt"># ignored</span>
52
- 388: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>
53
- 389: <span class="ruby-comment cmt"># ignored</span>
54
- 390: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPIPE</span>
55
- 391: <span class="ruby-comment cmt"># ignored</span>
56
- 392: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">details</span>
57
- 393: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ERROR(#{details.class}): #{details}&quot;</span>
58
- 394: <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>)
59
- 395: <span class="ruby-keyword kw">ensure</span>
60
- 396: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span>
61
- 397: <span class="ruby-keyword kw">end</span>
62
- 398: <span class="ruby-keyword kw">end</span></pre>
63
- </body>
64
- </html>
@@ -1,23 +0,0 @@
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>run (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 402</span>
14
- 402: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
15
- 403: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
16
- 404: <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>
17
- 405: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
18
- 406: <span class="ruby-ivar">@req_queue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
19
- 407: <span class="ruby-keyword kw">end</span>
20
- 408: <span class="ruby-keyword kw">end</span>
21
- 409: <span class="ruby-keyword kw">end</span></pre>
22
- </body>
23
- </html>