passenger 4.0.14 → 4.0.16

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.

Files changed (121) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +69 -0
  3. data/bin/passenger-install-apache2-module +7 -1
  4. data/bin/passenger-install-nginx-module +18 -1
  5. data/build/apache2.rb +25 -1
  6. data/build/basics.rb +7 -4
  7. data/build/debian.rb +72 -25
  8. data/build/nginx.rb +24 -0
  9. data/build/packaging.rb +45 -3
  10. data/debian.template/{control → control.template} +17 -8
  11. data/debian.template/ruby-passenger.install.template +1 -0
  12. data/debian.template/rules.template +9 -3
  13. data/dev/run_travis.sh +14 -0
  14. data/doc/Users guide Apache.idmap.txt +64 -48
  15. data/doc/Users guide Apache.txt +127 -93
  16. data/doc/Users guide Nginx.idmap.txt +46 -28
  17. data/doc/Users guide Nginx.txt +100 -12
  18. data/doc/images/{conservative_spawning.png → direct_spawning.png} +0 -0
  19. data/doc/images/{conservative_spawning.svg → direct_spawning.svg} +0 -0
  20. data/doc/users_guide_snippets/installation.txt +107 -66
  21. data/doc/users_guide_snippets/passenger_spawn_method.txt +1 -1
  22. data/doc/users_guide_snippets/rvm_helper_tool.txt +0 -12
  23. data/doc/users_guide_snippets/tips.txt +70 -3
  24. data/doc/users_guide_snippets/under_the_hood/page_caching_support.txt +2 -0
  25. data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +114 -0
  26. data/ext/apache2/Configuration.cpp +53 -101
  27. data/ext/apache2/Configuration.hpp +19 -41
  28. data/ext/apache2/ConfigurationCommands.cpp +95 -0
  29. data/ext/apache2/ConfigurationCommands.cpp.erb +91 -0
  30. data/ext/apache2/ConfigurationFields.hpp +59 -0
  31. data/ext/apache2/ConfigurationFields.hpp.erb +89 -0
  32. data/ext/apache2/ConfigurationSetters.cpp +223 -0
  33. data/ext/apache2/ConfigurationSetters.cpp.erb +126 -0
  34. data/ext/apache2/CreateDirConfig.cpp +50 -0
  35. data/ext/apache2/CreateDirConfig.cpp.erb +71 -0
  36. data/ext/apache2/Hooks.cpp +6 -0
  37. data/ext/apache2/MergeDirConfig.cpp +103 -0
  38. data/ext/apache2/MergeDirConfig.cpp.erb +81 -0
  39. data/ext/common/ApplicationPool2/AppTypes.cpp +2 -0
  40. data/ext/common/ApplicationPool2/AppTypes.h +2 -0
  41. data/ext/common/ApplicationPool2/Common.h +1 -1
  42. data/ext/common/ApplicationPool2/Group.h +56 -7
  43. data/ext/common/ApplicationPool2/Implementation.cpp +133 -31
  44. data/ext/common/ApplicationPool2/Options.h +23 -2
  45. data/ext/common/ApplicationPool2/Pool.h +8 -1
  46. data/ext/common/ApplicationPool2/Process.h +9 -0
  47. data/ext/common/ApplicationPool2/Session.h +1 -0
  48. data/ext/common/ApplicationPool2/Spawner.h +21 -19
  49. data/ext/common/ApplicationPool2/SuperGroup.h +1 -1
  50. data/ext/common/Constants.h +21 -17
  51. data/ext/common/Constants.h.erb +1 -1
  52. data/ext/common/Exceptions.h +19 -0
  53. data/ext/common/ServerInstanceDir.h +8 -4
  54. data/ext/common/Utils.cpp +33 -1
  55. data/ext/common/Utils.h +14 -0
  56. data/ext/common/Utils/StrIntUtils.cpp +16 -0
  57. data/ext/common/Utils/StrIntUtils.h +5 -0
  58. data/ext/common/agents/HelperAgent/Main.cpp +5 -5
  59. data/ext/common/agents/HelperAgent/RequestHandler.h +94 -45
  60. data/ext/common/agents/LoggingAgent/Main.cpp +10 -26
  61. data/ext/common/agents/Watchdog/Main.cpp +4 -15
  62. data/ext/nginx/CacheLocationConfig.c +501 -0
  63. data/ext/nginx/CacheLocationConfig.c.erb +140 -0
  64. data/ext/nginx/Configuration.c +29 -453
  65. data/ext/nginx/Configuration.h +3 -21
  66. data/ext/nginx/ConfigurationCommands.c +501 -0
  67. data/ext/nginx/ConfigurationCommands.c.erb +136 -0
  68. data/ext/nginx/ConfigurationFields.h +89 -0
  69. data/ext/nginx/ConfigurationFields.h.erb +85 -0
  70. data/ext/nginx/ContentHandler.c +3 -166
  71. data/ext/nginx/CreateLocationConfig.c +146 -0
  72. data/ext/nginx/CreateLocationConfig.c.erb +70 -0
  73. data/ext/nginx/MergeLocationConfig.c +166 -0
  74. data/ext/nginx/MergeLocationConfig.c.erb +72 -0
  75. data/ext/nginx/config +4 -0
  76. data/ext/oxt/detail/tracable_exception_disabled.hpp +21 -1
  77. data/ext/oxt/detail/tracable_exception_enabled.hpp +4 -1
  78. data/ext/oxt/implementation.cpp +7 -1
  79. data/ext/oxt/macros.hpp +9 -7
  80. data/helper-scripts/backtrace-sanitizer.rb +23 -0
  81. data/helper-scripts/classic-rails-loader.rb +23 -0
  82. data/helper-scripts/classic-rails-preloader.rb +23 -0
  83. data/helper-scripts/download_binaries/extconf.rb +10 -5
  84. data/helper-scripts/meteor-loader.rb +127 -0
  85. data/helper-scripts/node-loader.js +1 -1
  86. data/helper-scripts/rack-preloader.rb +23 -0
  87. data/helper-scripts/system-memory-stats.py +22 -0
  88. data/helper-scripts/touch-dir.sh +48 -0
  89. data/lib/phusion_passenger.rb +1 -1
  90. data/lib/phusion_passenger/apache2/config_options.rb +104 -0
  91. data/lib/phusion_passenger/constants.rb +8 -0
  92. data/lib/phusion_passenger/native_support.rb +9 -1
  93. data/lib/phusion_passenger/nginx/config_options.rb +328 -0
  94. data/lib/phusion_passenger/packaging.rb +2 -2
  95. data/lib/phusion_passenger/platform_info/apache.rb +8 -0
  96. data/lib/phusion_passenger/platform_info/compiler.rb +2 -2
  97. data/lib/phusion_passenger/rails3_extensions/init.rb +19 -4
  98. data/lib/phusion_passenger/ruby_core_enhancements.rb +4 -1
  99. data/lib/phusion_passenger/standalone/app_finder.rb +3 -2
  100. data/lib/phusion_passenger/standalone/command.rb +1 -0
  101. data/lib/phusion_passenger/standalone/runtime_installer.rb +1 -6
  102. data/lib/phusion_passenger/standalone/runtime_locator.rb +9 -2
  103. data/lib/phusion_passenger/standalone/start_command.rb +45 -9
  104. data/lib/phusion_passenger/utils.rb +4 -1
  105. data/resources/templates/{nginx → installer_common}/run_installer_as_root.txt.erb +3 -1
  106. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +6 -0
  107. data/resources/templates/standalone/config.erb +8 -8
  108. data/test/cxx/ApplicationPool2/PoolTest.cpp +120 -3
  109. data/test/cxx/RequestHandlerTest.cpp +66 -3
  110. data/test/integration_tests/native_packaging_spec.rb +41 -0
  111. data/test/integration_tests/nginx_tests.rb +1 -0
  112. data/test/integration_tests/standalone_tests.rb +4 -0
  113. data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +22 -0
  114. data/test/stub/rails3.0/config/initializers/passenger.rb +2 -1
  115. data/test/stub/rails3.1/config/initializers/passenger.rb +2 -1
  116. data/test/stub/rails3.2/config/initializers/passenger.rb +2 -1
  117. data/test/stub/rails4.0/config/initializers/passenger.rb +5 -1
  118. data/test/stub/wsgi/passenger_wsgi.py +5 -0
  119. metadata +32 -7
  120. metadata.gz.asc +7 -7
  121. data/resources/templates/apache2/run_installer_as_root.txt.erb +0 -8
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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
+
26
+ /*
27
+ * ConfigurationSetters.cpp is automatically generated from ConfigurationSetters.cpp.erb,
28
+ * using definitions from lib/phusion_passenger/apache2/config_options.rb.
29
+ * Edits to ConfigurationSetters.cpp will be lost.
30
+ *
31
+ * To update ConfigurationSetters.cpp:
32
+ * rake apache2
33
+ *
34
+ * To force regeneration of ConfigurationSetters.cpp:
35
+ * rm -f ext/apache2/ConfigurationSetters.cpp
36
+ * rake ext/apache2/ConfigurationSetters.cpp
37
+ */
38
+
39
+ <%
40
+ require 'phusion_passenger/apache2/config_options'
41
+
42
+ def filter_eligible_options(options)
43
+ return options.reject do |option|
44
+ option[:alias_for] ||
45
+ option.fetch(:field, true).nil? ||
46
+ option[:field].to_s =~ /\./
47
+ end
48
+ end
49
+
50
+ def struct_field_for(option)
51
+ if option.has_key?(:field)
52
+ return option[:field]
53
+ else
54
+ result = option[:name].sub(/^Passenger/, '')
55
+ result[0] = result[0..0].downcase
56
+ return result
57
+ end
58
+ end
59
+
60
+ def min_value_for(option)
61
+ return option[:min_value] || 0
62
+ end
63
+
64
+ def function_for(option)
65
+ function_name = option[:name].gsub(/[A-Z]/) do |letter|
66
+ "_" + letter[0..0].downcase
67
+ end
68
+ return "cmd#{function_name}"
69
+ end
70
+ %>
71
+
72
+ <% for option in filter_eligible_options(APACHE2_DIRECTORY_CONFIGURATION_OPTIONS) -%>
73
+ <% if option[:type] == :string %>
74
+ static const char *
75
+ <%= function_for(option) %>(cmd_parms *cmd, void *pcfg, const char *arg) {
76
+ DirConfig *config = (DirConfig *) pcfg;
77
+ config-><%= struct_field_for(option) %> = arg;
78
+ return NULL;
79
+ }
80
+ <% elsif option[:type] == :integer %>
81
+ static const char *
82
+ <%= function_for(option) %>(cmd_parms *cmd, void *pcfg, const char *arg) {
83
+ DirConfig *config = (DirConfig *) pcfg;
84
+ char *end;
85
+ long result;
86
+
87
+ result = strtol(arg, &end, 10);
88
+ if (*end != '\0') {
89
+ string message = "Invalid number specified for ";
90
+ message.append(cmd->directive->directive);
91
+ message.append(".");
92
+
93
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
94
+ message.size() + 1);
95
+ memcpy(messageStr, message.c_str(), message.size() + 1);
96
+ return messageStr;
97
+ <% if option[:min_value] %>
98
+ } else if (result < <%= option[:min_value] %>) {
99
+ string message = "Value for ";
100
+ message.append(cmd->directive->directive);
101
+ message.append(" must be greater than or equal to <%= option[:min_value] %>.");
102
+
103
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
104
+ message.size() + 1);
105
+ memcpy(messageStr, message.c_str(), message.size() + 1);
106
+ return messageStr;
107
+ <% end %>
108
+ } else {
109
+ config-><%= struct_field_for(option) %> = (int) result;
110
+ return NULL;
111
+ }
112
+ }
113
+ <% elsif option[:type] == :flag %>
114
+ static const char *
115
+ <%= function_for(option) %>(cmd_parms *cmd, void *pcfg, const char *arg) {
116
+ DirConfig *config = (DirConfig *) pcfg;
117
+ config-><%= struct_field_for(option) %> =
118
+ arg ?
119
+ DirConfig::ENABLED :
120
+ DirConfig::DISABLED;
121
+ return NULL;
122
+ }
123
+ <% else
124
+ raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
125
+ end %>
126
+ <% end %>
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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
+
26
+ /*
27
+ * CreateDirConfig.cpp is automatically generated from CreateDirConfig.cpp.erb,
28
+ * using definitions from lib/phusion_passenger/apache2/config_options.rb.
29
+ * Edits to CreateDirConfig.cpp will be lost.
30
+ *
31
+ * To update CreateDirConfig.cpp:
32
+ * rake apache2
33
+ *
34
+ * To force regeneration of CreateDirConfig.cpp:
35
+ * rm -f ext/apache2/CreateDirConfig.cpp
36
+ * rake ext/apache2/CreateDirConfig.cpp
37
+ */
38
+
39
+
40
+
41
+ config->ruby = NULL;
42
+ config->minInstances = UNSET_INT_VALUE;
43
+ config->user = NULL;
44
+ config->group = NULL;
45
+ config->maxRequests = UNSET_INT_VALUE;
46
+ config->startTimeout = UNSET_INT_VALUE;
47
+ config->highPerformance = DirConfig::UNSET;
48
+ config->enabled = DirConfig::UNSET;
49
+ config->maxRequestQueueSize = UNSET_INT_VALUE;
50
+
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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
+
26
+ /*
27
+ * CreateDirConfig.cpp is automatically generated from CreateDirConfig.cpp.erb,
28
+ * using definitions from lib/phusion_passenger/apache2/config_options.rb.
29
+ * Edits to CreateDirConfig.cpp will be lost.
30
+ *
31
+ * To update CreateDirConfig.cpp:
32
+ * rake apache2
33
+ *
34
+ * To force regeneration of CreateDirConfig.cpp:
35
+ * rm -f ext/apache2/CreateDirConfig.cpp
36
+ * rake ext/apache2/CreateDirConfig.cpp
37
+ */
38
+
39
+ <%
40
+ require 'phusion_passenger/apache2/config_options'
41
+
42
+ def filter_eligible_options(options)
43
+ return options.reject do |option|
44
+ option[:alias_for] ||
45
+ option.fetch(:field, true).nil? ||
46
+ option[:field].to_s =~ /\./
47
+ end
48
+ end
49
+
50
+ def struct_field_for(option)
51
+ if option.has_key?(:field)
52
+ return option[:field]
53
+ else
54
+ result = option[:name].sub(/^Passenger/, '')
55
+ result[0] = result[0..0].downcase
56
+ return result
57
+ end
58
+ end
59
+ %>
60
+
61
+ <% for option in filter_eligible_options(APACHE2_DIRECTORY_CONFIGURATION_OPTIONS) -%>
62
+ <% if option[:type] == :string -%>
63
+ config-><%= struct_field_for(option) %> = NULL;
64
+ <% elsif option[:type] == :integer -%>
65
+ config-><%= struct_field_for(option) %> = UNSET_INT_VALUE;
66
+ <% elsif option[:type] == :flag -%>
67
+ config-><%= struct_field_for(option) %> = DirConfig::UNSET;
68
+ <% else
69
+ raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
70
+ end -%>
71
+ <% end %>
@@ -976,6 +976,10 @@ private:
976
976
  addHeader(output, "PASSENGER_SPAWN_METHOD", config->getSpawnMethodString());
