mongrel 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +28 -1
- data/Rakefile +2 -2
- data/bin/mongrel_rails +102 -65
- data/bin/mongrel_rails_service +16 -7
- data/bin/mongrel_rails_svc +184 -87
- data/doc/rdoc/classes/Mongrel.html +1 -0
- data/doc/rdoc/classes/Mongrel/Const.html +3 -3
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000028.html → M000014.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000029.html → M000015.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000015.html → M000001.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000016.html → M000002.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000017.html → M000003.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000018.html → M000004.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000019.html → M000005.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000020.html → M000006.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000021.html → M000007.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000041.html → M000029.html} +25 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000034.html → M000016.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000035.html → M000017.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000036.html → M000018.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000037.html → M000019.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000038.html → M000020.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000039.html → M000021.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000040.html → M000022.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpServer.html +34 -35
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000008.html +36 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000023.html → M000009.html} +43 -43
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000024.html → M000010.html} +31 -31
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000025.html → M000011.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000026.html → M000012.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000013.html +23 -0
- data/doc/rdoc/classes/{FactoryError.html → Mongrel/TimeoutWorker.html} +7 -34
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +63 -20
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000023.html +18 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000024.html +18 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000030.html → M000025.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000031.html → M000026.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000032.html → M000027.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000033.html → M000028.html} +0 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +35 -2
- data/doc/rdoc/files/lib/mongrel_rb.html +4 -1
- data/doc/rdoc/fr_class_index.html +1 -2
- data/doc/rdoc/fr_file_index.html +0 -1
- data/doc/rdoc/fr_method_index.html +29 -41
- data/lib/mongrel.rb +37 -9
- data/lib/mongrel/command.rb +13 -34
- data/lib/mongrel/plugins.rb +156 -0
- data/lib/mongrel/rails.rb +70 -0
- data/test/plugins/commands/test1.rb +19 -0
- data/test/test_plugins.rb +45 -0
- data/test/test_uriclassifier.rb +5 -1
- metadata +38 -49
- data/doc/rdoc/classes/FactoryError.src/M000001.html +0 -23
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000022.html +0 -33
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000027.html +0 -19
- data/doc/rdoc/classes/PluginFactory.html +0 -409
- data/doc/rdoc/classes/PluginFactory.src/M000002.html +0 -18
- data/doc/rdoc/classes/PluginFactory.src/M000003.html +0 -18
- data/doc/rdoc/classes/PluginFactory.src/M000004.html +0 -22
- data/doc/rdoc/classes/PluginFactory.src/M000005.html +0 -22
- data/doc/rdoc/classes/PluginFactory.src/M000006.html +0 -33
- data/doc/rdoc/classes/PluginFactory.src/M000007.html +0 -32
- data/doc/rdoc/classes/PluginFactory.src/M000008.html +0 -18
- data/doc/rdoc/classes/PluginFactory.src/M000009.html +0 -24
- data/doc/rdoc/classes/PluginFactory.src/M000010.html +0 -40
- data/doc/rdoc/classes/PluginFactory.src/M000011.html +0 -39
- data/doc/rdoc/classes/PluginFactory.src/M000012.html +0 -24
- data/doc/rdoc/classes/PluginFactory.src/M000013.html +0 -70
- data/doc/rdoc/classes/PluginFactory.src/M000014.html +0 -34
- data/doc/rdoc/files/lib/pluginfactory_rb.html +0 -132
- 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"> </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#
|
|
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"> </td>
|
|
242
242
|
<td class="context-item-desc">
|
|
243
243
|
The port of our server as given by the <a
|
|
244
|
-
href="HttpServer.html#
|
|
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.
|
|
293
|
+
<td class="context-item-value">'Mongrel 0.3.7'</td>
|
|
294
294
|
<td width="3em"> </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="#
|
|
105
|
-
<a href="#
|
|
104
|
+
<a href="#M000015">[]=</a>
|
|
105
|
+
<a href="#M000014">new</a>
|
|
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-
|
|
141
|
-
<a name="
|
|
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/
|
|
145
|
-
onclick="popupCode('HeaderOut.src/
|
|
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-
|
|
157
|
-
<a name="
|
|
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/
|
|
161
|
-
onclick="popupCode('HeaderOut.src/
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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">": "</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">"\r\n"</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="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
89
|
+
<a href="#M000005">error?</a>
|
|
90
|
+
<a href="#M000004">execute</a>
|
|
91
|
+
<a href="#M000003">finish</a>
|
|
92
|
+
<a href="#M000006">finished?</a>
|
|
93
|
+
<a href="#M000001">new</a>
|
|
94
|
+
<a href="#M000007">nread</a>
|
|
95
|
+
<a href="#M000002">reset</a>
|
|
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-
|
|
118
|
-
<a name="
|
|
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/
|
|
122
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
138
|
-
<a name="
|
|
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/
|
|
142
|
-
onclick="popupCode('HttpParser.src/
|
|
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? → 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-
|
|
156
|
-
<a name="
|
|
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/
|
|
160
|
-
onclick="popupCode('HttpParser.src/
|
|
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) → 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-
|
|
184
|
-
<a name="
|
|
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/
|
|
188
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
203
|
-
<a name="
|
|
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/
|
|
207
|
-
onclick="popupCode('HttpParser.src/
|
|
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? → 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-
|
|
221
|
-
<a name="
|
|
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/
|
|
225
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → 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-
|
|
241
|
-
<a name="
|
|
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/
|
|
245
|
-
onclick="popupCode('HttpParser.src/
|
|
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 → nil<br />
|
|
247
247
|
</span>
|
|
248
248
|
</a>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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="#
|
|
106
|
+
<a href="#M000029">new</a>
|
|
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-
|
|
147
|
-
<a name="
|
|
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/
|
|
151
|
-
onclick="popupCode('HttpRequest.src/
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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">""</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">":"</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"><</span> <span class="ruby-identifier">clen</span>
|
|
35
|
+
194: <span class="ruby-ivar">@body</span> <span class="ruby-operator"><<</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—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#
|
|
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="#
|
|
135
|
-
<a href="#
|
|
136
|
-
<a href="#
|
|
137
|
-
<a href="#
|
|
138
|
-
<a href="#
|
|
139
|
-
<a href="#
|
|
140
|
-
<a href="#
|
|
134
|
+
<a href="#M000022">finished</a>
|
|
135
|
+
<a href="#M000016">new</a>
|
|
136
|
+
<a href="#M000018">reset</a>
|
|
137
|
+
<a href="#M000021">send_body</a>
|
|
138
|
+
<a href="#M000020">send_header</a>
|
|
139
|
+
<a href="#M000019">send_status</a>
|
|
140
|
+
<a href="#M000017">start</a>
|
|
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-
|
|
196
|
-
<a name="
|
|
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/
|
|
200
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
212
|
-
<a name="
|
|
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/
|
|
216
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
230
|
-
<a name="
|
|
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/
|
|
234
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
248
|
-
<a name="
|
|
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/
|
|
252
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
262
|
-
<a name="
|
|
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/
|
|
266
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
276
|
-
<a name="
|
|
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/
|
|
280
|
-
onclick="popupCode('HttpResponse.src/
|
|
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-
|
|
290
|
-
<a name="
|
|
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/
|
|
294
|
-
onclick="popupCode('HttpResponse.src/
|
|
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>
|