mongrel 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/README +28 -1
  2. data/Rakefile +2 -2
  3. data/bin/mongrel_rails +102 -65
  4. data/bin/mongrel_rails_service +16 -7
  5. data/bin/mongrel_rails_svc +184 -87
  6. data/doc/rdoc/classes/Mongrel.html +1 -0
  7. data/doc/rdoc/classes/Mongrel/Const.html +3 -3
  8. data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
  9. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000028.html → M000014.html} +4 -4
  10. data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000029.html → M000015.html} +7 -7
  11. data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
  12. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000015.html → M000001.html} +0 -0
  13. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000016.html → M000002.html} +0 -0
  14. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000017.html → M000003.html} +0 -0
  15. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000018.html → M000004.html} +0 -0
  16. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000019.html → M000005.html} +0 -0
  17. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000020.html → M000006.html} +0 -0
  18. data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000021.html → M000007.html} +0 -0
  19. data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
  20. data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000041.html → M000029.html} +25 -25
  21. data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
  22. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000034.html → M000016.html} +7 -7
  23. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000035.html → M000017.html} +6 -6
  24. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000036.html → M000018.html} +5 -5
  25. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000037.html → M000019.html} +5 -5
  26. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000038.html → M000020.html} +6 -6
  27. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000039.html → M000021.html} +6 -6
  28. data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000040.html → M000022.html} +6 -6
  29. data/doc/rdoc/classes/Mongrel/HttpServer.html +34 -35
  30. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000008.html +36 -0
  31. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000023.html → M000009.html} +43 -43
  32. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000024.html → M000010.html} +31 -31
  33. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000025.html → M000011.html} +4 -4
  34. data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000026.html → M000012.html} +4 -4
  35. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000013.html +23 -0
  36. data/doc/rdoc/classes/{FactoryError.html → Mongrel/TimeoutWorker.html} +7 -34
  37. data/doc/rdoc/classes/Mongrel/URIClassifier.html +63 -20
  38. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000023.html +18 -0
  39. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000024.html +18 -0
  40. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000030.html → M000025.html} +0 -0
  41. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000031.html → M000026.html} +0 -0
  42. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000032.html → M000027.html} +0 -0
  43. data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000033.html → M000028.html} +0 -0
  44. data/doc/rdoc/created.rid +1 -1
  45. data/doc/rdoc/files/README.html +35 -2
  46. data/doc/rdoc/files/lib/mongrel_rb.html +4 -1
  47. data/doc/rdoc/fr_class_index.html +1 -2
  48. data/doc/rdoc/fr_file_index.html +0 -1
  49. data/doc/rdoc/fr_method_index.html +29 -41
  50. data/lib/mongrel.rb +37 -9
  51. data/lib/mongrel/command.rb +13 -34
  52. data/lib/mongrel/plugins.rb +156 -0
  53. data/lib/mongrel/rails.rb +70 -0
  54. data/test/plugins/commands/test1.rb +19 -0
  55. data/test/test_plugins.rb +45 -0
  56. data/test/test_uriclassifier.rb +5 -1
  57. metadata +38 -49
  58. data/doc/rdoc/classes/FactoryError.src/M000001.html +0 -23
  59. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000022.html +0 -33
  60. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000027.html +0 -19
  61. data/doc/rdoc/classes/PluginFactory.html +0 -409
  62. data/doc/rdoc/classes/PluginFactory.src/M000002.html +0 -18
  63. data/doc/rdoc/classes/PluginFactory.src/M000003.html +0 -18
  64. data/doc/rdoc/classes/PluginFactory.src/M000004.html +0 -22
  65. data/doc/rdoc/classes/PluginFactory.src/M000005.html +0 -22
  66. data/doc/rdoc/classes/PluginFactory.src/M000006.html +0 -33
  67. data/doc/rdoc/classes/PluginFactory.src/M000007.html +0 -32
  68. data/doc/rdoc/classes/PluginFactory.src/M000008.html +0 -18
  69. data/doc/rdoc/classes/PluginFactory.src/M000009.html +0 -24
  70. data/doc/rdoc/classes/PluginFactory.src/M000010.html +0 -40
  71. data/doc/rdoc/classes/PluginFactory.src/M000011.html +0 -39
  72. data/doc/rdoc/classes/PluginFactory.src/M000012.html +0 -24
  73. data/doc/rdoc/classes/PluginFactory.src/M000013.html +0 -70
  74. data/doc/rdoc/classes/PluginFactory.src/M000014.html +0 -34
  75. data/doc/rdoc/files/lib/pluginfactory_rb.html +0 -132
  76. data/lib/pluginfactory.rb +0 -384