977
977
  addHeader(output, "PASSENGER_USER", config->getUser());
978
978
  addHeader(output, "PASSENGER_GROUP", config->getGroup());
979
+ if (config->maxRequestQueueSize != UNSET_INT_VALUE) {
980
+ addHeader(output, "PASSENGER_MAX_REQUEST_QUEUE_SIZE",
981
+ apr_psprintf(r->pool, "%d", config->maxRequestQueueSize));
982
+ }
979
983
  addHeader(output, "PASSENGER_APP_TYPE", mapper.getApplicationTypeName());
980
984
  addHeader(output, "PASSENGER_MIN_INSTANCES",
981
985
  apr_psprintf(r->pool, "%ld", config->getMinInstances()));
@@ -985,6 +989,8 @@ private:
985
989
  addHeader(output, "PASSENGER_SHOW_VERSION_IN_HEADER", "true");
986
990
  addHeader(output, "PASSENGER_MAX_REQUESTS",
987
991
  apr_psprintf(r->pool, "%ld", config->getMaxRequests()));
992
+ addHeader(output, "PASSENGER_START_TIMEOUT",
993
+ apr_psprintf(r->pool, "%ld", config->getStartTimeout()));
988
994
  addHeader(output, "PASSENGER_STAT_THROTTLE_RATE",
989
995
  apr_psprintf(r->pool, "%ld", config->getStatThrottleRate()));
