mongrel 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +38 -15
- data/bin/mongrel_rails +13 -11
- data/doc/rdoc/classes/Mongrel.html +6 -1
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000057.html +11 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000058.html +34 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000059.html +21 -6
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000054.html → M000060.html} +0 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000055.html → M000061.html} +0 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000056.html → M000062.html} +0 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000063.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000064.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000065.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +177 -0
- data/doc/rdoc/classes/Mongrel/Camping.src/M000019.html +22 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +165 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000020.html +18 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000021.html +27 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +50 -50
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000006.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000007.html +28 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000008.html +5 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000009.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000010.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000011.html +9 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000012.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000013.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000014.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000015.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000013.html → M000016.html} +6 -6
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000014.html → M000017.html} +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000015.html → M000018.html} +32 -32
- data/doc/rdoc/classes/Mongrel/Const.html +3 -3
- data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000023.html → M000029.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000024.html → M000030.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000025.html → M000031.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000026.html → M000032.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000027.html → M000033.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000028.html → M000034.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000060.html → M000066.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000061.html → M000067.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000035.html → M000041.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000036.html → M000042.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000037.html → M000043.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000022.html +6 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000017.html → M000023.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000018.html → M000024.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000019.html → M000025.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000020.html → M000026.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000021.html → M000027.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000016.html → M000028.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000062.html → M000068.html} +24 -24
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000044.html +8 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000039.html → M000045.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000040.html → M000046.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000041.html → M000047.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000042.html → M000048.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000043.html → M000049.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000050.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +33 -33
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000029.html → M000035.html} +22 -22
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000030.html → M000036.html} +43 -43
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000031.html → M000037.html} +34 -34
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000032.html → M000038.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000033.html → M000039.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000034.html → M000040.html} +9 -9
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000045.html → M000051.html} +4 -4
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000046.html → M000052.html} +4 -4
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000047.html → M000053.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000048.html → M000054.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000049.html → M000055.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000050.html → M000056.html} +0 -0
- data/doc/rdoc/classes/RailsHandler.html +30 -10
- data/doc/rdoc/classes/RailsHandler.src/{M000001.html → M000003.html} +8 -8
- data/doc/rdoc/classes/RailsHandler.src/{M000002.html → M000004.html} +34 -34
- data/doc/rdoc/classes/RailsHandler.src/M000005.html +23 -0
- data/doc/rdoc/classes/TCPServer.html +173 -0
- data/doc/rdoc/classes/TCPServer.src/M000001.html +19 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/lib/mongrel/camping_rb.html +108 -0
- data/doc/rdoc/files/lib/mongrel/command_rb.html +3 -2
- data/doc/rdoc/files/lib/mongrel/{plugins_rb.html → init_rb.html} +5 -4
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -1
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +109 -0
- data/doc/rdoc/files/lib/mongrel_rb.html +2 -2
- data/doc/rdoc/fr_class_index.html +3 -0
- data/doc/rdoc/fr_file_index.html +3 -1
- data/doc/rdoc/fr_method_index.html +68 -62
- data/examples/camping/blog.rb +22 -37
- data/examples/camping/tepee.rb +3 -23
- data/lib/mongrel.rb +3 -4
- data/lib/mongrel/camping.rb +64 -0
- data/lib/mongrel/command.rb +3 -2
- data/lib/mongrel/{plugins.rb → init.rb} +1 -1
- data/lib/mongrel/rails.rb +16 -6
- data/lib/mongrel/tcphack.rb +12 -0
- data/tools/rakehelp.rb +10 -12
- metadata +74 -58
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000051.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000052.html +0 -47
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000053.html +0 -34
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000003.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000004.html +0 -41
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000005.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000038.html +0 -21
@@ -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 211</span>
|
14
|
+
211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">out</span>)
|
15
|
+
212: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">out</span>
|
16
|
+
213: <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 216</span>
|
14
|
+
216: <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
|
+
217: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">key</span>)
|
16
|
+
218: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">": "</span>)
|
17
|
+
219: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">value</span>)
|
18
|
+
220: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"\r\n"</span>)
|
19
|
+
221: <span class="ruby-keyword kw">end</span></pre>
|
20
20
|
</body>
|
21
21
|
</html>
|
@@ -95,7 +95,7 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
|
|
95
95
|
<h3 class="section-bar">Methods</h3>
|
96
96
|
|
97
97
|
<div class="name-list">
|
98
|
-
<a href="#
|
98
|
+
<a href="#M000043">process</a>
|
99
99
|
</div>
|
100
100
|
</div>
|
101
101
|
|
@@ -117,12 +117,12 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
|
|
117
117
|
<div id="methods">
|
118
118
|
<h3 class="section-bar">Public Instance methods</h3>
|
119
119
|
|
120
|
-
<div id="method-
|
121
|
-
<a name="
|
120
|
+
<div id="method-M000043" class="method-detail">
|
121
|
+
<a name="M000043"></a>
|
122
122
|
|
123
123
|
<div class="method-heading">
|
124
|
-
<a href="HttpHandler.src/
|
125
|
-
onclick="popupCode('HttpHandler.src/
|
124
|
+
<a href="HttpHandler.src/M000043.html" target="Code" class="method-signature"
|
125
|
+
onclick="popupCode('HttpHandler.src/M000043.html');return false;">
|
126
126
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
127
127
|
</a>
|
128
128
|
</div>
|
File without changes
|
@@ -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="#M000026">error?</a>
|
90
|
+
<a href="#M000025">execute</a>
|
91
|
+
<a href="#M000024">finish</a>
|
92
|
+
<a href="#M000027">finished?</a>
|
93
|
+
<a href="#M000022">new</a>
|
94
|
+
<a href="#M000028">nread</a>
|
95
|
+
<a href="#M000023">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-M000022" class="method-detail">
|
118
|
+
<a name="M000022"></a>
|
119
119
|
|
120
120
|
<div class="method-heading">
|
121
|
-
<a href="HttpParser.src/
|
122
|
-
onclick="popupCode('HttpParser.src/
|
121
|
+
<a href="HttpParser.src/M000022.html" target="Code" class="method-signature"
|
122
|
+
onclick="popupCode('HttpParser.src/M000022.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-M000026" class="method-detail">
|
138
|
+
<a name="M000026"></a>
|
139
139
|
|
140
140
|
<div class="method-heading">
|
141
|
-
<a href="HttpParser.src/
|
142
|
-
onclick="popupCode('HttpParser.src/
|
141
|
+
<a href="HttpParser.src/M000026.html" target="Code" class="method-signature"
|
142
|
+
onclick="popupCode('HttpParser.src/M000026.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-M000025" class="method-detail">
|
156
|
+
<a name="M000025"></a>
|
157
157
|
|
158
158
|
<div class="method-heading">
|
159
|
-
<a href="HttpParser.src/
|
160
|
-
onclick="popupCode('HttpParser.src/
|
159
|
+
<a href="HttpParser.src/M000025.html" target="Code" class="method-signature"
|
160
|
+
onclick="popupCode('HttpParser.src/M000025.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-M000024" class="method-detail">
|
184
|
+
<a name="M000024"></a>
|
185
185
|
|
186
186
|
<div class="method-heading">
|
187
|
-
<a href="HttpParser.src/
|
188
|
-
onclick="popupCode('HttpParser.src/
|
187
|
+
<a href="HttpParser.src/M000024.html" target="Code" class="method-signature"
|
188
|
+
onclick="popupCode('HttpParser.src/M000024.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-M000027" class="method-detail">
|
203
|
+
<a name="M000027"></a>
|
204
204
|
|
205
205
|
<div class="method-heading">
|
206
|
-
<a href="HttpParser.src/
|
207
|
-
onclick="popupCode('HttpParser.src/
|
206
|
+
<a href="HttpParser.src/M000027.html" target="Code" class="method-signature"
|
207
|
+
onclick="popupCode('HttpParser.src/M000027.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-M000028" class="method-detail">
|
221
|
+
<a name="M000028"></a>
|
222
222
|
|
223
223
|
<div class="method-heading">
|
224
|
-
<a href="HttpParser.src/
|
225
|
-
onclick="popupCode('HttpParser.src/
|
224
|
+
<a href="HttpParser.src/M000028.html" target="Code" class="method-signature"
|
225
|
+
onclick="popupCode('HttpParser.src/M000028.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-M000023" class="method-detail">
|
241
|
+
<a name="M000023"></a>
|
242
242
|
|
243
243
|
<div class="method-heading">
|
244
|
-
<a href="HttpParser.src/
|
245
|
-
onclick="popupCode('HttpParser.src/
|
244
|
+
<a href="HttpParser.src/M000023.html" target="Code" class="method-signature"
|
245
|
+
onclick="popupCode('HttpParser.src/M000023.html');return false;">
|
246
246
|
<span class="method-name">parser.reset → nil<br />
|
247
247
|
</span>
|
248
248
|
</a>
|
@@ -5,24 +5,24 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>new (Mongrel::HttpParser)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/**
|
14
14
|
* call-seq:
|
15
|
-
* parser.
|
15
|
+
* parser.new -> parser
|
16
16
|
*
|
17
|
-
*
|
18
|
-
* set to 0 on initialize or reset calls and is incremented each time execute is called.
|
17
|
+
* Creates a new parser.
|
19
18
|
*/
|
20
|
-
VALUE
|
19
|
+
VALUE HttpParser_init(VALUE self)
|
21
20
|
{
|
22
21
|
http_parser *http = NULL;
|
23
22
|
DATA_GET(self, http_parser, http);
|
23
|
+
http_parser_init(http);
|
24
24
|
|
25
|
-
return
|
25
|
+
return self;
|
26
26
|
}</pre>
|
27
27
|
</body>
|
28
28
|
</html>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,24 +5,24 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>nread (Mongrel::HttpParser)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre>/**
|
14
14
|
* call-seq:
|
15
|
-
* parser.
|
15
|
+
* parser.nread -> Integer
|
16
16
|
*
|
17
|
-
*
|
17
|
+
* Returns the amount of data processed so far during this processing cycle. It is
|
18
|
+
* set to 0 on initialize or reset calls and is incremented each time execute is called.
|
18
19
|
*/
|
19
|
-
VALUE
|
20
|
+
VALUE HttpParser_nread(VALUE self)
|
20
21
|
{
|
21
22
|
http_parser *http = NULL;
|
22
23
|
DATA_GET(self, http_parser, http);
|
23
|
-
http_parser_init(http);
|
24
24
|
|
25
|
-
return
|
25
|
+
return INT2FIX(http->nread);
|
26
26
|
}</pre>
|
27
27
|
</body>
|
28
28
|
</html>
|
@@ -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="#M000068">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-M000068" class="method-detail">
|
147
|
+
<a name="M000068"></a>
|
148
148
|
|
149
149
|
<div class="method-heading">
|
150
|
-
<a href="HttpRequest.src/
|
151
|
-
onclick="popupCode('HttpRequest.src/
|
150
|
+
<a href="HttpRequest.src/M000068.html" target="Code" class="method-signature"
|
151
|
+
onclick="popupCode('HttpRequest.src/M000068.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
|
-
188:
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 174</span>
|
14
|
+
174: <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
|
+
175: <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
|
+
176: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
|
17
|
+
177: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
|
18
|
+
178:
|
19
|
+
179: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
|
20
|
+
180: <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
|
+
181: <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
|
+
182: <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
|
+
183: <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
|
+
184: <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
|
+
185: <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
|
+
186: <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-operator">||</span> <span class="ruby-value">80</span>
|
27
|
+
187: <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
|
+
188: <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>
|
30
29
|
189:
|
31
|
-
190:
|
32
|
-
191: <span class="ruby-comment cmt">#
|
33
|
-
192: <span class="ruby-
|
34
|
-
193: <span class="ruby-
|
35
|
-
194:
|
36
|
-
195:
|
37
|
-
196:
|
30
|
+
190:
|
31
|
+
191: <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
|
+
192: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
|
33
|
+
193: <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
|
+
194: <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
|
+
195: <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
|
+
196: <span class="ruby-keyword kw">end</span>
|
37
|
+
197: <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#M000045">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="#M000050">finished</a>
|
135
|
+
<a href="#M000044">new</a>
|
136
|
+
<a href="#M000046">reset</a>
|
137
|
+
<a href="#M000049">send_body</a>
|
138
|
+
<a href="#M000048">send_header</a>
|
139
|
+
<a href="#M000047">send_status</a>
|
140
|
+
<a href="#M000045">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-M000044" class="method-detail">
|
196
|
+
<a name="M000044"></a>
|
197
197
|
|
198
198
|
<div class="method-heading">
|
199
|
-
<a href="HttpResponse.src/
|
200
|
-
onclick="popupCode('HttpResponse.src/
|
199
|
+
<a href="HttpResponse.src/M000044.html" target="Code" class="method-signature"
|
200
|
+
onclick="popupCode('HttpResponse.src/M000044.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-M000050" class="method-detail">
|
212
|
+
<a name="M000050"></a>
|
213
213
|
|
214
214
|
<div class="method-heading">
|
215
|
-
<a href="HttpResponse.src/
|
216
|
-
onclick="popupCode('HttpResponse.src/
|
215
|
+
<a href="HttpResponse.src/M000050.html" target="Code" class="method-signature"
|
216
|
+
onclick="popupCode('HttpResponse.src/M000050.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-M000046" class="method-detail">
|
230
|
+
<a name="M000046"></a>
|
231
231
|
|
232
232
|
<div class="method-heading">
|
233
|
-
<a href="HttpResponse.src/
|
234
|
-
onclick="popupCode('HttpResponse.src/
|
233
|
+
<a href="HttpResponse.src/M000046.html" target="Code" class="method-signature"
|
234
|
+
onclick="popupCode('HttpResponse.src/M000046.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-M000049" class="method-detail">
|
248
|
+
<a name="M000049"></a>
|
249
249
|
|
250
250
|
<div class="method-heading">
|
251
|
-
<a href="HttpResponse.src/
|
252
|
-
onclick="popupCode('HttpResponse.src/
|
251
|
+
<a href="HttpResponse.src/M000049.html" target="Code" class="method-signature"
|
252
|
+
onclick="popupCode('HttpResponse.src/M000049.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-M000048" class="method-detail">
|
262
|
+
<a name="M000048"></a>
|
263
263
|
|
264
264
|
<div class="method-heading">
|
265
|
-
<a href="HttpResponse.src/
|
266
|
-
onclick="popupCode('HttpResponse.src/
|
265
|
+
<a href="HttpResponse.src/M000048.html" target="Code" class="method-signature"
|
266
|
+
onclick="popupCode('HttpResponse.src/M000048.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-M000047" class="method-detail">
|
276
|
+
<a name="M000047"></a>
|
277
277
|
|
278
278
|
<div class="method-heading">
|
279
|
-
<a href="HttpResponse.src/
|
280
|
-
onclick="popupCode('HttpResponse.src/
|
279
|
+
<a href="HttpResponse.src/M000047.html" target="Code" class="method-signature"
|
280
|
+
onclick="popupCode('HttpResponse.src/M000047.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-M000045" class="method-detail">
|
290
|
+
<a name="M000045"></a>
|
291
291
|
|
292
292
|
<div class="method-heading">
|
293
|
-
<a href="HttpResponse.src/
|
294
|
-
onclick="popupCode('HttpResponse.src/
|
293
|
+
<a href="HttpResponse.src/M000045.html" target="Code" class="method-signature"
|
294
|
+
onclick="popupCode('HttpResponse.src/M000045.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>
|