@@ -107,6 +107,7 @@ Class <a href="Mongrel/HttpRequest.html" class="link">Mongrel::HttpRequest</a><b
107
107
  Class <a href="Mongrel/HttpResponse.html" class="link">Mongrel::HttpResponse</a><br />
108
108
  Class <a href="Mongrel/HttpServer.html" class="link">Mongrel::HttpServer</a><br />
109
109
  Class <a href="Mongrel/StopServer.html" class="link">Mongrel::StopServer</a><br />
110
+ Class <a href="Mongrel/TimeoutWorker.html" class="link">Mongrel::TimeoutWorker</a><br />
110
111
  Class <a href="Mongrel/URIClassifier.html" class="link">Mongrel::URIClassifier</a><br />
111
112
 
112
113
  </div>
@@ -230,7 +230,7 @@ DNS resolves. It is only here for completeness for the CGI standard.
230
230
  <td width="3em">&nbsp;</td>
231
231
  <td class="context-item-desc">
232
232
  The name/host of our server as given by the <a
233
- href="HttpServer.html#M000022">HttpServer.new</a>(host,port) call.
233
+ href="HttpServer.html#M000008">HttpServer.new</a>(host,port) call.
234
234
 
235
235
  </td>
236
236
  </tr>
@@ -241,7 +241,7 @@ href="HttpServer.html#M000022">HttpServer.new</a>(host,port) call.
241
241
  <td width="3em">&nbsp;</td>
242
242
  <td class="context-item-desc">
243
243
  The port of our server as given by the <a
244
- href="HttpServer.html#M000022">HttpServer.new</a>(host,port) call.
244
+ href="HttpServer.html#M000008">HttpServer.new</a>(host,port) call.
245
245
 
246
246
  </td>
247
247
  </tr>
@@ -290,7 +290,7 @@ href="../Mongrel.html">Mongrel</a> man).
290
290
  <tr class="top-aligned-row context-row">
291
291
  <td class="context-item-name">MONGREL_VERSION</td>
292
292
  <td>=</td>
293
- <td class="context-item-value">'Mongrel 0.3.6'</td>
293
+ <td class="context-item-value">'Mongrel 0.3.7'</td>
294
294
  <td width="3em">&nbsp;</td>
295
295
  <td class="context-item-desc">
