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,40 +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>send_dir_listing (Mongrel::DirHandler)</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 513</span>
14
- 513: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">response</span>)
15
- 514: <span class="ruby-comment cmt"># take off any trailing / so the links come out right</span>
16
- 515: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>[<span class="ruby-value">-1</span>]
17
- 516:
18
- 517: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@listing_allowed</span>
19
- 518: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
20
- 519: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">&quot;text/html&quot;</span>
21
- 520: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Directory Listing&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&quot;</span>
22
- 521: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
23
- 522: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;.&quot;</span>
24
- 523:
25
- 524: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;..&quot;</span>
26
- 525: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;Up to parent..&lt;/a&gt;&lt;br/&gt;&quot;</span>
27
- 526: <span class="ruby-keyword kw">else</span>
28
- 527: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;a href=\&quot;#{base}/#{child}\&quot;&gt;#{child}&lt;/a&gt;&lt;br/&gt;&quot;</span>
29
- 528: <span class="ruby-keyword kw">end</span>
30
- 529: <span class="ruby-keyword kw">end</span>
31
- 530: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/body&gt;&lt;/html&gt;&quot;</span>
32
- 531: <span class="ruby-keyword kw">end</span>
33
- 532: <span class="ruby-keyword kw">else</span>
34
- 533: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
35
- 534: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;Directory listings not allowed&quot;</span>)
36
- 535: <span class="ruby-keyword kw">end</span>
37
- 536: <span class="ruby-keyword kw">end</span>
38
- 537: <span class="ruby-keyword kw">end</span></pre>
39
- </body>
40
- </html>
@@ -1,31 +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>send_file (Mongrel::DirHandler)</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 542</span>
14
- 542: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
15
- 543: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
16
- 544: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
17
- 545: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">&quot;.&quot;</span>)
18
- 546: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
19
- 547: <span class="ruby-identifier">ext</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
20
- 548: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
21
- 549: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
22
- 550: <span class="ruby-keyword kw">end</span>
23
- 551: <span class="ruby-keyword kw">end</span>
24
- 552:
25
- 553: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">req</span>, <span class="ruby-value str">&quot;rb&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
26
- 554: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>)
27
- 555: <span class="ruby-keyword kw">end</span>
28
- 556: <span class="ruby-keyword kw">end</span>
29
- 557: <span class="ruby-keyword kw">end</span></pre>
30
- </body>
31
- </html>
@@ -1,38 +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 (Mongrel::DirHandler)</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 562</span>
14
- 562: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
15
- 563: <span class="ruby-identifier">req</span> = <span class="ruby-identifier">can_serve</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>]
16
- 564: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">req</span>
17
- 565: <span class="ruby-comment cmt"># not found, return a 404</span>
18
- 566: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">404</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
19
- 567: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;File not found&quot;</span>
20
- 568: <span class="ruby-keyword kw">end</span>
21
- 569: <span class="ruby-keyword kw">else</span>
22
- 570: <span class="ruby-keyword kw">begin</span>
23
- 571: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req</span>
24
- 572: <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">&quot;REQUEST_URI&quot;</span>],<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
25
- 573: <span class="ruby-keyword kw">else</span>
26
- 574: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
27
- 575: <span class="ruby-keyword kw">end</span>
28
- 576: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">details</span>
29
- 577: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">reset</span>
30
- 578: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
31
- 579: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;Error accessing file: #{details}&quot;</span>
32
- 580: <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</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>)
33
- 581: <span class="ruby-keyword kw">end</span>
34
- 582: <span class="ruby-keyword kw">end</span>
35
- 583: <span class="ruby-keyword kw">end</span>
36
- 584: <span class="ruby-keyword kw">end</span></pre>
37
- </body>
38
- </html>
@@ -1,18 +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>add_mime_type (Mongrel::DirHandler)</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 588</span>
14
- 588: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">DirHandler</span><span class="ruby-operator">::</span><span class="ruby-identifier">add_mime_type</span>(<span class="ruby-identifier">extension</span>, <span class="ruby-identifier">type</span>)
15
- 589: <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">extension</span>] = <span class="ruby-identifier">type</span>
16
- 590: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,171 +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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Class: Mongrel::Error404Handler</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::Error404Handler</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
- <a href="HttpHandler.html">
69
- HttpHandler
70
- </a>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
-
79
-
80
-
81
- <div id="contextContent">
82
-
83
- <div id="description">
84
- <p>
85
- The server normally returns a 404 response if a URI is requested, but it
86
- also returns a lame empty message. This lets you do a 404 response with a
87
- custom message for special URIs.
88
- </p>
89
-
90
- </div>
91
-
92
-
93
- </div>
94
-
95
- <div id="method-list">
96
- <h3 class="section-bar">Methods</h3>
97
-
98
- <div class="name-list">
99
- <a href="#M000056">new</a>&nbsp;&nbsp;
100
- <a href="#M000057">process</a>&nbsp;&nbsp;
101
- </div>
102
- </div>
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
- <!-- if method_list -->
119
- <div id="methods">
120
- <h3 class="section-bar">Public Class methods</h3>
121
-
122
- <div id="method-M000056" class="method-detail">
123
- <a name="M000056"></a>
124
-
125
- <div class="method-heading">
126
- <a href="Error404Handler.src/M000056.html" target="Code" class="method-signature"
127
- onclick="popupCode('Error404Handler.src/M000056.html');return false;">
128
- <span class="method-name">new</span><span class="method-args">(msg)</span>
129
- </a>
130
- </div>
131
-
132
- <div class="method-description">
133
- <p>
134
- Sets the message to return. This is constructed once for the handler so
135
- it&#8217;s pretty efficient.
136
- </p>
137
- </div>
138
- </div>
139
-
140
- <h3 class="section-bar">Public Instance methods</h3>
141
-
142
- <div id="method-M000057" class="method-detail">
143
- <a name="M000057"></a>
144
-
145
- <div class="method-heading">
146
- <a href="Error404Handler.src/M000057.html" target="Code" class="method-signature"
147
- onclick="popupCode('Error404Handler.src/M000057.html');return false;">
148
- <span class="method-name">process</span><span class="method-args">(request, response)</span>
149
- </a>
150
- </div>
151
-
152
- <div class="method-description">
153
- <p>
154
- Just kicks back the standard 404 response with your special message.
155
- </p>
156
- </div>
157
- </div>
158
-
159
-
160
- </div>
161
-
162
-
163
- </div>
164
-
165
-
166
- <div id="validator-badges">
167
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
168
- </div>
169
-
170
- </body>
171
- </html>
@@ -1,18 +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>new (Mongrel::Error404Handler)</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 434</span>
14
- 434: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
15
- 435: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
16
- 436: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,18 +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 (Mongrel::Error404Handler)</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 439</span>
14
- 439: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
15
- 440: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@response</span>)
16
- 441: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,17 +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 (Mongrel::HttpHandler)</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 279</span>
14
- 279: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
15
- 280: <span class="ruby-keyword kw">end</span></pre>
16
- </body>
17
- </html>
@@ -1,31 +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>new (Mongrel::HttpRequest)</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 145</span>
14
- 145: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">initial_body</span>, <span class="ruby-identifier">socket</span>)
15
- 146: <span class="ruby-ivar">@body</span> = <span class="ruby-identifier">initial_body</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
16
- 147: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
17
- 148: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
18
- 149:
19
- 150: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
20
- 151: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
21
- 152: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_TYPE</span>]
22
- 153:
23
- 154: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span>
24
- 155: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
25
- 156: <span class="ruby-identifier">clen</span> = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span>
26
- 157: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">clen</span>
27
- 158: <span class="ruby-ivar">@body</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">clen</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span>)
28
- 159: <span class="ruby-keyword kw">end</span>
29
- 160: <span class="ruby-keyword kw">end</span></pre>
30
- </body>
31
- </html>
@@ -1,20 +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>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 266</span>
14
- 266: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finished</span>
15
- 267: <span class="ruby-identifier">send_status</span>
16
- 268: <span class="ruby-identifier">send_header</span>
17
- 269: <span class="ruby-identifier">send_body</span>
18
- 270: <span class="ruby-keyword kw">end</span></pre>
19
- </body>
20
- </html>
@@ -1,38 +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>new (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 320</span>
14
- 320: <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">20</span>, <span class="ruby-identifier">timeout</span>=<span class="ruby-value">120</span>)
15
- 321: <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
- 322:
17
- 323: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span>
18
- 324: <span class="ruby-ivar">@req_queue</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
19
- 325: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
20
- 326: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
21
- 327: <span class="ruby-ivar">@num_processors</span> = <span class="ruby-identifier">num_processors</span>
22
- 328: <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
23
- 329:
24
- 330: <span class="ruby-ivar">@num_processors</span>.<span class="ruby-identifier">times</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
25
- 331: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@req_queue</span>.<span class="ruby-identifier">deq</span>
26
- 332: <span class="ruby-keyword kw">begin</span>
27
- 333: <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@timeout</span>) <span class="ruby-keyword kw">do</span>
28
- 334: <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
29
- 335: <span class="ruby-keyword kw">end</span>
30
- 336: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
31
- 337: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;WARNING: Request took longer than #@timeout second timeout&quot;</span>
32
- 338: <span class="ruby-keyword kw">end</span>
33
- 339: <span class="ruby-keyword kw">end</span>
34
- 340: <span class="ruby-keyword kw">end</span>
35
- 341: }
36
- 342: <span class="ruby-keyword kw">end</span></pre>
37
- </body>
38
- </html>