passenger 2.2.7 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/NEWS +40 -0
- data/Rakefile +1 -1
- data/bin/passenger-install-apache2-module +1 -0
- data/bin/passenger-install-nginx-module +2 -0
- data/doc/Architectural overview.html +173 -138
- data/doc/Security of user switching support.html +147 -109
- data/doc/Users guide Apache.html +4 -43
- data/doc/Users guide Nginx.html +4 -43
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +1 -1
- data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/classHooks-members.html +1 -1
- data/doc/cxxapi/classHooks.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
- data/doc/cxxapi/classes.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +1 -1
- data/doc/cxxapi/functions_func.html +1 -1
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/group__Configuration.html +1 -1
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/modules.html +1 -1
- data/doc/rdoc/classes/GC.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger.html +2 -1
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +8 -8
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +26 -26
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +98 -98
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +61 -61
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +12 -12
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +5 -5
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +42 -42
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +33 -33
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +59 -59
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +3 -3
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +7 -7
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +23 -23
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +4 -4
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +2 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +16 -16
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +4 -4
- data/doc/rdoc/classes/PlatformInfo.html +1 -1
- data/doc/rdoc/classes/Signal.html +23 -15
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
- data/doc/rdoc/files/README.html +1 -1
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +2 -2
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +2 -2
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +9 -9
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +1 -1
- data/doc/rdoc/files/misc/rake/extensions_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +2 -0
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +79 -72
- data/ext/apache2/Hooks.cpp +4 -2
- data/ext/common/StandardApplicationPool.h +4 -2
- data/ext/common/Version.h +1 -1
- data/ext/nginx/Configuration.c +1 -1
- data/ext/oxt/system_calls.cpp +11 -0
- data/ext/oxt/system_calls.hpp +2 -1
- data/ext/oxt/thread.hpp +97 -1
- data/lib/phusion_passenger/constants.rb +1 -1
- data/lib/phusion_passenger/dependencies.rb +32 -0
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/rack/application_spawner.rb +4 -4
- data/lib/phusion_passenger/rack/request_handler.rb +2 -5
- data/lib/phusion_passenger/railz/application_spawner.rb +13 -2
- data/lib/phusion_passenger/utils.rb +12 -4
- data/{vendor/rack-1.0.0-git/lib/rack → lib/phusion_passenger/utils}/rewindable_input.rb +19 -3
- data/test/ApplicationPoolTest.cpp +1 -1
- metadata +13 -59
- data/vendor/README +0 -13
- data/vendor/README_FOR_PACKAGERS +0 -1
- data/vendor/rack-1.0.0-git/COPYING +0 -18
- data/vendor/rack-1.0.0-git/KNOWN-ISSUES +0 -18
- data/vendor/rack-1.0.0-git/README +0 -353
- data/vendor/rack-1.0.0-git/Rakefile +0 -164
- data/vendor/rack-1.0.0-git/lib/rack.rb +0 -90
- data/vendor/rack-1.0.0-git/lib/rack/adapter/camping.rb +0 -22
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/request.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/basic.rb +0 -58
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/md5.rb +0 -124
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/nonce.rb +0 -51
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/params.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/request.rb +0 -40
- data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +0 -487
- data/vendor/rack-1.0.0-git/lib/rack/builder.rb +0 -63
- data/vendor/rack-1.0.0-git/lib/rack/cascade.rb +0 -41
- data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +0 -49
- data/vendor/rack-1.0.0-git/lib/rack/commonlogger.rb +0 -52
- data/vendor/rack-1.0.0-git/lib/rack/conditionalget.rb +0 -47
- data/vendor/rack-1.0.0-git/lib/rack/content_length.rb +0 -29
- data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +0 -23
- data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +0 -96
- data/vendor/rack-1.0.0-git/lib/rack/directory.rb +0 -153
- data/vendor/rack-1.0.0-git/lib/rack/file.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler.rb +0 -69
- data/vendor/rack-1.0.0-git/lib/rack/handler/cgi.rb +0 -61
- data/vendor/rack-1.0.0-git/lib/rack/handler/evented_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/fastcgi.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler/lsws.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/handler/mongrel.rb +0 -84
- data/vendor/rack-1.0.0-git/lib/rack/handler/scgi.rb +0 -59
- data/vendor/rack-1.0.0-git/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/thin.rb +0 -18
- data/vendor/rack-1.0.0-git/lib/rack/handler/webrick.rb +0 -67
- data/vendor/rack-1.0.0-git/lib/rack/head.rb +0 -19
- data/vendor/rack-1.0.0-git/lib/rack/lint.rb +0 -537
- data/vendor/rack-1.0.0-git/lib/rack/lobster.rb +0 -65
- data/vendor/rack-1.0.0-git/lib/rack/lock.rb +0 -16
- data/vendor/rack-1.0.0-git/lib/rack/methodoverride.rb +0 -27
- data/vendor/rack-1.0.0-git/lib/rack/mime.rb +0 -204
- data/vendor/rack-1.0.0-git/lib/rack/mock.rb +0 -184
- data/vendor/rack-1.0.0-git/lib/rack/recursive.rb +0 -57
- data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/request.rb +0 -248
- data/vendor/rack-1.0.0-git/lib/rack/response.rb +0 -183
- data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +0 -142
- data/vendor/rack-1.0.0-git/lib/rack/session/cookie.rb +0 -91
- data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +0 -109
- data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +0 -100
- data/vendor/rack-1.0.0-git/lib/rack/showexceptions.rb +0 -349
- data/vendor/rack-1.0.0-git/lib/rack/showstatus.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/static.rb +0 -38
- data/vendor/rack-1.0.0-git/lib/rack/urlmap.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/utils.rb +0 -522
@@ -90,7 +90,7 @@ attribute is guaranteed non-nil.
|
|
90
90
|
|
91
91
|
<div class="sectiontitle">Methods</div>
|
92
92
|
<ul>
|
93
|
-
<li><a href="#
|
93
|
+
<li><a href="#M000107">new</a></li>
|
94
94
|
</ul>
|
95
95
|
|
96
96
|
|
@@ -118,11 +118,11 @@ attribute is guaranteed non-nil.
|
|
118
118
|
<div class="sectiontitle">Public Class methods</div>
|
119
119
|
<div class="method">
|
120
120
|
<div class="title">
|
121
|
-
<a name="
|
121
|
+
<a name="M000107"></a><b>new</b>(message, child_exception, options)
|
122
122
|
</div>
|
123
123
|
<div class="sourcecode">
|
124
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
125
|
-
<div id="
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000107_source')" id="l_M000107_source">show source</a> ]</p>
|
125
|
+
<div id="M000107_source" class="dyn-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 80</span>
|
128
128
|
80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">options</span>)
|
@@ -84,9 +84,9 @@ A convenience utility class for rendering our error pages.
|
|
84
84
|
|
85
85
|
<div class="sectiontitle">Methods</div>
|
86
86
|
<ul>
|
87
|
-
<li><a href="#
|
88
|
-
<li><a href="#
|
89
|
-
<li><a href="#
|
87
|
+
<li><a href="#M000124">[]=</a></li>
|
88
|
+
<li><a href="#M000123">new</a></li>
|
89
|
+
<li><a href="#M000125">result</a></li>
|
90
90
|
</ul>
|
91
91
|
|
92
92
|
<div class="sectiontitle">Included Modules</div>
|
@@ -114,11 +114,11 @@ A convenience utility class for rendering our error pages.
|
|
114
114
|
<div class="sectiontitle">Public Class methods</div>
|
115
115
|
<div class="method">
|
116
116
|
<div class="title">
|
117
|
-
<a name="
|
117
|
+
<a name="M000123"></a><b>new</b>(template_name, options = {})
|
118
118
|
</div>
|
119
119
|
<div class="sourcecode">
|
120
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
121
|
-
<div id="
|
120
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000123_source')" id="l_M000123_source">show source</a> ]</p>
|
121
|
+
<div id="M000123_source" class="dyn-source">
|
122
122
|
<pre>
|
123
123
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 33</span>
|
124
124
|
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">template_name</span>, <span class="ruby-identifier">options</span> = {})
|
@@ -136,11 +136,11 @@ A convenience utility class for rendering our error pages.
|
|
136
136
|
<div class="sectiontitle">Public Instance methods</div>
|
137
137
|
<div class="method">
|
138
138
|
<div class="title">
|
139
|
-
<a name="
|
139
|
+
<a name="M000124"></a><b>[]=</b>(name, value)
|
140
140
|
</div>
|
141
141
|
<div class="sourcecode">
|
142
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
143
|
-
<div id="
|
142
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000124_source')" id="l_M000124_source">show source</a> ]</p>
|
143
|
+
<div id="M000124_source" class="dyn-source">
|
144
144
|
<pre>
|
145
145
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 42</span>
|
146
146
|
42: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
|
@@ -153,11 +153,11 @@ A convenience utility class for rendering our error pages.
|
|
153
153
|
</div>
|
154
154
|
<div class="method">
|
155
155
|
<div class="title">
|
156
|
-
<a name="
|
156
|
+
<a name="M000125"></a><b>result</b>()
|
157
157
|
</div>
|
158
158
|
<div class="sourcecode">
|
159
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
160
|
-
<div id="
|
159
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000125_source')" id="l_M000125_source">show source</a> ]</p>
|
160
|
+
<div id="M000125_source" class="dyn-source">
|
161
161
|
<pre>
|
162
162
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/html_template.rb, line 47</span>
|
163
163
|
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>
|
@@ -86,7 +86,7 @@ the failure when initializing something.
|
|
86
86
|
|
87
87
|
<div class="sectiontitle">Methods</div>
|
88
88
|
<ul>
|
89
|
-
<li><a href="#
|
89
|
+
<li><a href="#M000163">new</a></li>
|
90
90
|
</ul>
|
91
91
|
|
92
92
|
|
@@ -110,19 +110,19 @@ The exception that caused initialization to fail. This may be nil.
|
|
110
110
|
<div class="sectiontitle">Public Class methods</div>
|
111
111
|
<div class="method">
|
112
112
|
<div class="title">
|
113
|
-
<a name="
|
113
|
+
<a name="M000163"></a><b>new</b>(message, child_exception = nil)
|
114
114
|
</div>
|
115
115
|
<div class="description">
|
116
116
|
<p>
|
117
|
-
Create a <a href="InitializationError.html#
|
117
|
+
Create a <a href="InitializationError.html#M000163">new</a> <a
|
118
118
|
href="InitializationError.html">InitializationError</a>. <tt>message</tt>
|
119
119
|
is the error message, and <tt>child_exception</tt> is the exception that
|
120
120
|
caused initialization to fail.
|
121
121
|
</p>
|
122
122
|
</div>
|
123
123
|
<div class="sourcecode">
|
124
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
125
|
-
<div id="
|
124
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000163_source')" id="l_M000163_source">show source</a> ]</p>
|
125
|
+
<div id="M000163_source" class="dyn-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/exceptions.rb, line 48</span>
|
128
128
|
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">child_exception</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -134,8 +134,8 @@ The life time of a <a href="MessageChannel.html">MessageChannel</a> is
|
|
134
134
|
independent from that of the wrapped <a href="../IO.html">IO</a> object. If
|
135
135
|
a <a href="MessageChannel.html">MessageChannel</a> object is destroyed, the
|
136
136
|
underlying <a href="../IO.html">IO</a> object is not automatically closed.
|
137
|
-
Call <a href="MessageChannel.html#
|
138
|
-
href="MessageChannel.html#
|
137
|
+
Call <a href="MessageChannel.html#M000154">close</a>() if you want to <a
|
138
|
+
href="MessageChannel.html#M000154">close</a> the underlying <a
|
139
139
|
href="../IO.html">IO</a> object.
|
140
140
|
</p>
|
141
141
|
<p>
|
@@ -154,15 +154,15 @@ things in the wrong order then bad things will happen.
|
|
154
154
|
|
155
155
|
<div class="sectiontitle">Methods</div>
|
156
156
|
<ul>
|
157
|
-
<li><a href="#
|
158
|
-
<li><a href="#
|
159
|
-
<li><a href="#
|
160
|
-
<li><a href="#
|
161
|
-
<li><a href="#
|
162
|
-
<li><a href="#
|
163
|
-
<li><a href="#
|
164
|
-
<li><a href="#
|
165
|
-
<li><a href="#
|
157
|
+
<li><a href="#M000154">close</a></li>
|
158
|
+
<li><a href="#M000153">fileno</a></li>
|
159
|
+
<li><a href="#M000146">new</a></li>
|
160
|
+
<li><a href="#M000147">read</a></li>
|
161
|
+
<li><a href="#M000148">read_scalar</a></li>
|
162
|
+
<li><a href="#M000151">recv_io</a></li>
|
163
|
+
<li><a href="#M000152">send_io</a></li>
|
164
|
+
<li><a href="#M000149">write</a></li>
|
165
|
+
<li><a href="#M000150">write_scalar</a></li>
|
166
166
|
</ul>
|
167
167
|
|
168
168
|
|
@@ -186,18 +186,18 @@ The wrapped <a href="../IO.html">IO</a> object.
|
|
186
186
|
<div class="sectiontitle">Public Class methods</div>
|
187
187
|
<div class="method">
|
188
188
|
<div class="title">
|
189
|
-
<a name="
|
189
|
+
<a name="M000146"></a><b>new</b>(io)
|
190
190
|
</div>
|
191
191
|
<div class="description">
|
192
192
|
<p>
|
193
|
-
Create a <a href="MessageChannel.html#
|
193
|
+
Create a <a href="MessageChannel.html#M000146">new</a> <a
|
194
194
|
href="MessageChannel.html">MessageChannel</a> by wrapping the given <a
|
195
195
|
href="../IO.html">IO</a> object.
|
196
196
|
</p>
|
197
197
|
</div>
|
198
198
|
<div class="sourcecode">
|
199
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
200
|
-
<div id="
|
199
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000146_source')" id="l_M000146_source">show source</a> ]</p>
|
200
|
+
<div id="M000146_source" class="dyn-source">
|
201
201
|
<pre>
|
202
202
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 83</span>
|
203
203
|
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">io</span>)
|
@@ -210,7 +210,7 @@ href="../IO.html">IO</a> object.
|
|
210
210
|
<div class="sectiontitle">Public Instance methods</div>
|
211
211
|
<div class="method">
|
212
212
|
<div class="title">
|
213
|
-
<a name="
|
213
|
+
<a name="M000154"></a><b>close</b>()
|
214
214
|
</div>
|
215
215
|
<div class="description">
|
216
216
|
<p>
|
@@ -219,8 +219,8 @@ SystemCallError or IOError when something goes wrong.
|
|
219
219
|
</p>
|
220
220
|
</div>
|
221
221
|
<div class="sourcecode">
|
222
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
223
|
-
<div id="
|
222
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000154_source')" id="l_M000154_source">show source</a> ]</p>
|
223
|
+
<div id="M000154_source" class="dyn-source">
|
224
224
|
<pre>
|
225
225
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 217</span>
|
226
226
|
217: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
@@ -232,7 +232,7 @@ SystemCallError or IOError when something goes wrong.
|
|
232
232
|
</div>
|
233
233
|
<div class="method">
|
234
234
|
<div class="title">
|
235
|
-
<a name="
|
235
|
+
<a name="M000153"></a><b>fileno</b>()
|
236
236
|
</div>
|
237
237
|
<div class="description">
|
238
238
|
<p>
|
@@ -241,8 +241,8 @@ object.
|
|
241
241
|
</p>
|
242
242
|
</div>
|
243
243
|
<div class="sourcecode">
|
244
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
245
|
-
<div id="
|
244
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000153_source')" id="l_M000153_source">show source</a> ]</p>
|
245
|
+
<div id="M000153_source" class="dyn-source">
|
246
246
|
<pre>
|
247
247
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 211</span>
|
248
248
|
211: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fileno</span>
|
@@ -254,7 +254,7 @@ object.
|
|
254
254
|
</div>
|
255
255
|
<div class="method">
|
256
256
|
<div class="title">
|
257
|
-
<a name="
|
257
|
+
<a name="M000147"></a><b>read</b>()
|
258
258
|
</div>
|
259
259
|
<div class="description">
|
260
260
|
<p>
|
@@ -267,8 +267,8 @@ wrong.
|
|
267
267
|
</p>
|
268
268
|
</div>
|
269
269
|
<div class="sourcecode">
|
270
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
271
|
-
<div id="
|
270
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000147_source')" id="l_M000147_source">show source</a> ]</p>
|
271
|
+
<div id="M000147_source" class="dyn-source">
|
272
272
|
<pre>
|
273
273
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 93</span>
|
274
274
|
93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>
|
@@ -307,12 +307,12 @@ wrong.
|
|
307
307
|
</div>
|
308
308
|
<div class="method">
|
309
309
|
<div class="title">
|
310
|
-
<a name="
|
310
|
+
<a name="M000148"></a><b>read_scalar</b>(max_size = nil)
|
311
311
|
</div>
|
312
312
|
<div class="description">
|
313
313
|
<p>
|
314
314
|
Read a scalar message from the underlying <a href="../IO.html">IO</a>
|
315
|
-
object. Returns the <a href="MessageChannel.html#
|
315
|
+
object. Returns the <a href="MessageChannel.html#M000147">read</a> message,
|
316
316
|
or nil on end-of-stream.
|
317
317
|
</p>
|
318
318
|
<p>
|
@@ -326,8 +326,8 @@ larger than <tt>max_size</tt>, then a SecurityError will be raised.
|
|
326
326
|
</p>
|
327
327
|
</div>
|
328
328
|
<div class="sourcecode">
|
329
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
330
|
-
<div id="
|
329
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">show source</a> ]</p>
|
330
|
+
<div id="M000148_source" class="dyn-source">
|
331
331
|
<pre>
|
332
332
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 133</span>
|
333
333
|
133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_scalar</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -362,13 +362,13 @@ larger than <tt>max_size</tt>, then a SecurityError will be raised.
|
|
362
362
|
</div>
|
363
363
|
<div class="method">
|
364
364
|
<div class="title">
|
365
|
-
<a name="
|
365
|
+
<a name="M000151"></a><b>recv_io</b>()
|
366
366
|
</div>
|
367
367
|
<div class="description">
|
368
368
|
<p>
|
369
369
|
Receive an <a href="../IO.html">IO</a> object (a file descriptor) from the
|
370
370
|
channel. The other side must have sent an <a href="../IO.html">IO</a>
|
371
|
-
object by calling <a href="MessageChannel.html#
|
371
|
+
object by calling <a href="MessageChannel.html#M000152">send_io</a>(). Note
|
372
372
|
that this only works on Unix sockets.
|
373
373
|
</p>
|
374
374
|
<p>
|
@@ -377,8 +377,8 @@ wrong.
|
|
377
377
|
</p>
|
378
378
|
</div>
|
379
379
|
<div class="sourcecode">
|
380
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
381
|
-
<div id="
|
380
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000151_source')" id="l_M000151_source">show source</a> ]</p>
|
381
|
+
<div id="M000151_source" class="dyn-source">
|
382
382
|
<pre>
|
383
383
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 196</span>
|
384
384
|
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">recv_io</span>
|
@@ -390,13 +390,13 @@ wrong.
|
|
390
390
|
</div>
|
391
391
|
<div class="method">
|
392
392
|
<div class="title">
|
393
|
-
<a name="
|
393
|
+
<a name="M000152"></a><b>send_io</b>(io)
|
394
394
|
</div>
|
395
395
|
<div class="description">
|
396
396
|
<p>
|
397
397
|
Send an <a href="../IO.html">IO</a> object (a file descriptor) over the
|
398
398
|
channel. The other side must receive the <a href="../IO.html">IO</a> object
|
399
|
-
by calling <a href="MessageChannel.html#
|
399
|
+
by calling <a href="MessageChannel.html#M000151">recv_io</a>(). Note that
|
400
400
|
this only works on Unix sockets.
|
401
401
|
</p>
|
402
402
|
<p>
|
@@ -405,8 +405,8 @@ wrong.
|
|
405
405
|
</p>
|
406
406
|
</div>
|
407
407
|
<div class="sourcecode">
|
408
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
409
|
-
<div id="
|
408
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000152_source')" id="l_M000152_source">show source</a> ]</p>
|
409
|
+
<div id="M000152_source" class="dyn-source">
|
410
410
|
<pre>
|
411
411
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 206</span>
|
412
412
|
206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_io</span>(<span class="ruby-identifier">io</span>)
|
@@ -418,7 +418,7 @@ wrong.
|
|
418
418
|
</div>
|
419
419
|
<div class="method">
|
420
420
|
<div class="title">
|
421
|
-
<a name="
|
421
|
+
<a name="M000149"></a><b>write</b>(name, *args)
|
422
422
|
</div>
|
423
423
|
<div class="description">
|
424
424
|
<p>
|
@@ -433,8 +433,8 @@ wrong.
|
|
433
433
|
</p>
|
434
434
|
</div>
|
435
435
|
<div class="sourcecode">
|
436
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
437
|
-
<div id="
|
436
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
|
437
|
+
<div id="M000149_source" class="dyn-source">
|
438
438
|
<pre>
|
439
439
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 167</span>
|
440
440
|
167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
@@ -456,7 +456,7 @@ wrong.
|
|
456
456
|
</div>
|
457
457
|
<div class="method">
|
458
458
|
<div class="title">
|
459
|
-
<a name="
|
459
|
+
<a name="M000150"></a><b>write_scalar</b>(data)
|
460
460
|
</div>
|
461
461
|
<div class="description">
|
462
462
|
<p>
|
@@ -469,8 +469,8 @@ wrong.
|
|
469
469
|
</p>
|
470
470
|
</div>
|
471
471
|
<div class="sourcecode">
|
472
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
473
|
-
<div id="
|
472
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000150_source')" id="l_M000150_source">show source</a> ]</p>
|
473
|
+
<div id="M000150_source" class="dyn-source">
|
474
474
|
<pre>
|
475
475
|
<span class="ruby-comment cmt"># File lib/phusion_passenger/message_channel.rb, line 185</span>
|
476
476
|
185: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_scalar</span>(<span class="ruby-identifier">data</span>)
|
@@ -106,11 +106,11 @@ Class for spawning <a href="../Rack.html">Rack</a> applications.
|
|
106
106
|
<p class="source-link">[ <a href="javascript:toggleSource('M000040_source')" id="l_M000040_source">show source</a> ]</p>
|
107
107
|
<div id="M000040_source" class="dyn-source">
|
108
108
|
<pre>
|
109
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 39</span>
|
110
|
+
39: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
111
|
+
40: <span class="ruby-ivar">@@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">ApplicationSpawner</span>.<span class="ruby-identifier">new</span>
|
112
|
+
41: <span class="ruby-ivar">@@instance</span>.<span class="ruby-identifier">spawn_application</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
113
|
+
42: <span class="ruby-keyword kw">end</span>
|
114
114
|
</pre>
|
115
115
|
</div>
|
116
116
|
</div>
|
@@ -147,35 +147,35 @@ exit() during startup.
|
|
147
147
|
<p class="source-link">[ <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show source</a> ]</p>
|
148
148
|
<div id="M000041_source" class="dyn-source">
|
149
149
|
<pre>
|
150
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
150
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/application_spawner.rb, line 54</span>
|
151
|
+
54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span> = {})
|
152
|
+
55: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
|
153
|
+
56:
|
154
|
+
57: <span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span> = <span class="ruby-constant">UNIXSocket</span>.<span class="ruby-identifier">pair</span>
|
155
|
+
58: <span class="ruby-identifier">pid</span> = <span class="ruby-identifier">safe_fork</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">true</span>) <span class="ruby-keyword kw">do</span>
|
156
|
+
59: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">close</span>
|
157
|
+
60:
|
158
|
+
61: <span class="ruby-identifier">file_descriptors_to_leave_open</span> = [<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-value">2</span>, <span class="ruby-identifier">b</span>.<span class="ruby-identifier">fileno</span>]
|
159
|
+
62: <span class="ruby-constant">NativeSupport</span>.<span class="ruby-identifier">close_all_file_descriptors</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
|
160
|
+
63: <span class="ruby-identifier">close_all_io_objects_for_fds</span>(<span class="ruby-identifier">file_descriptors_to_leave_open</span>)
|
157
161
|
64:
|
158
|
-
65: <span class="ruby-identifier">
|
159
|
-
66:
|
160
|
-
67:
|
161
|
-
68:
|
162
|
-
69:
|
163
|
-
70: <span class="ruby-
|
164
|
-
71: <span class="ruby-identifier">
|
165
|
-
72:
|
166
|
-
73:
|
167
|
-
74: <span class="ruby-identifier">
|
168
|
-
75: <span class="ruby-
|
169
|
-
76:
|
170
|
-
77: <span class="ruby-
|
171
|
-
78: <span class="ruby-identifier">
|
172
|
-
79: <span class="ruby-keyword kw">
|
173
|
-
80: <span class="ruby-identifier">
|
174
|
-
81:
|
175
|
-
82: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">recv_io</span>
|
176
|
-
83: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>,
|
177
|
-
84: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
|
178
|
-
85: <span class="ruby-keyword kw">end</span>
|
162
|
+
65: <span class="ruby-identifier">run</span>(<span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>), <span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span>)
|
163
|
+
66: <span class="ruby-keyword kw">end</span>
|
164
|
+
67: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">close</span>
|
165
|
+
68: <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
166
|
+
69:
|
167
|
+
70: <span class="ruby-identifier">channel</span> = <span class="ruby-constant">MessageChannel</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">a</span>)
|
168
|
+
71: <span class="ruby-identifier">unmarshal_and_raise_errors</span>(<span class="ruby-identifier">channel</span>, <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value str">"print_exceptions"</span>], <span class="ruby-value str">"rack"</span>)
|
169
|
+
72:
|
170
|
+
73: <span class="ruby-comment cmt"># No exception was raised, so spawning succeeded.</span>
|
171
|
+
74: <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>, <span class="ruby-identifier">socket_type</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">read</span>
|
172
|
+
75: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
|
173
|
+
76: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">"Connection closed"</span>
|
174
|
+
77: <span class="ruby-keyword kw">end</span>
|
175
|
+
78: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">channel</span>.<span class="ruby-identifier">recv_io</span>
|
176
|
+
79: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">socket_name</span>,
|
177
|
+
80: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
|
178
|
+
81: <span class="ruby-keyword kw">end</span>
|
179
179
|
</pre>
|
180
180
|
</div>
|
181
181
|
</div>
|
@@ -107,11 +107,11 @@ A request handler for <a href="../Rack.html">Rack</a> applications.
|
|
107
107
|
<p class="source-link">[ <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show source</a> ]</p>
|
108
108
|
<div id="M000042_source" class="dyn-source">
|
109
109
|
<pre>
|
110
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
110
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 56</span>
|
111
|
+
56: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {})
|
112
|
+
57: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span>)
|
113
|
+
58: <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span>
|
114
|
+
59: <span class="ruby-keyword kw">end</span>
|
115
115
|
</pre>
|
116
116
|
</div>
|
117
117
|
</div>
|
@@ -130,63 +130,63 @@ Overrided method.
|
|
130
130
|
<p class="source-link">[ <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show source</a> ]</p>
|
131
131
|
<div id="M000043_source" class="dyn-source">
|
132
132
|
<pre>
|
133
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
133
|
+
<span class="ruby-comment cmt"># File lib/phusion_passenger/rack/request_handler.rb, line 63</span>
|
134
|
+
63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">env</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>)
|
135
|
+
64: <span class="ruby-identifier">rewindable_input</span> = <span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">RewindableInput</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input</span>)
|
136
|
+
65: <span class="ruby-keyword kw">begin</span>
|
137
|
+
66: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_VERSION</span>] = <span class="ruby-constant">RACK_VERSION_VALUE</span>
|
138
|
+
67: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_INPUT</span>] = <span class="ruby-identifier">rewindable_input</span>
|
139
|
+
68: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_ERRORS</span>] = <span class="ruby-constant">STDERR</span>
|
140
|
+
69: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTITHREAD</span>] = <span class="ruby-keyword kw">false</span>
|
141
|
+
70: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_MULTIPROCESS</span>] = <span class="ruby-keyword kw">true</span>
|
142
|
+
71: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_RUN_ONCE</span>] = <span class="ruby-keyword kw">false</span>
|
143
|
+
72:
|
144
|
+
73: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
|
145
|
+
74: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>)
|
146
|
+
75: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
|
147
|
+
76: <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>]
|
145
148
|
77: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_LENGTH</span>)
|
146
|
-
78: <span class="ruby-keyword kw">
|
147
|
-
79:
|
148
|
-
80: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">
|
149
|
-
81: <span class="ruby-keyword kw">
|
150
|
-
82:
|
149
|
+
78: <span class="ruby-keyword kw">end</span>
|
150
|
+
79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>]
|
151
|
+
80: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_TYPE</span>)
|
152
|
+
81: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>]
|
153
|
+
82: <span class="ruby-identifier">env</span>[<span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTP_CONTENT_TYPE</span>]
|
151
154
|
83: <span class="ruby-identifier">env</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">HTTP_CONTENT_TYPE</span>)
|
152
|
-
84: <span class="ruby-keyword kw">
|
153
|
-
85:
|
154
|
-
86:
|
155
|
-
87:
|
156
|
-
88:
|
157
|
-
89:
|
158
|
-
90:
|
159
|
-
91:
|
160
|
-
92:
|
161
|
-
93: <span class="ruby-keyword kw">
|
162
|
-
94:
|
163
|
-
95:
|
164
|
-
96:
|
165
|
-
97:
|
166
|
-
98:
|
167
|
-
99:
|
168
|
-
100: <span class="ruby-
|
169
|
-
101: <span class="ruby-identifier">
|
155
|
+
84: <span class="ruby-keyword kw">end</span>
|
156
|
+
85:
|
157
|
+
86: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">YES</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ON</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env</span>[<span class="ruby-constant">HTTPS</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">ONE</span>
|
158
|
+
87: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTPS_DOWNCASE</span>
|
159
|
+
88: <span class="ruby-keyword kw">else</span>
|
160
|
+
89: <span class="ruby-identifier">env</span>[<span class="ruby-constant">RACK_URL_SCHEME</span>] = <span class="ruby-constant">HTTP</span>
|
161
|
+
90: <span class="ruby-keyword kw">end</span>
|
162
|
+
91:
|
163
|
+
92: <span class="ruby-identifier">status</span>, <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">body</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>)
|
164
|
+
93: <span class="ruby-keyword kw">begin</span>
|
165
|
+
94: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">"Status: #{status.to_i}#{CRLF}"</span>)
|
166
|
+
95: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">"X-Powered-By: #{PASSENGER_HEADER}#{CRLF}"</span>)
|
167
|
+
96: <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">values</span><span class="ruby-operator">|</span>
|
168
|
+
97: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
169
|
+
98: <span class="ruby-identifier">values</span> = <span class="ruby-identifier">values</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"\n"</span>)
|
170
|
+
99: <span class="ruby-keyword kw">end</span>
|
171
|
+
100: <span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
172
|
+
101: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">"#{key}: #{value}#{CRLF}"</span>)
|
170
173
|
102: <span class="ruby-keyword kw">end</span>
|
171
|
-
103:
|
172
|
-
104:
|
173
|
-
105:
|
174
|
-
106:
|
175
|
-
107: <span class="ruby-
|
176
|
-
108:
|
177
|
-
109:
|
178
|
-
110:
|
179
|
-
111:
|
180
|
-
112:
|
181
|
-
113:
|
182
|
-
114:
|
183
|
-
115:
|
184
|
-
116:
|
185
|
-
117:
|
186
|
-
118:
|
187
|
-
119: <span class="ruby-identifier">rewindable_input</span>.<span class="ruby-identifier">close</span>
|
188
|
-
120: <span class="ruby-keyword kw">end</span>
|
189
|
-
121: <span class="ruby-keyword kw">end</span>
|
174
|
+
103: <span class="ruby-keyword kw">end</span>
|
175
|
+
104: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">CRLF</span>)
|
176
|
+
105: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
177
|
+
106: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">body</span>)
|
178
|
+
107: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">body</span>
|
179
|
+
108: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
180
|
+
109: <span class="ruby-identifier">output</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">s</span>)
|
181
|
+
110: <span class="ruby-keyword kw">end</span>
|
182
|
+
111: <span class="ruby-keyword kw">end</span>
|
183
|
+
112: <span class="ruby-keyword kw">ensure</span>
|
184
|
+
113: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:close</span>)
|
185
|
+
114: <span class="ruby-keyword kw">end</span>
|
186
|
+
115: <span class="ruby-keyword kw">ensure</span>
|
187
|
+
116: <span class="ruby-identifier">rewindable_input</span>.<span class="ruby-identifier">close</span>
|
188
|
+
117: <span class="ruby-keyword kw">end</span>
|
189
|
+
118: <span class="ruby-keyword kw">end</span>
|
190
190
|
</pre>
|
191
191
|
</div>
|
192
192
|
</div>
|