296
296
  Current <a href="../Mongrel.html">Mongrel</a> version (used for
@@ -101,8 +101,8 @@ there.
101
101
  <h3 class="section-bar">Methods</h3>
102
102
 
103
103
  <div class="name-list">
104
- <a href="#M000029">[]=</a>&nbsp;&nbsp;
105
- <a href="#M000028">new</a>&nbsp;&nbsp;
104
+ <a href="#M000015">[]=</a>&nbsp;&nbsp;
105
+ <a href="#M000014">new</a>&nbsp;&nbsp;
106
106
  </div>
107
107
  </div>
108
108
 
@@ -137,12 +137,12 @@ there.
137
137
  <div id="methods">
138
138
  <h3 class="section-bar">Public Class methods</h3>
139
139
 
140
- <div id="method-M000028" class="method-detail">
141
- <a name="M000028"></a>
140
+ <div id="method-M000014" class="method-detail">
141
+ <a name="M000014"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="HeaderOut.src/M000028.html" target="Code" class="method-signature"
145
- onclick="popupCode('HeaderOut.src/M000028.html');return false;">
144
+ <a href="HeaderOut.src/M000014.html" target="Code" class="method-signature"
145
+ onclick="popupCode('HeaderOut.src/M000014.html');return false;">
146
146
  <span class="method-name">new</span><span class="method-args">(out)</span>
147
147
  </a>
148
148
  </div>
@@ -153,12 +153,12 @@ there.
153
153
 
154
154
  <h3 class="section-bar">Public Instance methods</h3>
155
155
 
156
- <div id="method-M000029" class="method-detail">
157
- <a name="M000029"></a>
156
+ <div id="method-M000015" class="method-detail">
157
+ <a name="M000015"></a>
158
158
 
159
159
  <div class="method-heading">
160
- <a href="HeaderOut.src/M000029.html" target="Code" class="method-signature"
161
- onclick="popupCode('HeaderOut.src/M000029.html');return false;">
160
+ <a href="HeaderOut.src/M000015.html" target="Code" class="method-signature"
161
+ onclick="popupCode('HeaderOut.src/M000015.html');return false;">
162
162
  <span class="method-name">[]=</span><span class="method-args">(key,value)</span>
163
163
  </a>
164
164
  </div>
@@ -10,9 +10,9 @@
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 188</span>
14
- 188: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">out</span>)
15
- 189: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">out</span>
16
- 190: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 210</span>
14
+ 210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">out</span>)
15
+ 211: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">out</span>
16
+ 212: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,12 +10,12 @@
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 193</span>
14
- 193: <span class="ruby-keyword kw">def</span><span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span>)
15
- 194: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">key</span>)
16
- 195: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;: &quot;</span>)
17
- 196: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">value</span>)
18
- 197: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\r\n&quot;</span>)
19
- 198: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 215</span>
14
+ 215: <span class="ruby-keyword kw">def</span><span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span>)
15
+ 216: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">key</span>)
16
+ 217: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;: &quot;</span>)
17
+ 218: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">value</span>)
18
+ 219: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\r\n&quot;</span>)
19
+ 220: <span class="ruby-keyword kw">end</span></pre>
20
20
  </body>
21
21
  </html>
@@ -86,13 +86,13 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000019">error?</a>&nbsp;&nbsp;
90
- <a href="#M000018">execute</a>&nbsp;&nbsp;
91
- <a href="#M000017">finish</a>&nbsp;&nbsp;
92
- <a href="#M000020">finished?</a>&nbsp;&nbsp;
93
- <a href="#M000015">new</a>&nbsp;&nbsp;
94
- <a href="#M000021">nread</a>&nbsp;&nbsp;
95
- <a href="#M000016">reset</a>&nbsp;&nbsp;
89
+ <a href="#M000005">error?</a>&nbsp;&nbsp;
90
+ <a href="#M000004">execute</a>&nbsp;&nbsp;
91
+ <a href="#M000003">finish</a>&nbsp;&nbsp;
92
+ <a href="#M000006">finished?</a>&nbsp;&nbsp;
93
+ <a href="#M000001">new</a>&nbsp;&nbsp;
94
+ <a href="#M000007">nread</a>&nbsp;&nbsp;
95
+ <a href="#M000002">reset</a>&nbsp;&nbsp;
96
96
  </div>
97
97
  </div>
98
98
 
@@ -114,12 +114,12 @@
114
114
  <div id="methods">
115
115
  <h3 class="section-bar">Public Class methods</h3>
116
116
 
117
- <div id="method-M000015" class="method-detail">
118
- <a name="M000015"></a>
117
+ <div id="method-M000001" class="method-detail">
118
+ <a name="M000001"></a>
119
119
 
120
120
  <div class="method-heading">
121
- <a href="HttpParser.src/M000015.html" target="Code" class="method-signature"
122
- onclick="popupCode('HttpParser.src/M000015.html');return false;">
121
+ <a href="HttpParser.src/M000001.html" target="Code" class="method-signature"
122
+ onclick="popupCode('HttpParser.src/M000001.html');return false;">
123
123
  <span class="method-name">parser.new &rarr; parser<br />
124
124
  </span>
125
125
  </a>
