thin 0.5.3-x86-mswin32-60 → 0.5.4-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of thin might be problematic. Click here for more details.
- data/CHANGELOG +8 -0
- data/benchmark/previous.rb +14 -0
- data/benchmark/simple.rb +3 -38
- data/benchmark/utils.rb +51 -0
- data/bin/thin +1 -1
- data/example/config.ru +9 -2
- data/lib/thin.rb +1 -1
- data/lib/thin/connection.rb +4 -2
- data/lib/thin/response.rb +22 -14
- data/lib/thin/version.rb +2 -2
- data/lib/thin_parser.so +0 -0
- data/spec/response_spec.rb +22 -9
- data/spec/server_spec.rb +8 -3
- metadata +5 -56
- data/doc/rdoc/classes/Process.html +0 -181
- data/doc/rdoc/classes/Rack.html +0 -156
- data/doc/rdoc/classes/Rack/Adapter.html +0 -155
- data/doc/rdoc/classes/Rack/Adapter/Rails.html +0 -289
- data/doc/rdoc/classes/Rack/Adapter/Rails/CGIWrapper.html +0 -359
- data/doc/rdoc/classes/Rack/Handler.html +0 -155
- data/doc/rdoc/classes/Rack/Handler/Thin.html +0 -175
- data/doc/rdoc/classes/Thin.html +0 -164
- data/doc/rdoc/classes/Thin/Cluster.html +0 -399
- data/doc/rdoc/classes/Thin/Connection.html +0 -223
- data/doc/rdoc/classes/Thin/Daemonizable.html +0 -260
- data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +0 -197
- data/doc/rdoc/classes/Thin/Headers.html +0 -238
- data/doc/rdoc/classes/Thin/InvalidRequest.html +0 -144
- data/doc/rdoc/classes/Thin/Logging.html +0 -201
- data/doc/rdoc/classes/Thin/Request.html +0 -231
- data/doc/rdoc/classes/Thin/Response.html +0 -271
- data/doc/rdoc/classes/Thin/Server.html +0 -295
- data/doc/rdoc/classes/Thin/StopServer.html +0 -143
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/README.html +0 -226
- data/doc/rdoc/files/bin/thin.html +0 -245
- data/doc/rdoc/files/lib/rack/adapter/rails_rb.html +0 -146
- data/doc/rdoc/files/lib/rack/handler/thin_rb.html +0 -146
- data/doc/rdoc/files/lib/thin/cluster_rb.html +0 -146
- data/doc/rdoc/files/lib/thin/connection_rb.html +0 -145
- data/doc/rdoc/files/lib/thin/daemonizing_rb.html +0 -146
- data/doc/rdoc/files/lib/thin/headers_rb.html +0 -146
- data/doc/rdoc/files/lib/thin/logging_rb.html +0 -146
- data/doc/rdoc/files/lib/thin/request_rb.html +0 -145
- data/doc/rdoc/files/lib/thin/response_rb.html +0 -145
- data/doc/rdoc/files/lib/thin/server_rb.html +0 -145
- data/doc/rdoc/files/lib/thin/statuses_rb.html +0 -145
- data/doc/rdoc/files/lib/thin/version_rb.html +0 -145
- data/doc/rdoc/files/lib/thin_rb.html +0 -152
- data/doc/rdoc/index.html +0 -10
- data/doc/rdoc/logo.gif +0 -0
- data/doc/rdoc/rdoc-style.css +0 -55
@@ -1,231 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » Class: Thin::Request
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">about</a></li>
|
53
|
-
<li><a href="/thin/download/">download</a></li>
|
54
|
-
<li><a href="/thin/usage/">usage</a></li>
|
55
|
-
<li><a href="/thin/doc/">doc</a></li>
|
56
|
-
<li><a href="http://groups.google.com/group/thin-ruby/">community</a></li>
|
57
|
-
</ul>
|
58
|
-
<div id="sidebar">
|
59
|
-
<h2>Files</h2>
|
60
|
-
<ul class="list">
|
61
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
62
|
-
<li><a href="../../files/lib/rack/adapter/rails_rb.html" value="File: rails.rb">lib/rack/adapter/rails.rb</a></li>
|
63
|
-
<li><a href="../../files/lib/rack/handler/thin_rb.html" value="File: thin.rb">lib/rack/handler/thin.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/connection_rb.html" value="File: connection.rb">lib/thin/connection.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin_rb.html" value="File: thin.rb">lib/thin.rb</a></li>
|
75
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
76
|
-
</ul>
|
77
|
-
|
78
|
-
<h2>Classes</h2>
|
79
|
-
<ul class="list">
|
80
|
-
<li><a href="../../classes/Rack.html" title="Module: Rack">Rack</a></li>
|
81
|
-
<li><a href="../../classes/Rack/Adapter.html" title="Module: Rack::Adapter">Rack::Adapter</a></li>
|
82
|
-
<li><a href="../../classes/Rack/Adapter/Rails.html" title="Class: Rack::Adapter::Rails">Rack::Adapter::Rails</a></li>
|
83
|
-
<li><a href="../../classes/Rack/Adapter/Rails/CGIWrapper.html" title="Class: Rack::Adapter::Rails::CGIWrapper">Rack::Adapter::Rails::CGIWrapper</a></li>
|
84
|
-
<li><a href="../../classes/Rack/Handler.html" title="Module: Rack::Handler">Rack::Handler</a></li>
|
85
|
-
<li><a href="../../classes/Rack/Handler/Thin.html" title="Class: Rack::Handler::Thin">Rack::Handler::Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
92
|
-
<li><a href="../../classes/Thin/StopServer.html" title="Class: Thin::StopServer">Thin::StopServer</a></li>
|
93
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Connection.html" title="Class: Thin::Connection">Thin::Connection</a></li>
|
98
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
99
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
100
|
-
</ul>
|
101
|
-
</div>
|
102
|
-
<div id="container">
|
103
|
-
<div id="header">
|
104
|
-
<a href="/thin/" title="Home">
|
105
|
-
<img id="logo" src="../../logo.gif" />
|
106
|
-
</a>
|
107
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
<div id="content">
|
111
|
-
<h2>Class: Thin::Request</h2>
|
112
|
-
|
113
|
-
|
114
|
-
<div id="Thin::Request" class="page_shade">
|
115
|
-
<div class="page">
|
116
|
-
<h3>Class Thin::Request < Object</h3>
|
117
|
-
|
118
|
-
<span class="path">(in files
|
119
|
-
<a href="../../files/lib/thin/request_rb.html">lib/thin/request.rb</a>
|
120
|
-
)</span>
|
121
|
-
|
122
|
-
<p>
|
123
|
-
A request sent by the client to the server.
|
124
|
-
</p>
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
<h4>Includes</h4>
|
130
|
-
<ul>
|
131
|
-
<li><a href="Logging.html">Logging</a></li>
|
132
|
-
<li><a href="Daemonizable.html">Daemonizable</a></li>
|
133
|
-
</ul>
|
134
|
-
|
135
|
-
<h2 class="ruled">Methods</h2>
|
136
|
-
<h4 class="ruled">
|
137
|
-
<span class="method-type" title="Public Class method">Public Class</span>
|
138
|
-
<strong><a name="M000047" href="#M000047" title="Permalink to Public Class method: new">new()</a></strong>
|
139
|
-
</h4>
|
140
|
-
|
141
|
-
|
142
|
-
<div class="sourcecode">
|
143
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
|
144
|
-
<div id="M000047_source" class="dyn-source">
|
145
|
-
<pre>
|
146
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 28</span>
|
147
|
-
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
148
|
-
29: <span class="ruby-ivar">@parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
|
149
|
-
30: <span class="ruby-ivar">@data</span> = <span class="ruby-value str">''</span>
|
150
|
-
31: <span class="ruby-ivar">@nparsed</span> = <span class="ruby-value">0</span>
|
151
|
-
32: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
152
|
-
33: <span class="ruby-ivar">@env</span> = {
|
153
|
-
34: <span class="ruby-constant">SERVER_SOFTWARE</span> =<span class="ruby-operator">></span> <span class="ruby-constant">SERVER</span>,
|
154
|
-
35:
|
155
|
-
36: <span class="ruby-comment cmt"># Rack stuff</span>
|
156
|
-
37: <span class="ruby-constant">RACK_INPUT</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@body</span>,
|
157
|
-
38:
|
158
|
-
39: <span class="ruby-constant">RACK_VERSION</span> =<span class="ruby-operator">></span> [<span class="ruby-value">0</span>, <span class="ruby-value">2</span>],
|
159
|
-
40: <span class="ruby-constant">RACK_ERRORS</span> =<span class="ruby-operator">></span> <span class="ruby-constant">STDERR</span>,
|
160
|
-
41:
|
161
|
-
42: <span class="ruby-constant">RACK_MULTITHREAD</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>,
|
162
|
-
43: <span class="ruby-constant">RACK_MULTIPROCESS</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>,
|
163
|
-
44: <span class="ruby-constant">RACK_RUN_ONCE</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>
|
164
|
-
45: }
|
165
|
-
46: <span class="ruby-keyword kw">end</span>
|
166
|
-
</pre>
|
167
|
-
</div>
|
168
|
-
</div>
|
169
|
-
<h4 class="ruled">
|
170
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
171
|
-
<strong><a name="M000049" href="#M000049" title="Permalink to Public Instance method: content_length">content_length()</a></strong>
|
172
|
-
</h4>
|
173
|
-
|
174
|
-
|
175
|
-
<div class="sourcecode">
|
176
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
|
177
|
-
<div id="M000049_source" class="dyn-source">
|
178
|
-
<pre>
|
179
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 68</span>
|
180
|
-
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_length</span>
|
181
|
-
69: <span class="ruby-ivar">@env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span>
|
182
|
-
70: <span class="ruby-keyword kw">end</span>
|
183
|
-
</pre>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
<h4 class="ruled">
|
187
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
188
|
-
<strong><a name="M000048" href="#M000048" title="Permalink to Public Instance method: parse">parse(data)</a></strong>
|
189
|
-
</h4>
|
190
|
-
|
191
|
-
|
192
|
-
<div class="sourcecode">
|
193
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
|
194
|
-
<div id="M000048_source" class="dyn-source">
|
195
|
-
<pre>
|
196
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 48</span>
|
197
|
-
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">data</span>)
|
198
|
-
49: <span class="ruby-ivar">@data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">data</span>
|
199
|
-
50:
|
200
|
-
51: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">finished?</span> <span class="ruby-comment cmt"># Header finished, can only be some more body</span>
|
201
|
-
52: <span class="ruby-identifier">body</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">data</span>
|
202
|
-
53: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_HEADER</span> <span class="ruby-comment cmt"># Oho! very big header, must be a mean person</span>
|
203
|
-
54: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-constant">MAX_HEADER_MSG</span>
|
204
|
-
55: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># Parse more header using the super parser</span>
|
205
|
-
56: <span class="ruby-ivar">@nparsed</span> = <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-ivar">@env</span>, <span class="ruby-ivar">@data</span>, <span class="ruby-ivar">@nparsed</span>)
|
206
|
-
57: <span class="ruby-keyword kw">end</span>
|
207
|
-
58:
|
208
|
-
59: <span class="ruby-comment cmt"># Check if header and body are complete</span>
|
209
|
-
60: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">finished?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">content_length</span>
|
210
|
-
61: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">rewind</span>
|
211
|
-
62: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># Request is fully parsed</span>
|
212
|
-
63: <span class="ruby-keyword kw">end</span>
|
213
|
-
64:
|
214
|
-
65: <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># Not finished, need more data</span>
|
215
|
-
66: <span class="ruby-keyword kw">end</span>
|
216
|
-
</pre>
|
217
|
-
</div>
|
218
|
-
</div>
|
219
|
-
|
220
|
-
</div>
|
221
|
-
</div>
|
222
|
-
|
223
|
-
|
224
|
-
</div>
|
225
|
-
</div>
|
226
|
-
<div id="footer">
|
227
|
-
<hr />
|
228
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
229
|
-
</div>
|
230
|
-
</body>
|
231
|
-
</html>
|
@@ -1,271 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » Class: Thin::Response
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">about</a></li>
|
53
|
-
<li><a href="/thin/download/">download</a></li>
|
54
|
-
<li><a href="/thin/usage/">usage</a></li>
|
55
|
-
<li><a href="/thin/doc/">doc</a></li>
|
56
|
-
<li><a href="http://groups.google.com/group/thin-ruby/">community</a></li>
|
57
|
-
</ul>
|
58
|
-
<div id="sidebar">
|
59
|
-
<h2>Files</h2>
|
60
|
-
<ul class="list">
|
61
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
62
|
-
<li><a href="../../files/lib/rack/adapter/rails_rb.html" value="File: rails.rb">lib/rack/adapter/rails.rb</a></li>
|
63
|
-
<li><a href="../../files/lib/rack/handler/thin_rb.html" value="File: thin.rb">lib/rack/handler/thin.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/connection_rb.html" value="File: connection.rb">lib/thin/connection.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin_rb.html" value="File: thin.rb">lib/thin.rb</a></li>
|
75
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
76
|
-
</ul>
|
77
|
-
|
78
|
-
<h2>Classes</h2>
|
79
|
-
<ul class="list">
|
80
|
-
<li><a href="../../classes/Rack.html" title="Module: Rack">Rack</a></li>
|
81
|
-
<li><a href="../../classes/Rack/Adapter.html" title="Module: Rack::Adapter">Rack::Adapter</a></li>
|
82
|
-
<li><a href="../../classes/Rack/Adapter/Rails.html" title="Class: Rack::Adapter::Rails">Rack::Adapter::Rails</a></li>
|
83
|
-
<li><a href="../../classes/Rack/Adapter/Rails/CGIWrapper.html" title="Class: Rack::Adapter::Rails::CGIWrapper">Rack::Adapter::Rails::CGIWrapper</a></li>
|
84
|
-
<li><a href="../../classes/Rack/Handler.html" title="Module: Rack::Handler">Rack::Handler</a></li>
|
85
|
-
<li><a href="../../classes/Rack/Handler/Thin.html" title="Class: Rack::Handler::Thin">Rack::Handler::Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
92
|
-
<li><a href="../../classes/Thin/StopServer.html" title="Class: Thin::StopServer">Thin::StopServer</a></li>
|
93
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Connection.html" title="Class: Thin::Connection">Thin::Connection</a></li>
|
98
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
99
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
100
|
-
</ul>
|
101
|
-
</div>
|
102
|
-
<div id="container">
|
103
|
-
<div id="header">
|
104
|
-
<a href="/thin/" title="Home">
|
105
|
-
<img id="logo" src="../../logo.gif" />
|
106
|
-
</a>
|
107
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
<div id="content">
|
111
|
-
<h2>Class: Thin::Response</h2>
|
112
|
-
|
113
|
-
|
114
|
-
<div id="Thin::Response" class="page_shade">
|
115
|
-
<div class="page">
|
116
|
-
<h3>Class Thin::Response < Object</h3>
|
117
|
-
|
118
|
-
<span class="path">(in files
|
119
|
-
<a href="../../files/lib/thin/response_rb.html">lib/thin/response.rb</a>
|
120
|
-
)</span>
|
121
|
-
|
122
|
-
<p>
|
123
|
-
A response sent to the client.
|
124
|
-
</p>
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
<h2 class="ruled">Methods</h2>
|
131
|
-
<h4 class="ruled">
|
132
|
-
<span class="method-type" title="Public Class method">Public Class</span>
|
133
|
-
<strong><a name="M000029" href="#M000029" title="Permalink to Public Class method: new">new()</a></strong>
|
134
|
-
</h4>
|
135
|
-
|
136
|
-
|
137
|
-
<div class="sourcecode">
|
138
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">show source</a> ]</p>
|
139
|
-
<div id="M000029_source" class="dyn-source">
|
140
|
-
<pre>
|
141
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 11</span>
|
142
|
-
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
143
|
-
12: <span class="ruby-ivar">@headers</span> = <span class="ruby-constant">Headers</span>.<span class="ruby-identifier">new</span>
|
144
|
-
13: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
145
|
-
14: <span class="ruby-ivar">@status</span> = <span class="ruby-value">200</span>
|
146
|
-
15: <span class="ruby-keyword kw">end</span>
|
147
|
-
</pre>
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
<h4 class="ruled">
|
151
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
152
|
-
<strong><a name="M000033" href="#M000033" title="Permalink to Public Instance method: body=">body=(stream)</a></strong>
|
153
|
-
</h4>
|
154
|
-
|
155
|
-
|
156
|
-
<div class="sourcecode">
|
157
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show source</a> ]</p>
|
158
|
-
<div id="M000033_source" class="dyn-source">
|
159
|
-
<pre>
|
160
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 33</span>
|
161
|
-
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">body=</span>(<span class="ruby-identifier">stream</span>)
|
162
|
-
34: <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">part</span><span class="ruby-operator">|</span>
|
163
|
-
35: <span class="ruby-ivar">@body</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">part</span>
|
164
|
-
36: <span class="ruby-keyword kw">end</span>
|
165
|
-
37: <span class="ruby-keyword kw">end</span>
|
166
|
-
</pre>
|
167
|
-
</div>
|
168
|
-
</div>
|
169
|
-
<h4 class="ruled">
|
170
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
171
|
-
<strong><a name="M000034" href="#M000034" title="Permalink to Public Instance method: close">close()</a></strong>
|
172
|
-
</h4>
|
173
|
-
|
174
|
-
|
175
|
-
<div class="sourcecode">
|
176
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show source</a> ]</p>
|
177
|
-
<div id="M000034_source" class="dyn-source">
|
178
|
-
<pre>
|
179
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 39</span>
|
180
|
-
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
181
|
-
40: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">close</span>
|
182
|
-
41: <span class="ruby-keyword kw">end</span>
|
183
|
-
</pre>
|
184
|
-
</div>
|
185
|
-
</div>
|
186
|
-
<h4 class="ruled">
|
187
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
188
|
-
<strong><a name="M000031" href="#M000031" title="Permalink to Public Instance method: head">head()</a></strong>
|
189
|
-
</h4>
|
190
|
-
|
191
|
-
|
192
|
-
<div class="sourcecode">
|
193
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000031_source')" id="l_M000031_source">show source</a> ]</p>
|
194
|
-
<div id="M000031_source" class="dyn-source">
|
195
|
-
<pre>
|
196
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 23</span>
|
197
|
-
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span>
|
198
|
-
24: <span class="ruby-node">"HTTP/1.1 #{@status} #{HTTP_STATUS_CODES[@status.to_i]}\r\n#{headers_output}\r\n"</span>
|
199
|
-
25: <span class="ruby-keyword kw">end</span>
|
200
|
-
</pre>
|
201
|
-
</div>
|
202
|
-
</div>
|
203
|
-
<h4 class="ruled">
|
204
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
205
|
-
<strong><a name="M000032" href="#M000032" title="Permalink to Public Instance method: headers=">headers=(key_value_pairs)</a></strong>
|
206
|
-
</h4>
|
207
|
-
|
208
|
-
|
209
|
-
<div class="sourcecode">
|
210
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show source</a> ]</p>
|
211
|
-
<div id="M000032_source" class="dyn-source">
|
212
|
-
<pre>
|
213
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 27</span>
|
214
|
-
27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers=</span>(<span class="ruby-identifier">key_value_pairs</span>)
|
215
|
-
28: <span class="ruby-identifier">key_value_pairs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">vs</span><span class="ruby-operator">|</span>
|
216
|
-
29: <span class="ruby-identifier">vs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@headers</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">chomp</span> }
|
217
|
-
30: <span class="ruby-keyword kw">end</span>
|
218
|
-
31: <span class="ruby-keyword kw">end</span>
|
219
|
-
</pre>
|
220
|
-
</div>
|
221
|
-
</div>
|
222
|
-
<h4 class="ruled">
|
223
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
224
|
-
<strong><a name="M000030" href="#M000030" title="Permalink to Public Instance method: headers_output">headers_output()</a></strong>
|
225
|
-
</h4>
|
226
|
-
|
227
|
-
|
228
|
-
<div class="sourcecode">
|
229
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000030_source')" id="l_M000030_source">show source</a> ]</p>
|
230
|
-
<div id="M000030_source" class="dyn-source">
|
231
|
-
<pre>
|
232
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 17</span>
|
233
|
-
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">headers_output</span>
|
234
|
-
18: <span class="ruby-ivar">@headers</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">size</span>
|
235
|
-
19: <span class="ruby-ivar">@headers</span>[<span class="ruby-constant">CONNECTION</span>] = <span class="ruby-constant">CLOSE</span>
|
236
|
-
20: <span class="ruby-ivar">@headers</span>.<span class="ruby-identifier">to_s</span>
|
237
|
-
21: <span class="ruby-keyword kw">end</span>
|
238
|
-
</pre>
|
239
|
-
</div>
|
240
|
-
</div>
|
241
|
-
<h4 class="ruled">
|
242
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
243
|
-
<strong><a name="M000035" href="#M000035" title="Permalink to Public Instance method: to_s">to_s()</a></strong>
|
244
|
-
</h4>
|
245
|
-
|
246
|
-
|
247
|
-
<div class="sourcecode">
|
248
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show source</a> ]</p>
|
249
|
-
<div id="M000035_source" class="dyn-source">
|
250
|
-
<pre>
|
251
|
-
<span class="ruby-comment cmt"># File lib/thin/response.rb, line 43</span>
|
252
|
-
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
253
|
-
44: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
254
|
-
45: <span class="ruby-identifier">head</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">read</span>
|
255
|
-
46: <span class="ruby-keyword kw">end</span>
|
256
|
-
</pre>
|
257
|
-
</div>
|
258
|
-
</div>
|
259
|
-
|
260
|
-
</div>
|
261
|
-
</div>
|
262
|
-
|
263
|
-
|
264
|
-
</div>
|
265
|
-
</div>
|
266
|
-
<div id="footer">
|
267
|
-
<hr />
|
268
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
269
|
-
</div>
|
270
|
-
</body>
|
271
|
-
</html>
|