990
996
  addHeader(output, "PASSENGER_RESTART_DIR", config->getRestartDir());
@@ -0,0 +1,103 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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
+
26
+ /*
27
+ * MergeDirConfig.cpp is automatically generated from MergeDirConfig.cpp.erb,
28
+ * using definitions from lib/phusion_passenger/apache2/config_options.rb.
29
+ * Edits to MergeDirConfig.cpp will be lost.
30
+ *
31
+ * To update MergeDirConfig.cpp:
32
+ * rake apache2
33
+ *
34
+ * To force regeneration of MergeDirConfig.cpp:
35
+ * rm -f ext/apache2/MergeDirConfig.cpp
36
+ * rake ext/apache2/MergeDirConfig.cpp
37
+ */
38
+
39
+
40
+
41
+
42
+
43
+ config->ruby =
44
+ (add->ruby == NULL) ?
45
+ base->ruby :
46
+ add->ruby;
47
+
48
+
49
+
50
+ config->minInstances =
51
+ (add->minInstances == UNSET_INT_VALUE) ?
52
+ base->minInstances :
53
+ add->minInstances;
54
+
55
+
56
+
57
+ config->user =
58
+ (add->user == NULL) ?
59
+ base->user :
60
+ add->user;
61
+
62
+
63
+
64
+ config->group =
65
+ (add->group == NULL) ?
66
+ base->group :
67
+ add->group;
68
+
69
+
70
+
71
+ config->maxRequests =
72
+ (add->maxRequests == UNSET_INT_VALUE) ?
73
+ base->maxRequests :
74
+ add->maxRequests;
75
+
76
+
77
+
78
+ config->startTimeout =
79
+ (add->startTimeout == UNSET_INT_VALUE) ?
80
+ base->startTimeout :
81
+ add->startTimeout;
82
+
83
+
84
+
85
+ config->highPerformance =
86
+ (add->highPerformance == DirConfig::UNSET) ?
87
+ base->highPerformance :
88
+ add->highPerformance;
89
+
90
+
91
+
92
+ config->enabled =
93
+ (add->enabled == DirConfig::UNSET) ?
94
+ base->enabled :
95
+ add->enabled;
96
+
97
+
98
+
99
+ config->maxRequestQueueSize =
100
+ (add->maxRequestQueueSize == UNSET_INT_VALUE) ?
101
+ base->maxRequestQueueSize :
102
+ add->maxRequestQueueSize;
103
+
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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
+
26
+ /*
27
+ * MergeDirConfig.cpp is automatically generated from MergeDirConfig.cpp.erb,
28
+ * using definitions from lib/phusion_passenger/apache2/config_options.rb.
29
+ * Edits to MergeDirConfig.cpp will be lost.
30
+ *
31
+ * To update MergeDirConfig.cpp:
32
+ * rake apache2
33
+ *
34
+ * To force regeneration of MergeDirConfig.cpp:
35
+ * rm -f ext/apache2/MergeDirConfig.cpp
36
+ * rake ext/apache2/MergeDirConfig.cpp
37
+ */
38
+
39
+ <%
40
+ require 'phusion_passenger/apache2/config_options'
41
+
42
+ def filter_eligible_options(options)
43
+ return options.reject do |option|
44
+ option[:alias_for] ||
45
+ option.fetch(:field, true).nil? ||
46
+ option[:field].to_s =~ /\./ ||
47
+ !option.fetch(:auto_generate_nginx_merge_code, true)
48
+ end
49
+ end
50
+
51
+ def struct_field_for(option)
52
+ if option.has_key?(:field)
53
+ return option[:field]
54
+ else
55
+ result = option[:name].sub(/^Passenger/, '')
56
+ result[0] = result[0..0].downcase
57
+ return result
58
+ end
59
+ end
60
+ %>
61
+
62
+ <% for option in filter_eligible_options(APACHE2_DIRECTORY_CONFIGURATION_OPTIONS) %>
63
+ <% if option[:type] == :string %>
64
+ config-><%= struct_field_for(option) %> =
65
+ (add-><%= struct_field_for(option) %> == NULL) ?
66
+ base-><%= struct_field_for(option) %> :
67
+ add-><%= struct_field_for(option) %>;
68
+ <% elsif option[:type] == :integer %>
69
+ config-><%= struct_field_for(option) %> =
70
+ (add-><%= struct_field_for(option) %> == UNSET_INT_VALUE) ?
71
+ base-><%= struct_field_for(option) %> :
72
+ add-><%= struct_field_for(option) %>;
73
+ <% elsif option[:type] == :flag %>
74
+ config-><%= struct_field_for(option) %> =
75
+ (add-><%= struct_field_for(option) %> == DirConfig::UNSET) ?
76
+ base-><%= struct_field_for(option) %> :
77
+ add-><%= struct_field_for(option) %>;
78
+ <% else
79
+ raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}"
80
+ end %>
81
+ <% end %>