@@ -134,12 +134,12 @@ Creates a new parser.
134
134
 
135
135
  <h3 class="section-bar">Public Instance methods</h3>
136
136
 
137
- <div id="method-M000019" class="method-detail">
138
- <a name="M000019"></a>
137
+ <div id="method-M000005" class="method-detail">
138
+ <a name="M000005"></a>
139
139
 
140
140
  <div class="method-heading">
141
- <a href="HttpParser.src/M000019.html" target="Code" class="method-signature"
142
- onclick="popupCode('HttpParser.src/M000019.html');return false;">
141
+ <a href="HttpParser.src/M000005.html" target="Code" class="method-signature"
142
+ onclick="popupCode('HttpParser.src/M000005.html');return false;">
143
143
  <span class="method-name">parser.error? &rarr; true/false<br />
144
144
  </span>
145
145
  </a>
@@ -152,12 +152,12 @@ Tells you whether the parser is in an error state.
152
152
  </div>
153
153
  </div>
154
154
 
155
- <div id="method-M000018" class="method-detail">
156
- <a name="M000018"></a>
155
+ <div id="method-M000004" class="method-detail">
156
+ <a name="M000004"></a>
157
157
 
158
158
  <div class="method-heading">
159
- <a href="HttpParser.src/M000018.html" target="Code" class="method-signature"
160
- onclick="popupCode('HttpParser.src/M000018.html');return false;">
159
+ <a href="HttpParser.src/M000004.html" target="Code" class="method-signature"
160
+ onclick="popupCode('HttpParser.src/M000004.html');return false;">
161
161
  <span class="method-name">parser.execute(req_hash, data) &rarr; Integer<br />
162
162
  </span>
163
163
  </a>
@@ -180,12 +180,12 @@ handling block.
180
180
  </div>
181
181
  </div>
182
182
 
183
- <div id="method-M000017" class="method-detail">
184
- <a name="M000017"></a>
183
+ <div id="method-M000003" class="method-detail">
184
+ <a name="M000003"></a>
185
185
 
186
186
  <div class="method-heading">
187
- <a href="HttpParser.src/M000017.html" target="Code" class="method-signature"
188
- onclick="popupCode('HttpParser.src/M000017.html');return false;">
187
+ <a href="HttpParser.src/M000003.html" target="Code" class="method-signature"
188
+ onclick="popupCode('HttpParser.src/M000003.html');return false;">
189
189
  <span class="method-name">parser.finish &rarr; true/false<br />
190
190
  </span>
191
191
  </a>
@@ -199,12 +199,12 @@ You should call reset after finish it or bad things will happen.
199
199
  </div>
200
200
  </div>
201
201
 
202
- <div id="method-M000020" class="method-detail">
203
- <a name="M000020"></a>
202
+ <div id="method-M000006" class="method-detail">
203
+ <a name="M000006"></a>
204
204
 
205
205
  <div class="method-heading">
206
- <a href="HttpParser.src/M000020.html" target="Code" class="method-signature"
207
- onclick="popupCode('HttpParser.src/M000020.html');return false;">
206
+ <a href="HttpParser.src/M000006.html" target="Code" class="method-signature"
207
+ onclick="popupCode('HttpParser.src/M000006.html');return false;">
208
208
  <span class="method-name">parser.finished? &rarr; true/false<br />
209
209
  </span>
210
210
  </a>
@@ -217,12 +217,12 @@ Tells you whether the parser is finished or not and in a good state.
217
217
  </div>
218
218
  </div>
219
219
 
220
- <div id="method-M000021" class="method-detail">
221
- <a name="M000021"></a>
220
+ <div id="method-M000007" class="method-detail">
221
+ <a name="M000007"></a>
222
222
 
223
223
  <div class="method-heading">
224
- <a href="HttpParser.src/M000021.html" target="Code" class="method-signature"
225
- onclick="popupCode('HttpParser.src/M000021.html');return false;">
224
+ <a href="HttpParser.src/M000007.html" target="Code" class="method-signature"
225
+ onclick="popupCode('HttpParser.src/M000007.html');return false;">
226
226
  <span class="method-name">parser.nread &rarr; Integer<br />
