passenger 5.0.28 → 5.0.29
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.
- checksums.yaml +4 -4
- data/.editorconfig +5 -0
- data/CHANGELOG +13 -0
- data/build/apache2.rb +3 -3
- data/build/common_library.rb +3 -3
- data/build/nginx.rb +4 -4
- data/build/packaging.rb +9 -8
- data/build/support/cxx_dependency_map.rb +9 -7
- data/build/support/general.rb +39 -0
- data/build/support/vendor/cxxcodebuilder/CxxCodeBuilder.sublime-project +8 -0
- data/build/support/vendor/cxxcodebuilder/Gemfile +4 -0
- data/build/support/vendor/cxxcodebuilder/Gemfile.lock +28 -0
- data/build/support/vendor/cxxcodebuilder/LICENSE.md +19 -0
- data/build/support/vendor/cxxcodebuilder/README.md +98 -0
- data/build/support/vendor/cxxcodebuilder/Rakefile +4 -0
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +23 -0
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +574 -0
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +166 -0
- data/build/test_basics.rb +2 -1
- data/resources/templates/standalone/server.erb +6 -4
- data/src/agent/Core/Controller/ForwardResponse.cpp +5 -5
- data/src/agent/Watchdog/WatchdogMain.cpp +0 -10
- data/src/apache2_module/ConfigurationCommands.cpp +181 -248
- data/src/apache2_module/ConfigurationCommands.cpp.cxxcodebuilder +127 -0
- data/src/apache2_module/ConfigurationFields.hpp +135 -51
- data/src/apache2_module/ConfigurationFields.hpp.cxxcodebuilder +113 -0
- data/src/apache2_module/ConfigurationSetters.cpp +414 -459
- data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +144 -0
- data/src/apache2_module/CreateDirConfig.cpp +49 -52
- data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +81 -0
- data/src/apache2_module/Hooks.cpp +0 -14
- data/src/apache2_module/MergeDirConfig.cpp +136 -226
- data/src/apache2_module/MergeDirConfig.cpp.cxxcodebuilder +97 -0
- data/src/apache2_module/SetHeaders.cpp +92 -143
- data/src/apache2_module/SetHeaders.cpp.cxxcodebuilder +106 -0
- data/src/cxx_supportlib/Constants.h +86 -146
- data/src/cxx_supportlib/Constants.h.cxxcodebuilder +43 -0
- data/src/cxx_supportlib/DataStructures/LString.h +40 -23
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +60 -25
- data/src/cxx_supportlib/MemoryKit/mbuf.h +50 -25
- data/src/cxx_supportlib/ServerKit/CookieUtils.h +36 -3
- data/src/cxx_supportlib/ServerKit/HeaderTable.h +2 -8
- data/src/cxx_supportlib/ServerKit/HttpServer.h +6 -15
- data/src/cxx_supportlib/WatchdogLauncher.cpp +4 -4
- data/src/cxx_supportlib/WatchdogLauncher.h +2 -3
- data/src/nginx_module/CacheLocationConfig.c +623 -780
- data/src/nginx_module/CacheLocationConfig.c.cxxcodebuilder +214 -0
- data/src/nginx_module/Configuration.h +1 -1
- data/src/nginx_module/ConfigurationCommands.c +404 -535
- data/src/nginx_module/ConfigurationCommands.c.cxxcodebuilder +157 -0
- data/src/nginx_module/CreateLocationConfig.c +82 -206
- data/src/nginx_module/CreateLocationConfig.c.cxxcodebuilder +98 -0
- data/src/nginx_module/LocationConfig.h +97 -0
- data/src/nginx_module/LocationConfig.h.cxxcodebuilder +131 -0
- data/src/nginx_module/MergeLocationConfig.c +157 -278
- data/src/nginx_module/MergeLocationConfig.c.cxxcodebuilder +144 -0
- data/src/nginx_module/ngx_http_passenger_module.c +4 -10
- data/src/ruby_supportlib/phusion_passenger.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +2 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +6 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +27 -8
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +120 -2
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +5 -5
- metadata +24 -15
- data/src/apache2_module/ConfigurationCommands.cpp.erb +0 -109
- data/src/apache2_module/ConfigurationFields.hpp.erb +0 -98
- data/src/apache2_module/ConfigurationSetters.cpp.erb +0 -128
- data/src/apache2_module/CreateDirConfig.cpp.erb +0 -72
- data/src/apache2_module/MergeDirConfig.cpp.erb +0 -82
- data/src/apache2_module/SetHeaders.cpp.erb +0 -91
- data/src/cxx_supportlib/Constants.h.erb +0 -41
- data/src/nginx_module/CacheLocationConfig.c.erb +0 -171
- data/src/nginx_module/ConfigurationCommands.c.erb +0 -144
- data/src/nginx_module/ConfigurationFields.h +0 -145
- data/src/nginx_module/ConfigurationFields.h.erb +0 -112
- data/src/nginx_module/CreateLocationConfig.c.erb +0 -78
- data/src/nginx_module/MergeLocationConfig.c.erb +0 -118
@@ -0,0 +1,98 @@
|
|
1
|
+
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
+
# Copyright (c) 2010-2016 Phusion Holding B.V.
|
3
|
+
#
|
4
|
+
# "Passenger", "Phusion Passenger" and "Union Station" are registered
|
5
|
+
# trademarks of Phusion Holding B.V.
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
# THE SOFTWARE.
|
24
|
+
|
25
|
+
# This file uses the cxxcodebuilder API. Learn more at:
|
26
|
+
# https://github.com/phusion/passenger/cxxcodebuilder
|
27
|
+
|
28
|
+
require 'phusion_passenger/nginx/config_options'
|
29
|
+
|
30
|
+
def main
|
31
|
+
set_indent_string ' '
|
32
|
+
comment copyright_header_for(__FILE__)
|
33
|
+
|
34
|
+
separator
|
35
|
+
|
36
|
+
comment %q{
|
37
|
+
CreateLocationConfig.c is automatically generated from CreateLocationConfig.c.cxxcodebuilder,
|
38
|
+
using definitions from src/ruby_supportlib/phusion_passenger/nginx/config_options.rb.
|
39
|
+
Edits to CreateLocationConfig.c will be lost.
|
40
|
+
|
41
|
+
To update CreateLocationConfig.c:
|
42
|
+
rake nginx
|
43
|
+
|
44
|
+
To force regeneration of CreateLocationConfig.c:
|
45
|
+
rm -f src/nginx_module/CreateLocationConfig.c
|
46
|
+
rake src/nginx_module/CreateLocationConfig.c
|
47
|
+
}
|
48
|
+
|
49
|
+
separator
|
50
|
+
|
51
|
+
function('void generated_set_conf_part(passenger_loc_conf_t *conf)') do
|
52
|
+
filter_eligible_options(LOCATION_CONFIGURATION_OPTIONS).each do |option|
|
53
|
+
if option[:type] == :string
|
54
|
+
add_code %Q{
|
55
|
+
conf->#{struct_field_for(option)}.data = NULL;
|
56
|
+
conf->#{struct_field_for(option)}.len = 0;
|
57
|
+
}
|
58
|
+
elsif option[:type] == :integer || option[:type] == :flag
|
59
|
+
add_code %Q{
|
60
|
+
conf->#{struct_field_for(option)} = NGX_CONF_UNSET;
|
61
|
+
}
|
62
|
+
elsif option[:type] == :uinteger
|
63
|
+
add_code %Q{
|
64
|
+
conf->#{struct_field_for(option)} = NGX_CONF_UNSET_UINT;
|
65
|
+
}
|
66
|
+
elsif option[:type] == :string_array
|
67
|
+
add_code %Q{
|
68
|
+
conf->#{struct_field_for(option)} = NGX_CONF_UNSET_PTR;
|
69
|
+
}
|
70
|
+
elsif option[:type] == :string_keyval
|
71
|
+
add_code %Q{
|
72
|
+
conf->#{struct_field_for(option)} = NULL;
|
73
|
+
}
|
74
|
+
else
|
75
|
+
raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def filter_eligible_options(options)
|
82
|
+
options.reject do |option|
|
83
|
+
option[:alias_for] ||
|
84
|
+
option.fetch(:field, true).nil? ||
|
85
|
+
option[:field].to_s =~ /\./ ||
|
86
|
+
option[:auto_generate_nginx_create_code] == false
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def struct_field_for(option)
|
91
|
+
if option.has_key?(:field)
|
92
|
+
option[:field]
|
93
|
+
else
|
94
|
+
option[:name].sub(/^passenger_/, '')
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
main
|
@@ -0,0 +1,97 @@
|
|
1
|
+
/*
|
2
|
+
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
+
* Copyright (c) 2010-2016 Phusion Holding B.V.
|
4
|
+
*
|
5
|
+
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
|
+
* trademarks of Phusion Holding B.V.
|
7
|
+
*
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
13
|
+
* furnished to do so, subject to the following conditions:
|
14
|
+
*
|
15
|
+
* The above copyright notice and this permission notice shall be included in
|
16
|
+
* all copies or substantial portions of the Software.
|
17
|
+
*
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
* THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
|
27
|
+
/*
|
28
|
+
* LocationConfig.h is automatically generated from LocationConfig.h.cxxcodebuilder,
|
29
|
+
* using definitions from src/ruby_supportlib/phusion_passenger/nginx/config_options.rb.
|
30
|
+
* Edits to LocationConfig.h will be lost.
|
31
|
+
*
|
32
|
+
* To update LocationConfig.h:
|
33
|
+
* rake nginx
|
34
|
+
*
|
35
|
+
* To force regeneration of LocationConfig.h:
|
36
|
+
* rm -f src/nginx_module/LocationConfig.h
|
37
|
+
* rake src/nginx_module/LocationConfig.h
|
38
|
+
*/
|
39
|
+
|
40
|
+
typedef struct {
|
41
|
+
ngx_http_upstream_conf_t upstream_config;
|
42
|
+
ngx_array_t *flushes;
|
43
|
+
ngx_array_t *headers_set_len;
|
44
|
+
ngx_array_t *headers_set;
|
45
|
+
ngx_hash_t headers_set_hash;
|
46
|
+
|
47
|
+
/** Raw HTTP header data for this location are cached here. */
|
48
|
+
ngx_str_t options_cache;
|
49
|
+
ngx_str_t env_vars_cache;
|
50
|
+
|
51
|
+
ngx_int_t abort_websockets_on_process_shutdown;
|
52
|
+
ngx_uint_t app_file_descriptor_ulimit;
|
53
|
+
ngx_array_t *base_uris;
|
54
|
+
ngx_uint_t core_file_descriptor_ulimit;
|
55
|
+
ngx_int_t debugger;
|
56
|
+
ngx_int_t enabled;
|
57
|
+
ngx_array_t *env_vars;
|
58
|
+
ngx_int_t force_max_concurrent_requests_per_process;
|
59
|
+
ngx_int_t friendly_error_pages;
|
60
|
+
ngx_uint_t headers_hash_bucket_size;
|
61
|
+
ngx_uint_t headers_hash_max_size;
|
62
|
+
ngx_array_t *headers_source;
|
63
|
+
ngx_int_t load_shell_envvars;
|
64
|
+
ngx_int_t max_instances_per_app;
|
65
|
+
ngx_int_t max_preloader_idle_time;
|
66
|
+
ngx_int_t max_request_queue_size;
|
67
|
+
ngx_int_t max_requests;
|
68
|
+
ngx_int_t min_instances;
|
69
|
+
ngx_int_t request_queue_overflow_status_code;
|
70
|
+
ngx_int_t socket_backlog;
|
71
|
+
ngx_int_t start_timeout;
|
72
|
+
ngx_int_t sticky_sessions;
|
73
|
+
ngx_array_t *union_station_filters;
|
74
|
+
ngx_int_t union_station_support;
|
75
|
+
ngx_str_t app_group_name;
|
76
|
+
ngx_str_t app_rights;
|
77
|
+
ngx_str_t app_root;
|
78
|
+
ngx_str_t app_type;
|
79
|
+
ngx_str_t document_root;
|
80
|
+
ngx_str_t environment;
|
81
|
+
ngx_str_t group;
|
82
|
+
ngx_str_t meteor_app_settings;
|
83
|
+
ngx_str_t nodejs;
|
84
|
+
ngx_str_t python;
|
85
|
+
ngx_str_t restart_dir;
|
86
|
+
ngx_str_t ruby;
|
87
|
+
ngx_str_t spawn_method;
|
88
|
+
ngx_str_t startup_file;
|
89
|
+
ngx_str_t sticky_sessions_cookie_name;
|
90
|
+
ngx_str_t union_station_key;
|
91
|
+
ngx_str_t user;
|
92
|
+
ngx_str_t vary_turbocache_by_cookie;
|
93
|
+
|
94
|
+
#if (NGX_HTTP_CACHE)
|
95
|
+
ngx_http_complex_value_t cache_key;
|
96
|
+
#endif
|
97
|
+
} passenger_loc_conf_t;
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
+
# Copyright (c) 2010-2016 Phusion Holding B.V.
|
3
|
+
#
|
4
|
+
# "Passenger", "Phusion Passenger" and "Union Station" are registered
|
5
|
+
# trademarks of Phusion Holding B.V.
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
# THE SOFTWARE.
|
24
|
+
|
25
|
+
# This file uses the cxxcodebuilder API. Learn more at:
|
26
|
+
# https://github.com/phusion/passenger/cxxcodebuilder
|
27
|
+
|
28
|
+
require 'phusion_passenger/nginx/config_options'
|
29
|
+
|
30
|
+
def main
|
31
|
+
set_indent_string ' '
|
32
|
+
comment copyright_header_for(__FILE__)
|
33
|
+
|
34
|
+
separator
|
35
|
+
|
36
|
+
comment %q{
|
37
|
+
LocationConfig.h is automatically generated from LocationConfig.h.cxxcodebuilder,
|
38
|
+
using definitions from src/ruby_supportlib/phusion_passenger/nginx/config_options.rb.
|
39
|
+
Edits to LocationConfig.h will be lost.
|
40
|
+
|
41
|
+
To update LocationConfig.h:
|
42
|
+
rake nginx
|
43
|
+
|
44
|
+
To force regeneration of LocationConfig.h:
|
45
|
+
rm -f src/nginx_module/LocationConfig.h
|
46
|
+
rake src/nginx_module/LocationConfig.h
|
47
|
+
}
|
48
|
+
|
49
|
+
separator
|
50
|
+
|
51
|
+
typedef_struct 'passenger_loc_conf_t' do
|
52
|
+
add_code %q{
|
53
|
+
ngx_http_upstream_conf_t upstream_config;
|
54
|
+
ngx_array_t *flushes;
|
55
|
+
ngx_array_t *headers_set_len;
|
56
|
+
ngx_array_t *headers_set;
|
57
|
+
ngx_hash_t headers_set_hash;
|
58
|
+
|
59
|
+
/** Raw HTTP header data for this location are cached here. */
|
60
|
+
ngx_str_t options_cache;
|
61
|
+
ngx_str_t env_vars_cache;
|
62
|
+
}
|
63
|
+
|
64
|
+
separator
|
65
|
+
|
66
|
+
definitions.each do |definition|
|
67
|
+
field(definition[0])
|
68
|
+
end
|
69
|
+
|
70
|
+
separator
|
71
|
+
|
72
|
+
add_code %q{
|
73
|
+
#if (NGX_HTTP_CACHE)
|
74
|
+
ngx_http_complex_value_t cache_key;
|
75
|
+
#endif
|
76
|
+
}
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def filter_eligible_options(options)
|
81
|
+
options.reject do |option|
|
82
|
+
option[:alias_for] ||
|
83
|
+
option.fetch(:field, true).nil? ||
|
84
|
+
option[:field].to_s =~ /\./
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def struct_field_for(option)
|
89
|
+
if option.has_key?(:field)
|
90
|
+
option[:field].to_s
|
91
|
+
else
|
92
|
+
option[:name].sub(/^passenger_/, '')
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
# Returns [definition_source, estimated_size_on_x86_64, field_name]
|
97
|
+
def definition_for(option)
|
98
|
+
field = struct_field_for(option)
|
99
|
+
case option[:type]
|
100
|
+
when :string
|
101
|
+
return ["ngx_str_t #{field}", 8 + 4, field]
|
102
|
+
when :integer, :flag
|
103
|
+
return ["ngx_int_t #{field}", 8, field]
|
104
|
+
when :uinteger
|
105
|
+
return ["ngx_uint_t #{field}", 8, field]
|
106
|
+
when :string_array, :string_keyval
|
107
|
+
return ["ngx_array_t *#{field}", 8, field];
|
108
|
+
else
|
109
|
+
raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def definitions
|
114
|
+
@definitions ||= begin
|
115
|
+
eligible_options = filter_eligible_options(LOCATION_CONFIGURATION_OPTIONS)
|
116
|
+
definitions = eligible_options.map { |o| definition_for(o) }
|
117
|
+
# Sort the definitions by size in order to make the struct smaller.
|
118
|
+
# It's possible to make it even smaller with a smarter algorithm but for now
|
119
|
+
# I don't bother.
|
120
|
+
definitions.sort! do |d1, d2|
|
121
|
+
if d1[1] == d2[1]
|
122
|
+
# After sorting on size, sort alphabetically.
|
123
|
+
d1[2] <=> d2[2]
|
124
|
+
else
|
125
|
+
d1[1] <=> d2[1]
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
main
|
@@ -1,31 +1,31 @@
|
|
1
1
|
/*
|
2
|
-
*
|
3
|
-
*
|
2
|
+
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
+
* Copyright (c) 2010-2016 Phusion Holding B.V.
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
5
|
+
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
|
+
* trademarks of Phusion Holding B.V.
|
7
7
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
*
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
13
|
+
* furnished to do so, subject to the following conditions:
|
14
14
|
*
|
15
|
-
*
|
16
|
-
*
|
15
|
+
* The above copyright notice and this permission notice shall be included in
|
16
|
+
* all copies or substantial portions of the Software.
|
17
17
|
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
* THE SOFTWARE.
|
25
25
|
*/
|
26
26
|
|
27
27
|
/*
|
28
|
-
* MergeLocationConfig.c is automatically generated from MergeLocationConfig.c.
|
28
|
+
* MergeLocationConfig.c is automatically generated from MergeLocationConfig.c.cxxcodebuilder,
|
29
29
|
* using definitions from src/ruby_supportlib/phusion_passenger/nginx/config_options.rb.
|
30
30
|
* Edits to MergeLocationConfig.c will be lost.
|
31
31
|
*
|
@@ -37,262 +37,141 @@
|
|
37
37
|
* rake src/nginx_module/MergeLocationConfig.c
|
38
38
|
*/
|
39
39
|
|
40
|
-
/*
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
NGX_CONF_UNSET);
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
if (merge_string_array(cf, &prev->union_station_filters, &conf->union_station_filters) != NGX_OK) {
|
181
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
182
|
-
"cannot merge \"union_station_filter\" configurations");
|
183
|
-
return 0;
|
184
|
-
}
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
ngx_conf_merge_value(conf->debugger,
|
189
|
-
prev->debugger,
|
190
|
-
NGX_CONF_UNSET);
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
ngx_conf_merge_value(conf->max_preloader_idle_time,
|
195
|
-
prev->max_preloader_idle_time,
|
196
|
-
NGX_CONF_UNSET);
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
if (merge_string_keyval_table(cf, &prev->env_vars, &conf->env_vars) != NGX_OK) {
|
201
|
-
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
202
|
-
"cannot merge \"passenger_env_var\" configurations");
|
203
|
-
return 0;
|
204
|
-
}
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
ngx_conf_merge_uint_value(conf->headers_hash_max_size,
|
209
|
-
prev->headers_hash_max_size,
|
210
|
-
512);
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
ngx_conf_merge_uint_value(conf->headers_hash_bucket_size,
|
215
|
-
prev->headers_hash_bucket_size,
|
216
|
-
64);
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
ngx_conf_merge_str_value(conf->spawn_method,
|
221
|
-
prev->spawn_method,
|
222
|
-
NULL);
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
ngx_conf_merge_value(conf->load_shell_envvars,
|
227
|
-
prev->load_shell_envvars,
|
228
|
-
NGX_CONF_UNSET);
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
ngx_conf_merge_str_value(conf->union_station_key,
|
233
|
-
prev->union_station_key,
|
234
|
-
NULL);
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
ngx_conf_merge_value(conf->max_request_queue_size,
|
239
|
-
prev->max_request_queue_size,
|
240
|
-
NGX_CONF_UNSET);
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
ngx_conf_merge_value(conf->request_queue_overflow_status_code,
|
245
|
-
prev->request_queue_overflow_status_code,
|
246
|
-
NGX_CONF_UNSET);
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
ngx_conf_merge_str_value(conf->restart_dir,
|
251
|
-
prev->restart_dir,
|
252
|
-
NULL);
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
ngx_conf_merge_str_value(conf->app_type,
|
257
|
-
prev->app_type,
|
258
|
-
NULL);
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
ngx_conf_merge_str_value(conf->startup_file,
|
263
|
-
prev->startup_file,
|
264
|
-
NULL);
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
ngx_conf_merge_value(conf->sticky_sessions,
|
269
|
-
prev->sticky_sessions,
|
270
|
-
NGX_CONF_UNSET);
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
ngx_conf_merge_str_value(conf->sticky_sessions_cookie_name,
|
275
|
-
prev->sticky_sessions_cookie_name,
|
276
|
-
NULL);
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
ngx_conf_merge_str_value(conf->vary_turbocache_by_cookie,
|
281
|
-
prev->vary_turbocache_by_cookie,
|
282
|
-
NULL);
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
ngx_conf_merge_value(conf->abort_websockets_on_process_shutdown,
|
287
|
-
prev->abort_websockets_on_process_shutdown,
|
288
|
-
NGX_CONF_UNSET);
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
ngx_conf_merge_value(conf->force_max_concurrent_requests_per_process,
|
293
|
-
prev->force_max_concurrent_requests_per_process,
|
294
|
-
NGX_CONF_UNSET);
|
295
|
-
|
296
|
-
|
297
|
-
return 1;
|
40
|
+
/*
|
41
|
+
* 0: NGX_CONF_ERROR, 1: OK
|
42
|
+
*/
|
43
|
+
int
|
44
|
+
generated_merge_part(passenger_loc_conf_t *conf, passenger_loc_conf_t *prev, ngx_conf_t *cf) {
|
45
|
+
ngx_conf_merge_value(conf->socket_backlog,
|
46
|
+
prev->socket_backlog,
|
47
|
+
NGX_CONF_UNSET);
|
48
|
+
ngx_conf_merge_uint_value(conf->core_file_descriptor_ulimit,
|
49
|
+
prev->core_file_descriptor_ulimit,
|
50
|
+
NGX_CONF_UNSET_UINT);
|
51
|
+
ngx_conf_merge_uint_value(conf->app_file_descriptor_ulimit,
|
52
|
+
prev->app_file_descriptor_ulimit,
|
53
|
+
NGX_CONF_UNSET_UINT);
|
54
|
+
ngx_conf_merge_value(conf->enabled,
|
55
|
+
prev->enabled,
|
56
|
+
NGX_CONF_UNSET);
|
57
|
+
ngx_conf_merge_str_value(conf->ruby,
|
58
|
+
prev->ruby,
|
59
|
+
NULL);
|
60
|
+
ngx_conf_merge_str_value(conf->python,
|
61
|
+
prev->python,
|
62
|
+
NULL);
|
63
|
+
ngx_conf_merge_str_value(conf->nodejs,
|
64
|
+
prev->nodejs,
|
65
|
+
NULL);
|
66
|
+
ngx_conf_merge_str_value(conf->meteor_app_settings,
|
67
|
+
prev->meteor_app_settings,
|
68
|
+
NULL);
|
69
|
+
ngx_conf_merge_str_value(conf->environment,
|
70
|
+
prev->environment,
|
71
|
+
NULL);
|
72
|
+
ngx_conf_merge_value(conf->friendly_error_pages,
|
73
|
+
prev->friendly_error_pages,
|
74
|
+
NGX_CONF_UNSET);
|
75
|
+
ngx_conf_merge_value(conf->min_instances,
|
76
|
+
prev->min_instances,
|
77
|
+
NGX_CONF_UNSET);
|
78
|
+
ngx_conf_merge_value(conf->max_instances_per_app,
|
79
|
+
prev->max_instances_per_app,
|
80
|
+
NGX_CONF_UNSET);
|
81
|
+
ngx_conf_merge_value(conf->max_requests,
|
82
|
+
prev->max_requests,
|
83
|
+
NGX_CONF_UNSET);
|
84
|
+
ngx_conf_merge_value(conf->start_timeout,
|
85
|
+
prev->start_timeout,
|
86
|
+
NGX_CONF_UNSET);
|
87
|
+
if (merge_string_array(cf, &prev->base_uris, &conf->base_uris) != NGX_OK) {
|
88
|
+
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
89
|
+
"cannot merge \"passenger_base_uri\" configurations");
|
90
|
+
return 0;
|
91
|
+
}
|
92
|
+
ngx_conf_merge_str_value(conf->document_root,
|
93
|
+
prev->document_root,
|
94
|
+
NULL);
|
95
|
+
ngx_conf_merge_str_value(conf->user,
|
96
|
+
prev->user,
|
97
|
+
NULL);
|
98
|
+
ngx_conf_merge_str_value(conf->group,
|
99
|
+
prev->group,
|
100
|
+
NULL);
|
101
|
+
ngx_conf_merge_str_value(conf->app_group_name,
|
102
|
+
prev->app_group_name,
|
103
|
+
NULL);
|
104
|
+
ngx_conf_merge_str_value(conf->app_root,
|
105
|
+
prev->app_root,
|
106
|
+
NULL);
|
107
|
+
ngx_conf_merge_str_value(conf->app_rights,
|
108
|
+
prev->app_rights,
|
109
|
+
NULL);
|
110
|
+
ngx_conf_merge_value(conf->union_station_support,
|
111
|
+
prev->union_station_support,
|
112
|
+
NGX_CONF_UNSET);
|
113
|
+
if (merge_string_array(cf, &prev->union_station_filters, &conf->union_station_filters) != NGX_OK) {
|
114
|
+
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
115
|
+
"cannot merge \"union_station_filter\" configurations");
|
116
|
+
return 0;
|
117
|
+
}
|
118
|
+
ngx_conf_merge_value(conf->debugger,
|
119
|
+
prev->debugger,
|
120
|
+
NGX_CONF_UNSET);
|
121
|
+
ngx_conf_merge_value(conf->max_preloader_idle_time,
|
122
|
+
prev->max_preloader_idle_time,
|
123
|
+
NGX_CONF_UNSET);
|
124
|
+
if (merge_string_keyval_table(cf, &prev->env_vars, &conf->env_vars) != NGX_OK) {
|
125
|
+
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
126
|
+
"cannot merge \"passenger_env_var\" configurations");
|
127
|
+
return 0;
|
128
|
+
}
|
129
|
+
ngx_conf_merge_uint_value(conf->headers_hash_max_size,
|
130
|
+
prev->headers_hash_max_size,
|
131
|
+
512);
|
132
|
+
ngx_conf_merge_uint_value(conf->headers_hash_bucket_size,
|
133
|
+
prev->headers_hash_bucket_size,
|
134
|
+
64);
|
135
|
+
ngx_conf_merge_str_value(conf->spawn_method,
|
136
|
+
prev->spawn_method,
|
137
|
+
NULL);
|
138
|
+
ngx_conf_merge_value(conf->load_shell_envvars,
|
139
|
+
prev->load_shell_envvars,
|
140
|
+
NGX_CONF_UNSET);
|
141
|
+
ngx_conf_merge_str_value(conf->union_station_key,
|
142
|
+
prev->union_station_key,
|
143
|
+
NULL);
|
144
|
+
ngx_conf_merge_value(conf->max_request_queue_size,
|
145
|
+
prev->max_request_queue_size,
|
146
|
+
NGX_CONF_UNSET);
|
147
|
+
ngx_conf_merge_value(conf->request_queue_overflow_status_code,
|
148
|
+
prev->request_queue_overflow_status_code,
|
149
|
+
NGX_CONF_UNSET);
|
150
|
+
ngx_conf_merge_str_value(conf->restart_dir,
|
151
|
+
prev->restart_dir,
|
152
|
+
NULL);
|
153
|
+
ngx_conf_merge_str_value(conf->app_type,
|
154
|
+
prev->app_type,
|
155
|
+
NULL);
|
156
|
+
ngx_conf_merge_str_value(conf->startup_file,
|
157
|
+
prev->startup_file,
|
158
|
+
NULL);
|
159
|
+
ngx_conf_merge_value(conf->sticky_sessions,
|
160
|
+
prev->sticky_sessions,
|
161
|
+
NGX_CONF_UNSET);
|
162
|
+
ngx_conf_merge_str_value(conf->sticky_sessions_cookie_name,
|
163
|
+
prev->sticky_sessions_cookie_name,
|
164
|
+
NULL);
|
165
|
+
ngx_conf_merge_str_value(conf->vary_turbocache_by_cookie,
|
166
|
+
prev->vary_turbocache_by_cookie,
|
167
|
+
NULL);
|
168
|
+
ngx_conf_merge_value(conf->abort_websockets_on_process_shutdown,
|
169
|
+
prev->abort_websockets_on_process_shutdown,
|
170
|
+
NGX_CONF_UNSET);
|
171
|
+
ngx_conf_merge_value(conf->force_max_concurrent_requests_per_process,
|
172
|
+
prev->force_max_concurrent_requests_per_process,
|
173
|
+
NGX_CONF_UNSET);
|
174
|
+
|
175
|
+
return 1;
|
298
176
|
}
|
177
|
+
|