mongrel 0.3.5 → 0.3.6
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 +4 -3
- data/Rakefile +7 -5
- data/bin/mongrel_rails +5 -4
- data/bin/mongrel_rails_service +237 -0
- data/bin/mongrel_rails_svc +194 -0
- data/doc/rdoc/classes/Mongrel.html +1 -4
- data/doc/rdoc/classes/Mongrel/Const.html +13 -3
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000033.html → M000028.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000034.html → M000029.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000041.html +39 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +36 -36
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000034.html +21 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000041.html → M000035.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000042.html → M000036.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000043.html → M000037.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000044.html → M000038.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000045.html → M000039.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000040.html +7 -8
- data/doc/rdoc/classes/Mongrel/HttpServer.html +47 -28
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000022.html +33 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000023.html +57 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000024.html +46 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000031.html → M000025.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000032.html → M000026.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000027.html +19 -0
- data/doc/rdoc/classes/Mongrel/{HttpHandler.html → StopServer.html} +4 -33
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +22 -23
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000035.html → M000030.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000036.html → M000031.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000037.html → M000032.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000038.html → M000033.html} +0 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +9 -7
- data/doc/rdoc/files/lib/mongrel_rb.html +3 -3
- data/doc/rdoc/fr_class_index.html +1 -4
- data/doc/rdoc/fr_method_index.html +20 -37
- data/examples/mongrel_simple_ctrl.rb +92 -0
- data/examples/mongrel_simple_service.rb +116 -0
- data/examples/simpletest.rb +3 -1
- data/ext/http11/http11_parser.c +176 -263
- data/lib/mongrel.rb +56 -343
- data/lib/mongrel/cgi.rb +147 -0
- data/lib/mongrel/handlers.rb +180 -0
- metadata +28 -46
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -346
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000047.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000048.html +0 -48
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000049.html +0 -34
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000050.html +0 -27
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000051.html +0 -26
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000052.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000053.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000054.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000055.html +0 -19
- data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -283
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000022.html +0 -20
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000023.html +0 -42
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000024.html +0 -40
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000025.html +0 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000026.html +0 -38
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000027.html +0 -18
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000056.html +0 -18
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000057.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000039.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000058.html +0 -31
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000046.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000028.html +0 -38
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000029.html +0 -64
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000030.html +0 -23
|
@@ -101,15 +101,12 @@ to service web application requests fast as possible.
|
|
|
101
101
|
<h3 class="section-bar">Classes and Modules</h3>
|
|
102
102
|
|
|
103
103
|
Module <a href="Mongrel/Const.html" class="link">Mongrel::Const</a><br />
|
|
104
|
-
Class <a href="Mongrel/CGIWrapper.html" class="link">Mongrel::CGIWrapper</a><br />
|
|
105
|
-
Class <a href="Mongrel/DirHandler.html" class="link">Mongrel::DirHandler</a><br />
|
|
106
|
-
Class <a href="Mongrel/Error404Handler.html" class="link">Mongrel::Error404Handler</a><br />
|
|
107
104
|
Class <a href="Mongrel/HeaderOut.html" class="link">Mongrel::HeaderOut</a><br />
|
|
108
|
-
Class <a href="Mongrel/HttpHandler.html" class="link">Mongrel::HttpHandler</a><br />
|
|
109
105
|
Class <a href="Mongrel/HttpParser.html" class="link">Mongrel::HttpParser</a><br />
|
|
110
106
|
Class <a href="Mongrel/HttpRequest.html" class="link">Mongrel::HttpRequest</a><br />
|
|
111
107
|
Class <a href="Mongrel/HttpResponse.html" class="link">Mongrel::HttpResponse</a><br />
|
|
112
108
|
Class <a href="Mongrel/HttpServer.html" class="link">Mongrel::HttpServer</a><br />
|
|
109
|
+
Class <a href="Mongrel/StopServer.html" class="link">Mongrel::StopServer</a><br />
|
|
113
110
|
Class <a href="Mongrel/URIClassifier.html" class="link">Mongrel::URIClassifier</a><br />
|
|
114
111
|
|
|
115
112
|
</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#M000022">HttpServer.new</a>(host,port) call.
|
|
234
234
|
|
|
235
235
|
</td>
|
|
236
236
|
</tr>
|
|
@@ -241,7 +241,17 @@ href="HttpServer.html#M000028">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#M000022">HttpServer.new</a>(host,port) call.
|
|
245
|
+
|
|
246
|
+
</td>
|
|
247
|
+
</tr>
|
|
248
|
+
<tr class="top-aligned-row context-row">
|
|
249
|
+
<td class="context-item-name">HTTP_HOST</td>
|
|
250
|
+
<td>=</td>
|
|
251
|
+
<td class="context-item-value">'HTTP_HOST'</td>
|
|
252
|
+
<td width="3em"> </td>
|
|
253
|
+
<td class="context-item-desc">
|
|
254
|
+
SERVER_NAME and SERVER_PORT come from this.
|
|
245
255
|
|
|
246
256
|
</td>
|
|
247
257
|
</tr>
|
|
@@ -280,7 +290,7 @@ href="../Mongrel.html">Mongrel</a> man).
|
|
|
280
290
|
<tr class="top-aligned-row context-row">
|
|
281
291
|
<td class="context-item-name">MONGREL_VERSION</td>
|
|
282
292
|
<td>=</td>
|
|
283
|
-
<td class="context-item-value">'Mongrel 0.3.
|
|
293
|
+
<td class="context-item-value">'Mongrel 0.3.6'</td>
|
|
284
294
|
<td width="3em"> </td>
|
|
285
295
|
<td class="context-item-desc">
|
|
286
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="#M000029">[]=</a>
|
|
105
|
+
<a href="#M000028">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-M000028" class="method-detail">
|
|
141
|
+
<a name="M000028"></a>
|
|
142
142
|
|
|
143
143
|
<div class="method-heading">
|
|
144
|
-
<a href="HeaderOut.src/
|
|
145
|
-
onclick="popupCode('HeaderOut.src/
|
|
144
|
+
<a href="HeaderOut.src/M000028.html" target="Code" class="method-signature"
|
|
145
|
+
onclick="popupCode('HeaderOut.src/M000028.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-M000029" class="method-detail">
|
|
157
|
+
<a name="M000029"></a>
|
|
158
158
|
|
|
159
159
|
<div class="method-heading">
|
|
160
|
-
<a href="HeaderOut.src/
|
|
161
|
-
onclick="popupCode('HeaderOut.src/
|
|
160
|
+
<a href="HeaderOut.src/M000029.html" target="Code" class="method-signature"
|
|
161
|
+
onclick="popupCode('HeaderOut.src/M000029.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 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>
|
|
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 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">": "</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">"\r\n"</span>)
|
|
19
|
+
198: <span class="ruby-keyword kw">end</span></pre>
|
|
20
20
|
</body>
|
|
21
21
|
</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="#M000041">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-M000041" class="method-detail">
|
|
147
|
+
<a name="M000041"></a>
|
|
148
148
|
|
|
149
149
|
<div class="method-heading">
|
|
150
|
-
<a href="HttpRequest.src/
|
|
151
|
-
onclick="popupCode('HttpRequest.src/
|
|
150
|
+
<a href="HttpRequest.src/M000041.html" target="Code" class="method-signature"
|
|
151
|
+
onclick="popupCode('HttpRequest.src/M000041.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>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>new (Mongrel::HttpRequest)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 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">""</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">":"</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"><</span> <span class="ruby-identifier">clen</span>
|
|
35
|
+
172: <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
|
+
173: <span class="ruby-keyword kw">end</span>
|
|
37
|
+
174: <span class="ruby-keyword kw">end</span></pre>
|
|
38
|
+
</body>
|
|
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#M000035">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="#M000040">finished</a>
|
|
135
|
+
<a href="#M000034">new</a>
|
|
136
|
+
<a href="#M000036">reset</a>
|
|
137
|
+
<a href="#M000039">send_body</a>
|
|
138
|
+
<a href="#M000038">send_header</a>
|
|
139
|
+
<a href="#M000037">send_status</a>
|
|
140
|
+
<a href="#M000035">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-M000034" class="method-detail">
|
|
196
|
+
<a name="M000034"></a>
|
|
197
197
|
|
|
198
198
|
<div class="method-heading">
|
|
199
|
-
<a href="HttpResponse.src/
|
|
200
|
-
onclick="popupCode('HttpResponse.src/
|
|
199
|
+
<a href="HttpResponse.src/M000034.html" target="Code" class="method-signature"
|
|
200
|
+
onclick="popupCode('HttpResponse.src/M000034.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-M000040" class="method-detail">
|
|
212
|
+
<a name="M000040"></a>
|
|
213
213
|
|
|
214
214
|
<div class="method-heading">
|
|
215
|
-
<a href="HttpResponse.src/
|
|
216
|
-
onclick="popupCode('HttpResponse.src/
|
|
215
|
+
<a href="HttpResponse.src/M000040.html" target="Code" class="method-signature"
|
|
216
|
+
onclick="popupCode('HttpResponse.src/M000040.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-M000036" class="method-detail">
|
|
230
|
+
<a name="M000036"></a>
|
|
231
231
|
|
|
232
232
|
<div class="method-heading">
|
|
233
|
-
<a href="HttpResponse.src/
|
|
234
|
-
onclick="popupCode('HttpResponse.src/
|
|
233
|
+
<a href="HttpResponse.src/M000036.html" target="Code" class="method-signature"
|
|
234
|
+
onclick="popupCode('HttpResponse.src/M000036.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-M000039" class="method-detail">
|
|
248
|
+
<a name="M000039"></a>
|
|
249
249
|
|
|
250
250
|
<div class="method-heading">
|
|
251
|
-
<a href="HttpResponse.src/
|
|
252
|
-
onclick="popupCode('HttpResponse.src/
|
|
251
|
+
<a href="HttpResponse.src/M000039.html" target="Code" class="method-signature"
|
|
252
|
+
onclick="popupCode('HttpResponse.src/M000039.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-M000038" class="method-detail">
|
|
262
|
+
<a name="M000038"></a>
|
|
263
263
|
|
|
264
264
|
<div class="method-heading">
|
|
265
|
-
<a href="HttpResponse.src/
|
|
266
|
-
onclick="popupCode('HttpResponse.src/
|
|
265
|
+
<a href="HttpResponse.src/M000038.html" target="Code" class="method-signature"
|
|
266
|
+
onclick="popupCode('HttpResponse.src/M000038.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-M000037" class="method-detail">
|
|
276
|
+
<a name="M000037"></a>
|
|
277
277
|
|
|
278
278
|
<div class="method-heading">
|
|
279
|
-
<a href="HttpResponse.src/
|
|
280
|
-
onclick="popupCode('HttpResponse.src/
|
|
279
|
+
<a href="HttpResponse.src/M000037.html" target="Code" class="method-signature"
|
|
280
|
+
onclick="popupCode('HttpResponse.src/M000037.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-M000035" class="method-detail">
|
|
290
|
+
<a name="M000035"></a>
|
|
291
291
|
|
|
292
292
|
<div class="method-heading">
|
|
293
|
-
<a href="HttpResponse.src/
|
|
294
|
-
onclick="popupCode('HttpResponse.src/
|
|
293
|
+
<a href="HttpResponse.src/M000035.html" target="Code" class="method-signature"
|
|
294
|
+
onclick="popupCode('HttpResponse.src/M000035.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>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>new (Mongrel::HttpResponse)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 237</span>
|
|
14
|
+
237: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">socket</span>)
|
|
15
|
+
238: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
|
|
16
|
+
239: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
240: <span class="ruby-ivar">@status</span> = <span class="ruby-value">404</span>
|
|
18
|
+
241: <span class="ruby-ivar">@header</span> = <span class="ruby-constant">HeaderOut</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>)
|
|
19
|
+
242: <span class="ruby-keyword kw">end</span></pre>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -10,11 +10,11 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 248</span>
|
|
14
|
+
248: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">status</span>=<span class="ruby-value">200</span>)
|
|
15
|
+
249: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span>
|
|
16
|
+
250: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@header</span>, <span class="ruby-ivar">@body</span>
|
|
17
|
+
251: <span class="ruby-identifier">finished</span>
|
|
18
|
+
252: <span class="ruby-keyword kw">end</span></pre>
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|
|
@@ -10,10 +10,10 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 256</span>
|
|
14
|
+
256: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
|
15
|
+
257: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
|
|
16
|
+
258: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
|
17
|
+
259: <span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
19
19
|
</html>
|
|
@@ -10,10 +10,10 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 261</span>
|
|
14
|
+
261: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_status</span>
|
|
15
|
+
262: <span class="ruby-identifier">status</span> = <span class="ruby-node">"HTTP/1.1 #{@status} #{HTTP_STATUS_CODES[@status]}\r\nContent-Length: #{@body.length}\r\nConnection: close\r\n"</span>
|
|
16
|
+
263: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">status</span>)
|
|
17
|
+
264: <span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
19
19
|
</html>
|
|
@@ -10,11 +10,11 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 266</span>
|
|
14
|
+
266: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_header</span>
|
|
15
|
+
267: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
|
|
16
|
+
268: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">read</span>)
|
|
17
|
+
269: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"\r\n"</span>)
|
|
18
|
+
270: <span class="ruby-keyword kw">end</span></pre>
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|
|
@@ -10,11 +10,11 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 272</span>
|
|
14
|
+
272: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_body</span>
|
|
15
|
+
273: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
|
16
|
+
274: <span class="ruby-comment cmt"># connection: close is also added to ensure that the client does not pipeline.</span>
|
|
17
|
+
275: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@body</span>.<span class="ruby-identifier">read</span>)
|
|
18
|
+
276: <span class="ruby-keyword kw">end</span></pre>
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|