227
227
  </span>
228
228
  </a>
@@ -237,12 +237,12 @@ execute is called.
237
237
  </div>
238
238
  </div>
239
239
 
240
- <div id="method-M000016" class="method-detail">
241
- <a name="M000016"></a>
240
+ <div id="method-M000002" class="method-detail">
241
+ <a name="M000002"></a>
242
242
 
243
243
  <div class="method-heading">
244
- <a href="HttpParser.src/M000016.html" target="Code" class="method-signature"
245
- onclick="popupCode('HttpParser.src/M000016.html');return false;">
244
+ <a href="HttpParser.src/M000002.html" target="Code" class="method-signature"
245
+ onclick="popupCode('HttpParser.src/M000002.html');return false;">
246
246
  <span class="method-name">parser.reset &rarr; nil<br />
247
247
  </span>
248
248
  </a>
@@ -103,7 +103,7 @@ efficiently handling large file uploads.
103
103
  <h3 class="section-bar">Methods</h3>
104
104
 
105
105
  <div class="name-list">
106
- <a href="#M000041">new</a>&nbsp;&nbsp;
106
+ <a href="#M000029">new</a>&nbsp;&nbsp;
107
107
  </div>
108
108
  </div>
109
109
 
@@ -143,12 +143,12 @@ efficiently handling large file uploads.
143
143
  <div id="methods">
144
144
  <h3 class="section-bar">Public Class methods</h3>
145
145
 
146
- <div id="method-M000041" class="method-detail">
147
- <a name="M000041"></a>
146
+ <div id="method-M000029" class="method-detail">
147
+ <a name="M000029"></a>
148
148
 
149
149
  <div class="method-heading">
150
- <a href="HttpRequest.src/M000041.html" target="Code" class="method-signature"
151
- onclick="popupCode('HttpRequest.src/M000041.html');return false;">
150
+ <a href="HttpRequest.src/M000029.html" target="Code" class="method-signature"
151
+ onclick="popupCode('HttpRequest.src/M000029.html');return false;">
152
152
  <span class="method-name">new</span><span class="method-args">(params, initial_body, socket)</span>
153
153
  </a>
154
154
  </div>
@@ -10,30 +10,30 @@
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 151</span>
14
- 151: <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
- 152: <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
- 153: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
17
- 154: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
18
- 155:
19
- 156: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
20
- 157: <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
- 158: <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-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-keyword kw">if</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
- 159: <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>
23
- 160: <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">socket</span>.<span class="ruby-identifier">peeraddr</span>[<span class="ruby-value">3</span>]
24
- 161: <span class="ruby-identifier">host</span>,<span class="ruby-identifier">port</span> = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_HOST</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;:&quot;</span>)
25
- 162: <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-identifier">host</span>
26
- 163: <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-identifier">port</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">port</span>
27
- 164: <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>
28
- 165: <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>
29
- 166:
30
- 167:
31
- 168: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span>
32
- 169: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
33
- 170: <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>
34
- 171: <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>
35
- 172: <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>)
36
- 173: <span class="ruby-keyword kw">end</span>
37
- 174: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 173</span>
14
+ 173: <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
+ 174: <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
+ 175: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
17
+ 176: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
18
+ 177:
19
+ 178: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
20
+ 179: <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
+ 180: <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-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-keyword kw">if</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
+ 181: <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>
23
+ 182: <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">socket</span>.<span class="ruby-identifier">peeraddr</span>[<span class="ruby-value">3</span>]
24
+ 183: <span class="ruby-identifier">host</span>,<span class="ruby-identifier">port</span> = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_HOST</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;:&quot;</span>)
25
+ 184: <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-identifier">host</span>
26
+ 185: <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-identifier">port</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">port</span>
27
+ 186: <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>
28
+ 187: <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>
29
+ 188:
30
+ 189:
31
+ 190: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span>
32
+ 191: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
33
+ 192: <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>
34
+ 193: <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>
35
+ 194: <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>)
36
+ 195: <span class="ruby-keyword kw">end</span>
37
+ 196: <span class="ruby-keyword kw">end</span></pre>
38
38
  </body>
