passenger 2.2.1 → 2.2.2
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/Rakefile +66 -79
- data/bin/passenger-install-nginx-module +1 -1
- data/bin/passenger-memory-stats +1 -1
- data/bin/passenger-spawn-server +8 -2
- data/doc/Users guide Apache.html +33 -49
- data/doc/Users guide Apache.txt +28 -27
- data/doc/Users guide Nginx.html +9 -19
- data/doc/Users guide Nginx.txt +8 -20
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/Configuration_8h-source.html +297 -300
- 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 -23
- 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/users_guide_snippets/rackup_specifications.txt +4 -2
- data/ext/apache2/Configuration.h +0 -3
- data/ext/apache2/Hooks.cpp +5 -3
- data/ext/common/ApplicationPoolServer.h +1 -0
- data/ext/common/ApplicationPoolServerExecutable.cpp +5 -2
- data/ext/common/SpawnManager.h +1 -0
- data/ext/common/Utils.cpp +22 -23
- data/ext/common/Utils.h +32 -21
- data/ext/common/Version.h +31 -0
- data/ext/nginx/ContentHandler.c +61 -8
- data/ext/nginx/HelperServer.cpp +3 -0
- data/ext/nginx/HttpStatusExtractor.h +185 -0
- data/ext/nginx/StaticContentHandler.c +18 -3
- data/ext/nginx/config +2 -1
- data/ext/nginx/ngx_http_passenger_module.c +21 -15
- data/ext/oxt/backtrace.cpp +4 -2
- data/ext/oxt/spin_lock.hpp +3 -3
- data/lib/phusion_passenger/abstract_request_handler.rb +5 -3
- data/lib/phusion_passenger/admin_tools/control_process.rb +6 -1
- data/lib/phusion_passenger/constants.rb +2 -2
- data/lib/phusion_passenger/rack/application_spawner.rb +2 -1
- data/lib/phusion_passenger/rack/request_handler.rb +45 -35
- data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +1 -1
- data/lib/phusion_passenger/utils.rb +13 -3
- data/misc/rake/cplusplus.rb +7 -0
- data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +2 -0
- data/test/ApplicationPoolTest.cpp +39 -62
- data/test/CxxTestMain.cpp +6 -6
- data/test/HttpStatusExtractorTest.cpp +17 -0
- data/test/StandardApplicationPoolTest.cpp +2 -0
- data/test/UtilsTest.cpp +17 -28
- data/test/ruby/abstract_request_handler_spec.rb +3 -7
- data/test/ruby/utils_spec.rb +18 -13
- data/test/ruby/wsgi/application_spawner_spec.rb +5 -9
- data/test/stub/railsapp/app/controllers/{bar_controller_1.rb → bar_controller.rb} +0 -0
- data/test/stub/railsapp/app/controllers/bar_controller_1.txt +5 -0
- data/test/stub/railsapp/app/controllers/{bar_controller_2.rb → bar_controller_2.txt} +0 -0
- data/test/support/Support.h +20 -0
- data/test/support/config.rb +13 -0
- data/vendor/README +4 -3
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/COPYING +1 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/KNOWN-ISSUES +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/README +54 -7
- data/vendor/rack-1.0.0-git/Rakefile +164 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack.rb +7 -3
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/adapter/camping.rb +0 -0
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +37 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/abstract/request.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/basic.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/md5.rb +1 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/nonce.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/params.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/request.rb +2 -2
- data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +480 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/builder.rb +1 -5
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/cascade.rb +0 -0
- data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +49 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/commonlogger.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/conditionalget.rb +4 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/content_length.rb +7 -3
- data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +23 -0
- data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +96 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/directory.rb +5 -2
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/file.rb +4 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler.rb +22 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/cgi.rb +7 -3
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/evented_mongrel.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/fastcgi.rb +26 -24
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/lsws.rb +7 -4
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/mongrel.rb +5 -3
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/scgi.rb +5 -3
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/swiftiplied_mongrel.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/thin.rb +3 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/webrick.rb +11 -5
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/head.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lint.rb +138 -66
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lobster.rb +0 -0
- data/vendor/rack-1.0.0-git/lib/rack/lock.rb +16 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/methodoverride.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mime.rb +4 -4
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mock.rb +42 -5
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/recursive.rb +0 -0
- data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +106 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/request.rb +46 -10
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/response.rb +15 -3
- data/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb +98 -0
- data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +142 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/session/cookie.rb +2 -0
- data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +109 -0
- data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +100 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showexceptions.rb +2 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showstatus.rb +1 -1
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/static.rb +0 -0
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/urlmap.rb +12 -5
- data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/utils.rb +212 -65
- metadata +71 -170
- data/doc/rdoc/classes/ConditionVariable.html +0 -194
- data/doc/rdoc/classes/Exception.html +0 -120
- data/doc/rdoc/classes/GC.html +0 -113
- data/doc/rdoc/classes/IO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger.html +0 -238
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -506
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -692
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -264
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
- data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -185
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -184
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -419
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -443
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -154
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -694
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PlatformInfo.html +0 -831
- data/doc/rdoc/classes/RakeExtensions.html +0 -197
- data/doc/rdoc/classes/Signal.html +0 -134
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -240
- data/doc/rdoc/files/README.html +0 -157
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -131
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -130
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -143
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -161
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -175
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
- data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
- data/doc/rdoc/fr_class_index.html +0 -90
- data/doc/rdoc/fr_file_index.html +0 -76
- data/doc/rdoc/fr_method_index.html +0 -195
- data/doc/rdoc/index.html +0 -26
- data/doc/rdoc/rdoc-style.css +0 -187
- data/vendor/rack-0.9.1/AUTHORS +0 -8
- data/vendor/rack-0.9.1/ChangeLog +0 -1423
- data/vendor/rack-0.9.1/Rakefile +0 -188
- data/vendor/rack-0.9.1/SPEC +0 -129
- data/vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb +0 -28
- data/vendor/rack-0.9.1/lib/rack/auth/openid.rb +0 -438
- data/vendor/rack-0.9.1/lib/rack/deflater.rb +0 -87
- data/vendor/rack-0.9.1/lib/rack/reloader.rb +0 -64
- data/vendor/rack-0.9.1/lib/rack/session/abstract/id.rb +0 -153
- data/vendor/rack-0.9.1/lib/rack/session/memcache.rb +0 -97
- data/vendor/rack-0.9.1/lib/rack/session/pool.rb +0 -73
@@ -1,153 +0,0 @@
|
|
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
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: PhusionPassenger::AbstractInstaller</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
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "show source"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "hide source"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::AbstractInstaller</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../../files/lib/phusion_passenger/abstract_installer_rb.html">lib/phusion_passenger/abstract_installer.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
Object
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
</table>
|
70
|
-
</td>
|
71
|
-
</tr>
|
72
|
-
</table>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
<div id="content">
|
77
|
-
|
78
|
-
<div class="description"><p>
|
79
|
-
Abstract base class for installers. Used by
|
80
|
-
passenger-install-apache2-module and passenger-install-nginx-module.
|
81
|
-
</p>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
<div class="sectiontitle">Methods</div>
|
87
|
-
<ul>
|
88
|
-
<li><a href="#M000148">new</a></li>
|
89
|
-
<li><a href="#M000149">start</a></li>
|
90
|
-
</ul>
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<div class="sectiontitle">Constants</div>
|
96
|
-
<table border='0' cellpadding='5'>
|
97
|
-
<tr valign='top'>
|
98
|
-
<td class="attr-name">PASSENGER_WEBSITE</td>
|
99
|
-
<td>=</td>
|
100
|
-
<td class="attr-value">"http://www.modrails.com/"</td>
|
101
|
-
</tr>
|
102
|
-
<tr valign='top'>
|
103
|
-
<td class="attr-name">PHUSION_WEBSITE</td>
|
104
|
-
<td>=</td>
|
105
|
-
<td class="attr-value">"www.phusion.nl"</td>
|
106
|
-
</tr>
|
107
|
-
</table>
|
108
|
-
|
109
|
-
|
110
|
-
<div class="sectiontitle">Public Class methods</div>
|
111
|
-
<div class="method">
|
112
|
-
<div class="title">
|
113
|
-
<a name="M000148"></a><b>new</b>(options = {})
|
114
|
-
</div>
|
115
|
-
<div class="sourcecode">
|
116
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000148_source')" id="l_M000148_source">show source</a> ]</p>
|
117
|
-
<div id="M000148_source" class="dyn-source">
|
118
|
-
<pre>
|
119
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_installer.rb, line 36</span>
|
120
|
-
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
|
121
|
-
37: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
122
|
-
38: <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{key}"</span><span class="ruby-node">"@#{key}"</span>, <span class="ruby-identifier">value</span>)
|
123
|
-
39: <span class="ruby-keyword kw">end</span>
|
124
|
-
40: <span class="ruby-keyword kw">end</span>
|
125
|
-
</pre>
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
<div class="sectiontitle">Public Instance methods</div>
|
130
|
-
<div class="method">
|
131
|
-
<div class="title">
|
132
|
-
<a name="M000149"></a><b>start</b>()
|
133
|
-
</div>
|
134
|
-
<div class="sourcecode">
|
135
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000149_source')" id="l_M000149_source">show source</a> ]</p>
|
136
|
-
<div id="M000149_source" class="dyn-source">
|
137
|
-
<pre>
|
138
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_installer.rb, line 42</span>
|
139
|
-
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
|
140
|
-
43: <span class="ruby-identifier">install!</span>
|
141
|
-
44: <span class="ruby-keyword kw">ensure</span>
|
142
|
-
45: <span class="ruby-identifier">reset_terminal_colors</span>
|
143
|
-
46: <span class="ruby-keyword kw">end</span>
|
144
|
-
</pre>
|
145
|
-
</div>
|
146
|
-
</div>
|
147
|
-
</div>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
</div>
|
151
|
-
|
152
|
-
</body>
|
153
|
-
</html>
|
@@ -1,506 +0,0 @@
|
|
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
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: PhusionPassenger::AbstractRequestHandler</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
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "show source"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "hide source"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::AbstractRequestHandler</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../../files/lib/phusion_passenger/abstract_request_handler_rb.html">lib/phusion_passenger/abstract_request_handler.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
Object
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
</table>
|
70
|
-
</td>
|
71
|
-
</tr>
|
72
|
-
</table>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
<div id="content">
|
77
|
-
|
78
|
-
<div class="description"><p>
|
79
|
-
The request handler is the layer which connects Apache with the underlying
|
80
|
-
application‘s request dispatcher (i.e. either Rails‘s
|
81
|
-
Dispatcher class or <a href="Rack.html">Rack</a>). The request
|
82
|
-
handler‘s job is to process incoming HTTP requests using the
|
83
|
-
currently loaded Ruby on Rails application. HTTP requests are forwarded to
|
84
|
-
the request handler by the web server. HTTP responses generated by the RoR
|
85
|
-
application are forwarded to the web server, which, in turn, sends the
|
86
|
-
response back to the HTTP client.
|
87
|
-
</p>
|
88
|
-
<p>
|
89
|
-
<a href="AbstractRequestHandler.html">AbstractRequestHandler</a> is an
|
90
|
-
abstract base class for easing the implementation of request handlers for
|
91
|
-
Rails and <a href="Rack.html">Rack</a>.
|
92
|
-
</p>
|
93
|
-
<h2>Design decisions</h2>
|
94
|
-
<p>
|
95
|
-
Some design decisions are made because we want to decrease system
|
96
|
-
administrator maintenance overhead. These decisions are documented in this
|
97
|
-
section.
|
98
|
-
</p>
|
99
|
-
<h3>Owner pipes</h3>
|
100
|
-
<p>
|
101
|
-
Because only the web server communicates directly with a request handler,
|
102
|
-
we want the request handler to exit if the web server has also exited. This
|
103
|
-
is implemented by using a so-called _owner pipe_. The writable part of the
|
104
|
-
pipe will be passed to the web server* via a Unix socket, and the web
|
105
|
-
server will own that part of the pipe, while <a
|
106
|
-
href="AbstractRequestHandler.html">AbstractRequestHandler</a> owns the
|
107
|
-
readable part of the pipe. <a
|
108
|
-
href="AbstractRequestHandler.html">AbstractRequestHandler</a> will
|
109
|
-
continuously check whether the other side of the pipe has been closed. If
|
110
|
-
so, then it knows that the web server has exited, and so the request
|
111
|
-
handler will exit as well. This works even if the web server gets killed by
|
112
|
-
SIGKILL.
|
113
|
-
</p>
|
114
|
-
<ul>
|
115
|
-
<li>It might also be passed to the ApplicationPoolServerExecutable, if the web
|
116
|
-
server‘s using ApplicationPoolServer instead of
|
117
|
-
StandardApplicationPool.
|
118
|
-
|
119
|
-
</li>
|
120
|
-
</ul>
|
121
|
-
<h2>Request format</h2>
|
122
|
-
<p>
|
123
|
-
Incoming "HTTP requests" are not true HTTP requests, i.e. their
|
124
|
-
binary representation do not conform to RFC 2616. Instead, the request
|
125
|
-
format is based on CGI, and is similar to that of SCGI.
|
126
|
-
</p>
|
127
|
-
<p>
|
128
|
-
The format consists of 3 parts:
|
129
|
-
</p>
|
130
|
-
<ul>
|
131
|
-
<li>A 32-bit big-endian integer, containing the size of the transformed
|
132
|
-
headers.
|
133
|
-
|
134
|
-
</li>
|
135
|
-
<li>The transformed HTTP headers.
|
136
|
-
|
137
|
-
</li>
|
138
|
-
<li>The verbatim (untransformed) HTTP request body.
|
139
|
-
|
140
|
-
</li>
|
141
|
-
</ul>
|
142
|
-
<p>
|
143
|
-
HTTP headers are transformed to a format that satisfies the following
|
144
|
-
grammar:
|
145
|
-
</p>
|
146
|
-
<pre>
|
147
|
-
headers ::= header*
|
148
|
-
header ::= name NUL value NUL
|
149
|
-
name ::= notnull+
|
150
|
-
value ::= notnull+
|
151
|
-
notnull ::= "\x01" | "\x02" | "\x02" | ... | "\xFF"
|
152
|
-
NUL = "\x00"
|
153
|
-
</pre>
|
154
|
-
<p>
|
155
|
-
The web server transforms the HTTP request to the aforementioned format,
|
156
|
-
and sends it to the request handler.
|
157
|
-
</p>
|
158
|
-
</div>
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
<div class="sectiontitle">Methods</div>
|
163
|
-
<ul>
|
164
|
-
<li><a href="#M000117">cleanup</a></li>
|
165
|
-
<li><a href="#M000119">main_loop</a></li>
|
166
|
-
<li><a href="#M000118">main_loop_running?</a></li>
|
167
|
-
<li><a href="#M000116">new</a></li>
|
168
|
-
<li><a href="#M000120">start_main_loop_thread</a></li>
|
169
|
-
</ul>
|
170
|
-
|
171
|
-
<div class="sectiontitle">Included Modules</div>
|
172
|
-
<ul>
|
173
|
-
<li><a href="Utils.html">Utils</a></li>
|
174
|
-
</ul>
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
<div class="sectiontitle">Constants</div>
|
179
|
-
<table border='0' cellpadding='5'>
|
180
|
-
<tr valign='top'>
|
181
|
-
<td class="attr-name">HARD_TERMINATION_SIGNAL</td>
|
182
|
-
<td>=</td>
|
183
|
-
<td class="attr-value">"SIGTERM"</td>
|
184
|
-
</tr>
|
185
|
-
<tr valign='top'>
|
186
|
-
<td> </td>
|
187
|
-
<td colspan="2" class="attr-desc">
|
188
|
-
<a href="../Signal.html">Signal</a> which will cause the Rails application
|
189
|
-
to exit immediately.
|
190
|
-
|
191
|
-
</td>
|
192
|
-
</tr>
|
193
|
-
<tr valign='top'>
|
194
|
-
<td class="attr-name">SOFT_TERMINATION_SIGNAL</td>
|
195
|
-
<td>=</td>
|
196
|
-
<td class="attr-value">"SIGUSR1"</td>
|
197
|
-
</tr>
|
198
|
-
<tr valign='top'>
|
199
|
-
<td> </td>
|
200
|
-
<td colspan="2" class="attr-desc">
|
201
|
-
<a href="../Signal.html">Signal</a> which will cause the Rails application
|
202
|
-
to exit as soon as it‘s done processing a request.
|
203
|
-
|
204
|
-
</td>
|
205
|
-
</tr>
|
206
|
-
<tr valign='top'>
|
207
|
-
<td class="attr-name">BACKLOG_SIZE</td>
|
208
|
-
<td>=</td>
|
209
|
-
<td class="attr-value">100</td>
|
210
|
-
</tr>
|
211
|
-
<tr valign='top'>
|
212
|
-
<td class="attr-name">MAX_HEADER_SIZE</td>
|
213
|
-
<td>=</td>
|
214
|
-
<td class="attr-value">128 * 1024</td>
|
215
|
-
</tr>
|
216
|
-
<tr valign='top'>
|
217
|
-
<td class="attr-name">PASSENGER_HEADER</td>
|
218
|
-
<td>=</td>
|
219
|
-
<td class="attr-value">determine_passenger_header</td>
|
220
|
-
</tr>
|
221
|
-
</table>
|
222
|
-
|
223
|
-
<div class="sectiontitle">Attributes</div>
|
224
|
-
<table border='0' cellpadding='5'>
|
225
|
-
<tr valign='top'>
|
226
|
-
<td class='attr-rw'>
|
227
|
-
[R]
|
228
|
-
</td>
|
229
|
-
<td class='attr-name'>iterations</td>
|
230
|
-
<td class='attr-desc'>
|
231
|
-
The number of times the main loop has iterated so far. Mostly useful for
|
232
|
-
unit test assertions.
|
233
|
-
|
234
|
-
</td>
|
235
|
-
</tr>
|
236
|
-
<tr valign='top'>
|
237
|
-
<td class='attr-rw'>
|
238
|
-
[RW]
|
239
|
-
</td>
|
240
|
-
<td class='attr-name'>memory_limit</td>
|
241
|
-
<td class='attr-desc'>
|
242
|
-
Specifies the maximum allowed memory usage, in MB. If after having
|
243
|
-
processed a request <a
|
244
|
-
href="AbstractRequestHandler.html">AbstractRequestHandler</a> detects that
|
245
|
-
memory usage has risen above this limit, then it will gracefully exit (that
|
246
|
-
is, exit after having processed all pending requests).
|
247
|
-
|
248
|
-
<p>
|
249
|
-
A value of 0 (the default) indicates that there‘s no limit.
|
250
|
-
</p>
|
251
|
-
</td>
|
252
|
-
</tr>
|
253
|
-
<tr valign='top'>
|
254
|
-
<td class='attr-rw'>
|
255
|
-
[R]
|
256
|
-
</td>
|
257
|
-
<td class='attr-name'>processed_requests</td>
|
258
|
-
<td class='attr-desc'>
|
259
|
-
Number of requests processed so far. This includes requests that raised
|
260
|
-
exceptions.
|
261
|
-
|
262
|
-
</td>
|
263
|
-
</tr>
|
264
|
-
<tr valign='top'>
|
265
|
-
<td class='attr-rw'>
|
266
|
-
[R]
|
267
|
-
</td>
|
268
|
-
<td class='attr-name'>socket_name</td>
|
269
|
-
<td class='attr-desc'>
|
270
|
-
The name of the socket on which the request handler accepts <a
|
271
|
-
href="AbstractRequestHandler.html#M000116">new</a> connections. At this
|
272
|
-
moment, this value is always the filename of a Unix domain socket.
|
273
|
-
|
274
|
-
<p>
|
275
|
-
See also #socket_type.
|
276
|
-
</p>
|
277
|
-
</td>
|
278
|
-
</tr>
|
279
|
-
<tr valign='top'>
|
280
|
-
<td class='attr-rw'>
|
281
|
-
[R]
|
282
|
-
</td>
|
283
|
-
<td class='attr-name'>socket_type</td>
|
284
|
-
<td class='attr-desc'>
|
285
|
-
The type of socket that #socket_name refers to. At the moment, the value is
|
286
|
-
always ‘unix’, which indicates a Unix domain socket.
|
287
|
-
|
288
|
-
</td>
|
289
|
-
</tr>
|
290
|
-
</table>
|
291
|
-
|
292
|
-
<div class="sectiontitle">Public Class methods</div>
|
293
|
-
<div class="method">
|
294
|
-
<div class="title">
|
295
|
-
<a name="M000116"></a><b>new</b>(owner_pipe, options = {})
|
296
|
-
</div>
|
297
|
-
<div class="description">
|
298
|
-
<p>
|
299
|
-
Create a <a href="AbstractRequestHandler.html#M000116">new</a>
|
300
|
-
RequestHandler with the given owner pipe. <tt>owner_pipe</tt> must be the
|
301
|
-
readable part of a pipe <a href="../IO.html">IO</a> object.
|
302
|
-
</p>
|
303
|
-
<p>
|
304
|
-
Additionally, the following options may be given:
|
305
|
-
</p>
|
306
|
-
<ul>
|
307
|
-
<li>memory_limit: Used to set the <tt>memory_limit</tt> attribute.
|
308
|
-
|
309
|
-
</li>
|
310
|
-
</ul>
|
311
|
-
</div>
|
312
|
-
<div class="sourcecode">
|
313
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000116_source')" id="l_M000116_source">show source</a> ]</p>
|
314
|
-
<div id="M000116_source" class="dyn-source">
|
315
|
-
<pre>
|
316
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 138</span>
|
317
|
-
138: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">owner_pipe</span>, <span class="ruby-identifier">options</span> = {})
|
318
|
-
139: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">should_use_unix_sockets?</span>
|
319
|
-
140: <span class="ruby-identifier">create_unix_socket_on_filesystem</span>
|
320
|
-
141: <span class="ruby-keyword kw">else</span>
|
321
|
-
142: <span class="ruby-identifier">create_tcp_socket</span>
|
322
|
-
143: <span class="ruby-keyword kw">end</span>
|
323
|
-
144: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close_on_exec!</span>
|
324
|
-
145: <span class="ruby-ivar">@owner_pipe</span> = <span class="ruby-identifier">owner_pipe</span>
|
325
|
-
146: <span class="ruby-ivar">@previous_signal_handlers</span> = {}
|
326
|
-
147: <span class="ruby-ivar">@main_loop_thread_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
|
327
|
-
148: <span class="ruby-ivar">@main_loop_thread_cond</span> = <span class="ruby-constant">ConditionVariable</span>.<span class="ruby-identifier">new</span>
|
328
|
-
149: <span class="ruby-ivar">@memory_limit</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"memory_limit"</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
329
|
-
150: <span class="ruby-ivar">@iterations</span> = <span class="ruby-value">0</span>
|
330
|
-
151: <span class="ruby-ivar">@processed_requests</span> = <span class="ruby-value">0</span>
|
331
|
-
152: <span class="ruby-keyword kw">end</span>
|
332
|
-
</pre>
|
333
|
-
</div>
|
334
|
-
</div>
|
335
|
-
</div>
|
336
|
-
<div class="sectiontitle">Public Instance methods</div>
|
337
|
-
<div class="method">
|
338
|
-
<div class="title">
|
339
|
-
<a name="M000117"></a><b>cleanup</b>()
|
340
|
-
</div>
|
341
|
-
<div class="description">
|
342
|
-
<p>
|
343
|
-
Clean up temporary stuff created by the request handler.
|
344
|
-
</p>
|
345
|
-
<p>
|
346
|
-
If the main loop was started by <a
|
347
|
-
href="AbstractRequestHandler.html#M000119">#main_loop</a>, then this method
|
348
|
-
may only be called after the main loop has exited.
|
349
|
-
</p>
|
350
|
-
<p>
|
351
|
-
If the main loop was started by <a
|
352
|
-
href="AbstractRequestHandler.html#M000120">#start_main_loop_thread</a>,
|
353
|
-
then this method may be called at any time, and it will stop the main loop
|
354
|
-
thread.
|
355
|
-
</p>
|
356
|
-
</div>
|
357
|
-
<div class="sourcecode">
|
358
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000117_source')" id="l_M000117_source">show source</a> ]</p>
|
359
|
-
<div id="M000117_source" class="dyn-source">
|
360
|
-
<pre>
|
361
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 161</span>
|
362
|
-
161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleanup</span>
|
363
|
-
162: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@main_loop_thread</span>
|
364
|
-
163: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">Interrupt</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"Cleaning up"</span>))
|
365
|
-
164: <span class="ruby-ivar">@main_loop_thread</span>.<span class="ruby-identifier">join</span>
|
366
|
-
165: <span class="ruby-keyword kw">end</span>
|
367
|
-
166: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
368
|
-
167: <span class="ruby-ivar">@owner_pipe</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
369
|
-
168: <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-ivar">@socket_name</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
370
|
-
169: <span class="ruby-keyword kw">end</span>
|
371
|
-
</pre>
|
372
|
-
</div>
|
373
|
-
</div>
|
374
|
-
</div>
|
375
|
-
<div class="method">
|
376
|
-
<div class="title">
|
377
|
-
<a name="M000119"></a><b>main_loop</b>()
|
378
|
-
</div>
|
379
|
-
<div class="description">
|
380
|
-
<p>
|
381
|
-
Enter the request handler‘s main loop.
|
382
|
-
</p>
|
383
|
-
</div>
|
384
|
-
<div class="sourcecode">
|
385
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000119_source')" id="l_M000119_source">show source</a> ]</p>
|
386
|
-
<div id="M000119_source" class="dyn-source">
|
387
|
-
<pre>
|
388
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 177</span>
|
389
|
-
177: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop</span>
|
390
|
-
178: <span class="ruby-identifier">reset_signal_handlers</span>
|
391
|
-
179: <span class="ruby-keyword kw">begin</span>
|
392
|
-
180: <span class="ruby-ivar">@graceful_termination_pipe</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">pipe</span>
|
393
|
-
181: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close_on_exec!</span>
|
394
|
-
182: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close_on_exec!</span>
|
395
|
-
183:
|
396
|
-
184: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
397
|
-
185: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">true</span>
|
398
|
-
186: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
|
399
|
-
187: <span class="ruby-keyword kw">end</span>
|
400
|
-
188:
|
401
|
-
189: <span class="ruby-identifier">install_useful_signal_handlers</span>
|
402
|
-
190:
|
403
|
-
191: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
404
|
-
192: <span class="ruby-ivar">@iterations</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
405
|
-
193: <span class="ruby-identifier">client</span> = <span class="ruby-identifier">accept_connection</span>
|
406
|
-
194: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">nil?</span>
|
407
|
-
195: <span class="ruby-keyword kw">break</span>
|
408
|
-
196: <span class="ruby-keyword kw">end</span>
|
409
|
-
197: <span class="ruby-keyword kw">begin</span>
|
410
|
-
198: <span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span> = <span class="ruby-identifier">parse_request</span>(<span class="ruby-identifier">client</span>)
|
411
|
-
199: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>
|
412
|
-
200: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers</span>[<span class="ruby-constant">REQUEST_METHOD</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">PING</span>
|
413
|
-
201: <span class="ruby-identifier">process_ping</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
|
414
|
-
202: <span class="ruby-keyword kw">else</span>
|
415
|
-
203: <span class="ruby-identifier">process_request</span>(<span class="ruby-identifier">headers</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">client</span>)
|
416
|
-
204: <span class="ruby-keyword kw">end</span>
|
417
|
-
205: <span class="ruby-keyword kw">end</span>
|
418
|
-
206: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span>, <span class="ruby-constant">SystemCallError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
419
|
-
207: <span class="ruby-identifier">print_exception</span>(<span class="ruby-value str">"Passenger RequestHandler"</span>, <span class="ruby-identifier">e</span>)
|
420
|
-
208: <span class="ruby-keyword kw">ensure</span>
|
421
|
-
209: <span class="ruby-comment cmt"># 'input' is the same as 'client' so we don't</span>
|
422
|
-
210: <span class="ruby-comment cmt"># need to close that.</span>
|
423
|
-
211: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
424
|
-
212: <span class="ruby-keyword kw">end</span>
|
425
|
-
213: <span class="ruby-ivar">@processed_requests</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
426
|
-
214: <span class="ruby-keyword kw">end</span>
|
427
|
-
215: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>
|
428
|
-
216: <span class="ruby-comment cmt"># Exit main loop.</span>
|
429
|
-
217: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span>
|
430
|
-
218: <span class="ruby-comment cmt"># Exit main loop.</span>
|
431
|
-
219: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SignalException</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">signal</span>
|
432
|
-
220: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">HARD_TERMINATION_SIGNAL</span> <span class="ruby-operator">&&</span>
|
433
|
-
221: <span class="ruby-identifier">signal</span>.<span class="ruby-identifier">message</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">SOFT_TERMINATION_SIGNAL</span>
|
434
|
-
222: <span class="ruby-identifier">raise</span>
|
435
|
-
223: <span class="ruby-keyword kw">end</span>
|
436
|
-
224: <span class="ruby-keyword kw">ensure</span>
|
437
|
-
225: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
438
|
-
226: <span class="ruby-ivar">@graceful_termination_pipe</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
439
|
-
227: <span class="ruby-identifier">revert_signal_handlers</span>
|
440
|
-
228: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
441
|
-
229: <span class="ruby-ivar">@main_loop_running</span> = <span class="ruby-keyword kw">false</span>
|
442
|
-
230: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">broadcast</span>
|
443
|
-
231: <span class="ruby-keyword kw">end</span>
|
444
|
-
232: <span class="ruby-keyword kw">end</span>
|
445
|
-
233: <span class="ruby-keyword kw">end</span>
|
446
|
-
</pre>
|
447
|
-
</div>
|
448
|
-
</div>
|
449
|
-
</div>
|
450
|
-
<div class="method">
|
451
|
-
<div class="title">
|
452
|
-
<a name="M000118"></a><b>main_loop_running?</b>()
|
453
|
-
</div>
|
454
|
-
<div class="description">
|
455
|
-
<p>
|
456
|
-
Check whether the main loop‘s currently running.
|
457
|
-
</p>
|
458
|
-
</div>
|
459
|
-
<div class="sourcecode">
|
460
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000118_source')" id="l_M000118_source">show source</a> ]</p>
|
461
|
-
<div id="M000118_source" class="dyn-source">
|
462
|
-
<pre>
|
463
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 172</span>
|
464
|
-
172: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main_loop_running?</span>
|
465
|
-
173: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@main_loop_running</span>
|
466
|
-
174: <span class="ruby-keyword kw">end</span>
|
467
|
-
</pre>
|
468
|
-
</div>
|
469
|
-
</div>
|
470
|
-
</div>
|
471
|
-
<div class="method">
|
472
|
-
<div class="title">
|
473
|
-
<a name="M000120"></a><b>start_main_loop_thread</b>()
|
474
|
-
</div>
|
475
|
-
<div class="description">
|
476
|
-
<p>
|
477
|
-
Start the main loop in a <a
|
478
|
-
href="AbstractRequestHandler.html#M000116">new</a> thread. This thread will
|
479
|
-
be stopped by <a href="AbstractRequestHandler.html#M000117">#cleanup</a>.
|
480
|
-
</p>
|
481
|
-
</div>
|
482
|
-
<div class="sourcecode">
|
483
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000120_source')" id="l_M000120_source">show source</a> ]</p>
|
484
|
-
<div id="M000120_source" class="dyn-source">
|
485
|
-
<pre>
|
486
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/abstract_request_handler.rb, line 236</span>
|
487
|
-
236: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_main_loop_thread</span>
|
488
|
-
237: <span class="ruby-ivar">@main_loop_thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
489
|
-
238: <span class="ruby-identifier">main_loop</span>
|
490
|
-
239: <span class="ruby-keyword kw">end</span>
|
491
|
-
240: <span class="ruby-ivar">@main_loop_thread_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
|
492
|
-
241: <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@main_loop_running</span>
|
493
|
-
242: <span class="ruby-ivar">@main_loop_thread_cond</span>.<span class="ruby-identifier">wait</span>(<span class="ruby-ivar">@main_loop_thread_lock</span>)
|
494
|
-
243: <span class="ruby-keyword kw">end</span>
|
495
|
-
244: <span class="ruby-keyword kw">end</span>
|
496
|
-
245: <span class="ruby-keyword kw">end</span>
|
497
|
-
</pre>
|
498
|
-
</div>
|
499
|
-
</div>
|
500
|
-
</div>
|
501
|
-
</div>
|
502
|
-
|
503
|
-
</div>
|
504
|
-
|
505
|
-
</body>
|
506
|
-
</html>
|