39
39
  </html>
@@ -94,7 +94,7 @@ The parameter to start is the response code&#8212;which <a
94
94
  href="../Mongrel.html">Mongrel</a> will translate for you based on
95
95
  HTTP_STATUS_CODES. The head parameter is how you write custom headers. The
96
96
  out parameter is where you write your body. The default status code for <a
97
- href="HttpResponse.html#M000035">HttpResponse.start</a> is 200 so the above
97
+ href="HttpResponse.html#M000017">HttpResponse.start</a> is 200 so the above
98
98
  example is redundant.
99
99
  </p>
100
100
  <p>
@@ -131,13 +131,13 @@ will write this for you based on the out length.
131
131
  <h3 class="section-bar">Methods</h3>
132
132
 
133
133
  <div class="name-list">
134
- <a href="#M000040">finished</a>&nbsp;&nbsp;
135
- <a href="#M000034">new</a>&nbsp;&nbsp;
136
- <a href="#M000036">reset</a>&nbsp;&nbsp;
137
- <a href="#M000039">send_body</a>&nbsp;&nbsp;
138
- <a href="#M000038">send_header</a>&nbsp;&nbsp;
139
- <a href="#M000037">send_status</a>&nbsp;&nbsp;
140
- <a href="#M000035">start</a>&nbsp;&nbsp;
134
+ <a href="#M000022">finished</a>&nbsp;&nbsp;
135
+ <a href="#M000016">new</a>&nbsp;&nbsp;
136
+ <a href="#M000018">reset</a>&nbsp;&nbsp;
137
+ <a href="#M000021">send_body</a>&nbsp;&nbsp;
138
+ <a href="#M000020">send_header</a>&nbsp;&nbsp;
139
+ <a href="#M000019">send_status</a>&nbsp;&nbsp;
140
+ <a href="#M000017">start</a>&nbsp;&nbsp;
141
141
  </div>
142
142
  </div>
143
143
 
@@ -192,12 +192,12 @@ will write this for you based on the out length.
192
192
  <div id="methods">
193
193
  <h3 class="section-bar">Public Class methods</h3>
194
194
 
195
- <div id="method-M000034" class="method-detail">
196
- <a name="M000034"></a>
195
+ <div id="method-M000016" class="method-detail">
196
+ <a name="M000016"></a>
197
197
 
198
198
  <div class="method-heading">
199
- <a href="HttpResponse.src/M000034.html" target="Code" class="method-signature"
200
- onclick="popupCode('HttpResponse.src/M000034.html');return false;">
199
+ <a href="HttpResponse.src/M000016.html" target="Code" class="method-signature"
200
+ onclick="popupCode('HttpResponse.src/M000016.html');return false;">
201
201
  <span class="method-name">new</span><span class="method-args">(socket)</span>
202
202
  </a>
203
203
  </div>
@@ -208,12 +208,12 @@ will write this for you based on the out length.
208
208
 
209
209
  <h3 class="section-bar">Public Instance methods</h3>
210
210
 
211
- <div id="method-M000040" class="method-detail">
212
- <a name="M000040"></a>
211
+ <div id="method-M000022" class="method-detail">
212
+ <a name="M000022"></a>
213
213
 
214
214
  <div class="method-heading">
215
- <a href="HttpResponse.src/M000040.html" target="Code" class="method-signature"
216
- onclick="popupCode('HttpResponse.src/M000040.html');return false;">
215
+ <a href="HttpResponse.src/M000022.html" target="Code" class="method-signature"
216
+ onclick="popupCode('HttpResponse.src/M000022.html');return false;">
217
217
  <span class="method-name">finished</span><span class="method-args">()</span>
218
218
  </a>
219
219
  </div>
@@ -226,12 +226,12 @@ the proper format to make an HTTP/1.1 response.
226
226
  </div>
227
227
  </div>
228
228
 
229
- <div id="method-M000036" class="method-detail">
230
- <a name="M000036"></a>
229
+ <div id="method-M000018" class="method-detail">
230
+ <a name="M000018"></a>
231
231
 
232
232
  <div class="method-heading">
233
- <a href="HttpResponse.src/M000036.html" target="Code" class="method-signature"
234
- onclick="popupCode('HttpResponse.src/M000036.html');return false;">
233
+ <a href="HttpResponse.src/M000018.html" target="Code" class="method-signature"
234
+ onclick="popupCode('HttpResponse.src/M000018.html');return false;">
235
235
  <span class="method-name">reset</span><span class="method-args">()</span>
236
236
  </a>
237
237
  </div>
@@ -244,12 +244,12 @@ to write an alternative response.
244
244
  </div>
245
245
  </div>
246
246
 
247
- <div id="method-M000039" class="method-detail">
248
- <a name="M000039"></a>
247
+ <div id="method-M000021" class="method-detail">
248
+ <a name="M000021"></a>
249
249
 
250
250
  <div class="method-heading">
251
- <a href="HttpResponse.src/M000039.html" target="Code" class="method-signature"
252
- onclick="popupCode('HttpResponse.src/M000039.html');return false;">
251
+ <a href="HttpResponse.src/M000021.html" target="Code" class="method-signature"
252
+ onclick="popupCode('HttpResponse.src/M000021.html');return false;">
253
253
  <span class="method-name">send_body</span><span class="method-args">()</span>
254
254
  </a>
255
255
  </div>
@@ -258,12 +258,12 @@ to write an alternative response.
258
258
  </div>
259
259
  </div>
260
260
 
261
- <div id="method-M000038" class="method-detail">
262
- <a name="M000038"></a>
261
+ <div id="method-M000020" class="method-detail">
262
+ <a name="M000020"></a>
263
263
 
264
264
  <div class="method-heading">
265
- <a href="HttpResponse.src/M000038.html" target="Code" class="method-signature"
266
- onclick="popupCode('HttpResponse.src/M000038.html');return false;">
265
+ <a href="HttpResponse.src/M000020.html" target="Code" class="method-signature"
266
+ onclick="popupCode('HttpResponse.src/M000020.html');return false;">
267
267
  <span class="method-name">send_header</span><span class="method-args">()</span>
268
268
  </a>
269
269
  </div>
@@ -272,12 +272,12 @@ to write an alternative response.
272
272
  </div>
273
273
  </div>
274
274
 
275
- <div id="method-M000037" class="method-detail">
276
- <a name="M000037"></a>
275
+ <div id="method-M000019" class="method-detail">
276
+ <a name="M000019"></a>
277
277
 
278
278
  <div class="method-heading">
279
- <a href="HttpResponse.src/M000037.html" target="Code" class="method-signature"
280
- onclick="popupCode('HttpResponse.src/M000037.html');return false;">
279
+ <a href="HttpResponse.src/M000019.html" target="Code" class="method-signature"
280
+ onclick="popupCode('HttpResponse.src/M000019.html');return false;">
281
281
  <span class="method-name">send_status</span><span class="method-args">()</span>
282
282
  </a>
283
283
  </div>
@@ -286,12 +286,12 @@ to write an alternative response.
286
286
  </div>
287
287
  </div>
288
288
 
289
- <div id="method-M000035" class="method-detail">
290
- <a name="M000035"></a>
289
+ <div id="method-M000017" class="method-detail">
290
+ <a name="M000017"></a>
291
291
 
292
292
  <div class="method-heading">
293
- <a href="HttpResponse.src/M000035.html" target="Code" class="method-signature"
294
- onclick="popupCode('HttpResponse.src/M000035.html');return false;">
293
+ <a href="HttpResponse.src/M000017.html" target="Code" class="method-signature"
294
+ onclick="popupCode('HttpResponse.src/M000017.html');return false;">
295
295
  <span class="method-name">start</span><span class="method-args">(status=200) {|@header, @body| ...}</span>
296
296
  </a>
297
297
  </div>