passenger 4.0.48 → 4.0.49

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 (218) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.editorconfig +36 -2
  5. data/.travis.yml +1 -1
  6. data/CHANGELOG +16 -0
  7. data/Rakefile +0 -1
  8. data/build/apache2.rb +4 -4
  9. data/build/common_library.rb +18 -18
  10. data/build/cplusplus_support.rb +2 -2
  11. data/build/documentation.rb +1 -1
  12. data/build/integration_tests.rb +12 -4
  13. data/build/misc.rb +12 -7
  14. data/build/packaging.rb +14 -14
  15. data/build/preprocessor.rb +10 -10
  16. data/build/rake_extensions.rb +11 -11
  17. data/build/ruby_extension.rb +2 -2
  18. data/dev/ci/inituidgid +24 -0
  19. data/dev/ci/run_jenkins.sh +57 -0
  20. data/dev/ci/run_rpm_tests.sh +77 -0
  21. data/dev/{run_travis.sh → ci/run_travis.sh} +60 -4
  22. data/doc/Users guide Nginx.txt +2 -2
  23. data/doc/users_guide_snippets/environment_variables.txt +0 -2
  24. data/doc/users_guide_snippets/tips.txt +20 -1
  25. data/ext/apache2/Bucket.cpp +18 -18
  26. data/ext/apache2/Bucket.h +4 -4
  27. data/ext/apache2/Configuration.cpp +7 -7
  28. data/ext/apache2/Configuration.hpp +43 -43
  29. data/ext/apache2/DirectoryMapper.h +5 -5
  30. data/ext/apache2/Hooks.cpp +142 -142
  31. data/ext/apache2/MergeDirConfig.cpp +40 -40
  32. data/ext/common/Account.h +17 -17
  33. data/ext/common/AccountsDatabase.h +9 -9
  34. data/ext/common/AgentsStarter.cpp +2 -2
  35. data/ext/common/AgentsStarter.h +40 -40
  36. data/ext/common/ApplicationPool2/Common.h +10 -6
  37. data/ext/common/ApplicationPool2/ComponentInfo.h +2 -2
  38. data/ext/common/ApplicationPool2/DirectSpawner.h +17 -17
  39. data/ext/common/ApplicationPool2/DummySpawner.h +5 -5
  40. data/ext/common/ApplicationPool2/Group.h +54 -38
  41. data/ext/common/ApplicationPool2/Implementation.cpp +76 -49
  42. data/ext/common/ApplicationPool2/Options.h +98 -91
  43. data/ext/common/ApplicationPool2/Pool.h +70 -69
  44. data/ext/common/ApplicationPool2/Process.h +21 -21
  45. data/ext/common/ApplicationPool2/Session.h +11 -11
  46. data/ext/common/ApplicationPool2/SmartSpawner.h +60 -60
  47. data/ext/common/ApplicationPool2/Socket.h +19 -19
  48. data/ext/common/ApplicationPool2/Spawner.h +64 -72
  49. data/ext/common/ApplicationPool2/SpawnerFactory.h +4 -4
  50. data/ext/common/ApplicationPool2/SuperGroup.h +41 -41
  51. data/ext/common/BackgroundEventLoop.cpp +1 -1
  52. data/ext/common/BackgroundEventLoop.h +2 -2
  53. data/ext/common/Constants.h +1 -1
  54. data/ext/common/EventedBufferedInput.h +5 -5
  55. data/ext/common/EventedClient.h +51 -51
  56. data/ext/common/EventedMessageServer.h +39 -39
  57. data/ext/common/EventedServer.h +32 -32
  58. data/ext/common/Exceptions.h +23 -23
  59. data/ext/common/FileDescriptor.h +18 -18
  60. data/ext/common/Logging.cpp +1 -1
  61. data/ext/common/MessageClient.h +27 -27
  62. data/ext/common/MessageReadersWriters.h +79 -79
  63. data/ext/common/MessageServer.h +59 -59
  64. data/ext/common/RandomGenerator.h +12 -12
  65. data/ext/common/ResourceLocator.h +8 -8
  66. data/ext/common/SafeLibev.h +54 -25
  67. data/ext/common/ServerInstanceDir.h +31 -31
  68. data/ext/common/StaticString.h +50 -48
  69. data/ext/common/Utils.cpp +73 -78
  70. data/ext/common/Utils.h +6 -6
  71. data/ext/common/Utils/Base64.cpp +3 -3
  72. data/ext/common/Utils/Base64.h +7 -7
  73. data/ext/common/Utils/BlockingQueue.h +9 -9
  74. data/ext/common/Utils/BufferedIO.h +17 -17
  75. data/ext/common/Utils/CachedFileStat.hpp +16 -16
  76. data/ext/common/Utils/Dechunker.h +25 -25
  77. data/ext/common/Utils/FileChangeChecker.h +10 -10
  78. data/ext/common/Utils/MemZeroGuard.h +5 -5
  79. data/ext/common/Utils/MemoryBarrier.h +1 -1
  80. data/ext/common/Utils/MessageIO.h +61 -61
  81. data/ext/common/Utils/ProcessMetricsCollector.h +40 -40
  82. data/ext/common/Utils/ScopeGuard.h +7 -7
  83. data/ext/common/Utils/SpeedMeter.h +1 -1
  84. data/ext/common/Utils/StrIntUtils.cpp +13 -13
  85. data/ext/common/Utils/StrIntUtils.h +3 -3
  86. data/ext/common/Utils/StringScanning.h +5 -5
  87. data/ext/common/Utils/SystemMetricsCollector.h +2 -2
  88. data/ext/common/Utils/SystemTime.h +10 -10
  89. data/ext/common/Utils/Template.h +2 -2
  90. data/ext/common/Utils/Timer.h +6 -6
  91. data/ext/common/Utils/VariantMap.h +29 -29
  92. data/ext/common/agents/Base.cpp +19 -19
  93. data/ext/common/agents/HelperAgent/AgentOptions.h +1 -1
  94. data/ext/common/agents/HelperAgent/FileBackedPipe.h +6 -6
  95. data/ext/common/agents/HelperAgent/Main.cpp +44 -43
  96. data/ext/common/agents/HelperAgent/RequestHandler.cpp +4 -4
  97. data/ext/common/agents/HelperAgent/RequestHandler.h +29 -28
  98. data/ext/common/agents/HelperAgent/ScgiRequestParser.h +56 -50
  99. data/ext/common/agents/LoggingAgent/AdminController.h +8 -8
  100. data/ext/common/agents/LoggingAgent/DataStoreId.h +17 -17
  101. data/ext/common/agents/LoggingAgent/FilterSupport.h +167 -167
  102. data/ext/common/agents/LoggingAgent/LoggingServer.h +122 -122
  103. data/ext/common/agents/LoggingAgent/Main.cpp +7 -7
  104. data/ext/common/agents/LoggingAgent/RemoteSender.h +54 -54
  105. data/ext/common/agents/SpawnPreparer.cpp +4 -4
  106. data/ext/common/agents/TempDirToucher.c +2 -2
  107. data/ext/common/agents/Watchdog/AgentWatcher.cpp +47 -47
  108. data/ext/common/agents/Watchdog/HelperAgentWatcher.cpp +7 -7
  109. data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +7 -7
  110. data/ext/common/agents/Watchdog/Main.cpp +22 -22
  111. data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +9 -9
  112. data/ext/libeio/eio.c +1 -1
  113. data/ext/nginx/Configuration.c +30 -30
  114. data/ext/nginx/Configuration.h +1 -1
  115. data/ext/nginx/ContentHandler.c +54 -54
  116. data/ext/nginx/ContentHandler.h +3 -3
  117. data/ext/nginx/StaticContentHandler.c +2 -2
  118. data/ext/nginx/ngx_http_passenger_module.c +21 -21
  119. data/ext/oxt/detail/backtrace_enabled.hpp +1 -1
  120. data/ext/oxt/detail/context.hpp +1 -1
  121. data/ext/oxt/detail/spin_lock_darwin.hpp +4 -4
  122. data/ext/oxt/detail/spin_lock_gcc_x86.hpp +3 -3
  123. data/ext/oxt/detail/spin_lock_pthreads.hpp +4 -4
  124. data/ext/oxt/detail/tracable_exception_disabled.hpp +1 -1
  125. data/ext/oxt/dynamic_thread_group.hpp +18 -18
  126. data/ext/oxt/implementation.cpp +9 -8
  127. data/ext/oxt/macros.hpp +2 -2
  128. data/ext/oxt/system_calls.cpp +11 -11
  129. data/ext/oxt/system_calls.hpp +13 -13
  130. data/ext/oxt/thread.hpp +22 -14
  131. data/ext/ruby/passenger_native_support.c +55 -55
  132. data/lib/phusion_passenger.rb +24 -24
  133. data/lib/phusion_passenger/common_library.rb +2 -0
  134. data/lib/phusion_passenger/loader_shared_helpers.rb +18 -18
  135. data/lib/phusion_passenger/packaging.rb +9 -4
  136. data/lib/phusion_passenger/platform_info/apache.rb +45 -31
  137. data/lib/phusion_passenger/platform_info/compiler.rb +11 -11
  138. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  139. data/lib/phusion_passenger/request_handler/thread_handler.rb +8 -8
  140. data/lib/phusion_passenger/standalone/app_finder.rb +16 -16
  141. data/lib/phusion_passenger/standalone/command.rb +22 -22
  142. data/packaging/rpm/LICENSE.txt +19 -0
  143. data/packaging/rpm/Makefile +13 -0
  144. data/packaging/rpm/README.md +41 -0
  145. data/packaging/rpm/Vagrantfile +38 -0
  146. data/{rpm/Vagrantfile → packaging/rpm/Vagrantfile.centos} +0 -0
  147. data/packaging/rpm/build +170 -0
  148. data/packaging/rpm/create_project +41 -0
  149. data/packaging/rpm/git_update +88 -0
  150. data/packaging/rpm/image/Dockerfile +37 -0
  151. data/packaging/rpm/image/Gemfile +3 -0
  152. data/packaging/rpm/image/Gemfile.lock +12 -0
  153. data/packaging/rpm/image/RPM-GPG-KEY-amazon-ga +19 -0
  154. data/packaging/rpm/image/amazon2014-i386.cfg +96 -0
  155. data/packaging/rpm/image/amazon2014-x86_64.cfg +96 -0
  156. data/packaging/rpm/image/site-defaults.cfg +168 -0
  157. data/packaging/rpm/internal/build_tasks.rb +238 -0
  158. data/packaging/rpm/internal/dummygpg +11 -0
  159. data/packaging/rpm/internal/exec_build +42 -0
  160. data/packaging/rpm/internal/get_distro_arch +14 -0
  161. data/packaging/rpm/internal/get_distro_id +10 -0
  162. data/packaging/rpm/internal/git_update +27 -0
  163. data/packaging/rpm/internal/inituidgid +17 -0
  164. data/packaging/rpm/internal/my_init +344 -0
  165. data/packaging/rpm/internal/python27 +3 -0
  166. data/packaging/rpm/internal/repo_update +46 -0
  167. data/packaging/rpm/internal/setuser +26 -0
  168. data/packaging/rpm/internal/tracking_helper +40 -0
  169. data/packaging/rpm/jenkins_release +99 -0
  170. data/packaging/rpm/lib/build_tasks_support.rb +402 -0
  171. data/packaging/rpm/lib/preprocessor.rb +341 -0
  172. data/packaging/rpm/nginx_spec/404.html +119 -0
  173. data/packaging/rpm/nginx_spec/50x.html +119 -0
  174. data/packaging/rpm/nginx_spec/index.html +116 -0
  175. data/packaging/rpm/nginx_spec/nginx-auto-cc-gcc.patch +13 -0
  176. data/packaging/rpm/nginx_spec/nginx-logo.png +0 -0
  177. data/packaging/rpm/nginx_spec/nginx-upgrade +13 -0
  178. data/packaging/rpm/nginx_spec/nginx-upgrade.8 +151 -0
  179. data/packaging/rpm/nginx_spec/nginx.conf +131 -0
  180. data/packaging/rpm/nginx_spec/nginx.init +144 -0
  181. data/packaging/rpm/nginx_spec/nginx.logrotate +13 -0
  182. data/packaging/rpm/nginx_spec/nginx.service +15 -0
  183. data/packaging/rpm/nginx_spec/nginx.spec.template +559 -0
  184. data/packaging/rpm/nginx_spec/nginx.sysconfig +4 -0
  185. data/packaging/rpm/nginx_spec/passenger.conf +9 -0
  186. data/packaging/rpm/nginx_spec/poweredby.png +0 -0
  187. data/{rpm → packaging/rpm/passenger_spec}/apache-passenger.conf.in +0 -0
  188. data/{rpm → packaging/rpm/passenger_spec}/config.json +0 -0
  189. data/{rpm → packaging/rpm/passenger_spec}/passenger.logrotate +0 -0
  190. data/{rpm → packaging/rpm/passenger_spec}/passenger.spec.template +58 -31
  191. data/{rpm → packaging/rpm/passenger_spec}/passenger_dynamic_thread_group.patch +0 -0
  192. data/{rpm → packaging/rpm/passenger_spec}/passenger_tests_default_config_example.patch +0 -0
  193. data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +0 -0
  194. data/{rpm → packaging/rpm/passenger_spec}/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +0 -0
  195. data/packaging/rpm/repo_update +114 -0
  196. data/packaging/rpm/setup-system +60 -0
  197. data/packaging/rpm/shell +10 -0
  198. data/resources/templates/standalone/config.erb +3 -1
  199. data/test/config.json.rpm-automation +1 -1
  200. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +11 -11
  201. data/test/cxx/ApplicationPool2/OptionsTest.cpp +5 -5
  202. data/test/cxx/ApplicationPool2/PoolTest.cpp +129 -89
  203. data/test/cxx/ApplicationPool2/ProcessTest.cpp +15 -15
  204. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +22 -22
  205. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +11 -11
  206. data/test/cxx/ScgiRequestParserTest.cpp +75 -61
  207. data/test/cxx/UtilsTest.cpp +86 -85
  208. data/test/gdbinit.example +3 -0
  209. data/test/integration_tests/nginx_tests.rb +3 -3
  210. data/test/integration_tests/source_packaging_test.rb +3 -1
  211. data/test/stub/nginx/nginx.conf.erb +8 -1
  212. data/test/support/nginx_controller.rb +7 -7
  213. metadata +62 -17
  214. metadata.gz.asc +7 -7
  215. data/build/rpm.rb +0 -128
  216. data/dev/rpmtool +0 -21
  217. data/dev/test_rpm_packaging.sh +0 -28
  218. data/rpm/get_distro_id.py +0 -4
@@ -34,7 +34,7 @@ static apr_status_t bucket_read(apr_bucket *a, const char **str, apr_size_t *len
34
34
  static const apr_bucket_type_t apr_bucket_type_passenger_pipe = {
35
35
  "PASSENGER_PIPE",
36
36
  5,
37
- apr_bucket_type_t::APR_BUCKET_DATA,
37
+ apr_bucket_type_t::APR_BUCKET_DATA,
38
38
  bucket_destroy,
39
39
  bucket_read,
40
40
  apr_bucket_setaside_notimpl,
@@ -61,11 +61,11 @@ bucket_read(apr_bucket *bucket, const char **str, apr_size_t *len, apr_read_type
61
61
  char *buf;
62
62
  ssize_t ret;
63
63
  BucketData *data;
64
-
64
+
65
65
  data = (BucketData *) bucket->data;
66
66
  *str = NULL;
67
67
  *len = 0;
68
-
68
+
69
69
  if (!data->bufferResponse && block == APR_NONBLOCK_READ) {
70
70
  /*
71
71
  * The bucket brigade that Hooks::handleRequest() passes using
@@ -85,25 +85,25 @@ bucket_read(apr_bucket *bucket, const char **str, apr_size_t *len, apr_read_type
85
85
  */
86
86
  return APR_EAGAIN;
87
87
  }
88
-
88
+
89
89
  buf = (char *) apr_bucket_alloc(APR_BUCKET_BUFF_SIZE, bucket->list);
90
90
  if (buf == NULL) {
91
91
  return APR_ENOMEM;
92
92
  }
93
-
93
+
94
94
  do {
95
95
  ret = read(data->state->connection, buf, APR_BUCKET_BUFF_SIZE);
96
96
  } while (ret == -1 && errno == EINTR);
97
-
97
+
98
98
  if (ret > 0) {
99
99
  apr_bucket_heap *h;
100
-
100
+
101
101
  data->state->bytesRead += ret;
102
-
102
+
103
103
  *str = buf;
104
104
  *len = ret;
105
105
  bucket->data = NULL;
106
-
106
+
107
107
  /* Change the current bucket (which is a Passenger Bucket) into a heap bucket
108
108
  * that contains the data that we just read. This newly created heap bucket
109
109
  * will be the first in the bucket list.
@@ -111,32 +111,32 @@ bucket_read(apr_bucket *bucket, const char **str, apr_size_t *len, apr_read_type
111
111
  bucket = apr_bucket_heap_make(bucket, buf, *len, apr_bucket_free);
112
112
  h = (apr_bucket_heap *) bucket->data;
113
113
  h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
114
-
114
+
115
115
  /* And after this newly created bucket we insert a new Passenger Bucket
116
116
  * which can read the next chunk from the stream.
117
117
  */
118
118
  APR_BUCKET_INSERT_AFTER(bucket, passenger_bucket_create(
119
119
  data->state, bucket->list, data->bufferResponse));
120
-
120
+
121
121
  /* The newly created Passenger Bucket has a reference to the session
122
122
  * object, so we can delete data here.
123
123
  */
124
124
  delete data;
125
-
125
+
126
126
  return APR_SUCCESS;
127
-
127
+
128
128
  } else if (ret == 0) {
129
129
  data->state->completed = true;
130
130
  delete data;
131
131
  bucket->data = NULL;
132
-
132
+
133
133
  apr_bucket_free(buf);
134
-
134
+
135
135
  bucket = apr_bucket_immortal_make(bucket, "", 0);
136
136
  *str = (const char *) bucket->data;
137
137
  *len = 0;
138
138
  return APR_SUCCESS;
139
-
139
+
140
140
  } else /* ret == -1 */ {
141
141
  int e = errno;
142
142
  data->state->completed = true;
@@ -153,7 +153,7 @@ passenger_bucket_make(apr_bucket *bucket, const PassengerBucketStatePtr &state,
153
153
  BucketData *data = new BucketData();
154
154
  data->state = state;
155
155
  data->bufferResponse = bufferResponse;
156
-
156
+
157
157
  bucket->type = &apr_bucket_type_passenger_pipe;
158
158
  bucket->length = (apr_size_t)(-1);
159
159
  bucket->start = -1;
@@ -164,7 +164,7 @@ passenger_bucket_make(apr_bucket *bucket, const PassengerBucketStatePtr &state,
164
164
  apr_bucket *
165
165
  passenger_bucket_create(const PassengerBucketStatePtr &state, apr_bucket_alloc_t *list, bool bufferResponse) {
166
166
  apr_bucket *bucket;
167
-
167
+
168
168
  bucket = (apr_bucket *) apr_bucket_alloc(sizeof(*bucket), list);
169
169
  APR_BUCKET_INIT(bucket);
170
170
  bucket->free = apr_bucket_free;
@@ -36,24 +36,24 @@ using namespace boost;
36
36
  struct PassengerBucketState {
37
37
  /** The number of bytes that this PassengerBucket has read so far. */
38
38
  unsigned long bytesRead;
39
-
39
+
40
40
  /** Whether this PassengerBucket is completed, i.e. no more data
41
41
  * can be read from the underlying file descriptor. When true,
42
42
  * this can either mean that EOF has been reached, or that an I/O
43
43
  * error occured. Use errorCode to check whether an error occurred.
44
44
  */
45
45
  bool completed;
46
-
46
+
47
47
  /** When completed is true, errorCode contains the errno value of
48
48
  * the last read() call.
49
49
  *
50
50
  * A value of 0 means that no error occured.
51
51
  */
52
52
  int errorCode;
53
-
53
+
54
54
  /** Connection to the helper agent. */
55
55
  FileDescriptor connection;
56
-
56
+
57
57
  PassengerBucketState(const FileDescriptor &conn) {
58
58
  bytesRead = 0;
59
59
  completed = false;
@@ -186,7 +186,7 @@ create_dir_config_struct(apr_pool_t *pool) {
186
186
  void *
187
187
  passenger_config_create_dir(apr_pool_t *p, char *dirspec) {
188
188
  DirConfig *config = create_dir_config_struct(p);
189
-
189
+
190
190
  #include "CreateDirConfig.cpp"
191
191
 
192
192
  config->appRoot = NULL;
@@ -210,14 +210,14 @@ passenger_config_merge_dir(apr_pool_t *p, void *basev, void *addv) {
210
210
  DirConfig *config = create_dir_config_struct(p);
211
211
  DirConfig *base = (DirConfig *) basev;
212
212
  DirConfig *add = (DirConfig *) addv;
213
-
213
+
214
214
  #include "MergeDirConfig.cpp"
215
-
215
+
216
216
  config->baseURIs = base->baseURIs;
217
217
  for (set<string>::const_iterator it(add->baseURIs.begin()); it != add->baseURIs.end(); it++) {
218
218
  config->baseURIs.insert(*it);
219
219
  }
220
-
220
+
221
221
  MERGE_STR_CONFIG(appRoot);
222
222
  MERGE_STRING_CONFIG(appGroupName);
223
223
  config->spawnMethod = (add->spawnMethod == DirConfig::SM_UNSET) ? base->spawnMethod : add->spawnMethod;
@@ -354,7 +354,7 @@ cmd_passenger_max_preloader_idle_time(cmd_parms *cmd, void *pcfg, const char *ar
354
354
  DirConfig *config = (DirConfig *) pcfg;
355
355
  char *end;
356
356
  long int result;
357
-
357
+
358
358
  result = strtol(arg, &end, 10);
359
359
  if (*end != '\0') {
360
360
  return "Invalid number specified for PassengerMaxPreloaderIdleTime.";
@@ -513,9 +513,9 @@ const command_rec passenger_commands[] = {
513
513
  NULL,
514
514
  RSRC_CONF,
515
515
  "The spawn method to use."),
516
-
516
+
517
517
  #include "ConfigurationCommands.cpp"
518
-
518
+
519
519
  AP_INIT_TAKE1("PassengerAppGroupName",
520
520
  (Take1Func) cmd_passenger_app_group_name,
521
521
  NULL,
@@ -55,7 +55,7 @@ using namespace std;
55
55
 
56
56
  #define UNSET_INT_VALUE INT_MIN
57
57
 
58
-
58
+
59
59
  /**
60
60
  * Per-directory configuration information.
61
61
  *
@@ -65,23 +65,23 @@ using namespace std;
65
65
  struct DirConfig {
66
66
  enum Threeway { ENABLED, DISABLED, UNSET };
67
67
  enum SpawnMethod { SM_UNSET, SM_SMART, SM_DIRECT };
68
-
68
+
69
69
  #include "ConfigurationFields.hpp"
70
70
 
71
71
  std::set<std::string> baseURIs;
72
-
72
+
73
73
  /** The path to the application's root (for example: RAILS_ROOT
74
74
  * for Rails applications, directory containing 'config.ru'
75
75
  * for Rack applications). If this value is NULL, the default
76
76
  * autodetected path will be used.
77
77
  */
78
78
  const char *appRoot;
79
-
79
+
80
80
  string appGroupName;
81
-
81
+
82
82
  /** The spawn method to use. */
83
83
  SpawnMethod spawnMethod;
84
-
84
+
85
85
  /**
86
86
  * The idle timeout, in seconds, of preloader processes.
87
87
  * May also be 0 (which indicates that the application spawner should
@@ -95,62 +95,62 @@ struct DirConfig {
95
95
  * "How Phusion Passenger detects whether a virtual host is a web application".
96
96
  */
97
97
  Threeway resolveSymlinksInDocRoot;
98
-
98
+
99
99
  /**
100
100
  * Whether encoded slashes in URLs should be supported. This however conflicts
101
101
  * with mod_rewrite support because of a bug/limitation in Apache, so it's one
102
102
  * or the other.
103
103
  */
104
104
  Threeway allowEncodedSlashes;
105
-
105
+
106
106
  /**
107
107
  * Throttle the number of stat() calls on files like
108
108
  * restart.txt to the once per given number of seconds.
109
109
  */
110
110
  unsigned long statThrottleRate;
111
-
111
+
112
112
  /** Indicates whether the statThrottleRate option was
113
113
  * explicitly specified in the directory configuration. */
114
114
  bool statThrottleRateSpecified;
115
-
115
+
116
116
  /** The directory in which Passenger should look for
117
117
  * restart.txt. NULL means that the default directory
118
118
  * should be used.
119
119
  */
120
120
  const char *restartDir;
121
-
121
+
122
122
  /**
123
123
  * The directory in which Passenger should place upload buffer
124
124
  * files. NULL means that the default directory should be used.
125
125
  */
126
126
  const char *uploadBufferDir;
127
-
127
+
128
128
  string unionStationKey;
129
-
129
+
130
130
  vector<string> unionStationFilters;
131
-
131
+
132
132
  /**
133
133
  * Whether Phusion Passenger should show friendly error pages.
134
134
  */
135
135
  Threeway friendlyErrorPages;
136
-
136
+
137
137
  /**
138
138
  * Whether analytics logging should be enabled.
139
139
  */
140
140
  Threeway unionStationSupport;
141
-
141
+
142
142
  /**
143
143
  * Whether response buffering support is enabled.
144
144
  */
145
145
  Threeway bufferResponse;
146
-
146
+
147
147
  /*************************************/
148
148
  /*************************************/
149
-
149
+
150
150
  bool isEnabled() const {
151
151
  return enabled != DISABLED;
152
152
  }
153
-
153
+
154
154
  StaticString getAppGroupName(const StaticString &appRoot) const {
155
155
  if (appGroupName.empty()) {
156
156
  return appRoot;
@@ -158,7 +158,7 @@ struct DirConfig {
158
158
  return appGroupName;
159
159
  }
160
160
  }
161
-
161
+
162
162
  StaticString getSpawnMethodString() const {
163
163
  switch (spawnMethod) {
164
164
  case SM_SMART:
@@ -173,11 +173,11 @@ struct DirConfig {
173
173
  bool highPerformanceMode() const {
174
174
  return highPerformance == ENABLED;
175
175
  }
176
-
176
+
177
177
  bool allowsEncodedSlashes() const {
178
178
  return allowEncodedSlashes == ENABLED;
179
179
  }
180
-
180
+
181
181
  unsigned long getStatThrottleRate() const {
182
182
  if (statThrottleRateSpecified) {
183
183
  return statThrottleRate;
@@ -185,7 +185,7 @@ struct DirConfig {
185
185
  return 0;
186
186
  }
187
187
  }
188
-
188
+
189
189
  StaticString getRestartDir() const {
190
190
  if (restartDir != NULL) {
191
191
  return restartDir;
@@ -193,7 +193,7 @@ struct DirConfig {
193
193
  return "";
194
194
  }
195
195
  }
196
-
196
+
197
197
  string getUploadBufferDir(const ServerInstanceDir::Generation *generation) const {
198
198
  if (uploadBufferDir != NULL) {
199
199
  return uploadBufferDir;
@@ -203,11 +203,11 @@ struct DirConfig {
203
203
  return getSystemTempDir();
204
204
  }
205
205
  }
206
-
206
+
207
207
  bool showFriendlyErrorPages() const {
208
208
  return friendlyErrorPages != DISABLED;
209
209
  }
210
-
210
+
211
211
  bool useUnionStation() const {
212
212
  return unionStationSupport == ENABLED;
213
213
  }
@@ -215,14 +215,14 @@ struct DirConfig {
215
215
  bool getBufferResponse() const {
216
216
  return bufferResponse == ENABLED;
217
217
  }
218
-
218
+
219
219
  string getUnionStationFilterString() const {
220
220
  if (unionStationFilters.empty()) {
221
221
  return string();
222
222
  } else {
223
223
  string result;
224
224
  vector<string>::const_iterator it;
225
-
225
+
226
226
  for (it = unionStationFilters.begin(); it != unionStationFilters.end(); it++) {
227
227
  if (it != unionStationFilters.begin()) {
228
228
  result.append(1, '\1');
@@ -232,7 +232,7 @@ struct DirConfig {
232
232
  return result;
233
233
  }
234
234
  }
235
-
235
+
236
236
  /*************************************/
237
237
  };
238
238
 
@@ -251,43 +251,43 @@ struct ServerConfig {
251
251
 
252
252
  /** The default Ruby interpreter to use. */
253
253
  const char *defaultRuby;
254
-
254
+
255
255
  /** The log verbosity. */
256
256
  int logLevel;
257
-
257
+
258
258
  /** A file to print debug messages to, or NULL to just use STDERR. */
259
259
  const char *debugLogFile;
260
-
260
+
261
261
  /** The maximum number of simultaneously alive application
262
262
  * instances. */
263
263
  unsigned int maxPoolSize;
264
-
264
+
265
265
  /** The maximum number of seconds that an application may be
266
266
  * idle before it gets terminated. */
267
267
  unsigned int poolIdleTime;
268
-
268
+
269
269
  /** Whether user switching support is enabled. */
270
270
  bool userSwitching;
271
-
271
+
272
272
  /** See PoolOptions for more info. */
273
273
  string defaultUser;
274
274
  /** See PoolOptions for more info. */
275
275
  string defaultGroup;
276
-
276
+
277
277
  /** The temp directory that Passenger should use. */
278
278
  string tempDir;
279
-
279
+
280
280
  string unionStationGatewayAddress;
281
281
  int unionStationGatewayPort;
282
282
  string unionStationGatewayCert;
283
283
  string unionStationProxyAddress;
284
-
284
+
285
285
  /** Directory in which analytics logs should be saved. */
286
286
  string analyticsLogUser;
287
287
  string analyticsLogGroup;
288
-
288
+
289
289
  set<string> prestartURLs;
290
-
290
+
291
291
  ServerConfig() {
292
292
  root = NULL;
293
293
  defaultRuby = DEFAULT_RUBY;
@@ -305,7 +305,7 @@ struct ServerConfig {
305
305
  analyticsLogUser = DEFAULT_ANALYTICS_LOG_USER;
306
306
  analyticsLogGroup = DEFAULT_ANALYTICS_LOG_GROUP;
307
307
  }
308
-
308
+
309
309
  /** Called after the configuration files have been loaded, inside
310
310
  * the control process.
311
311
  */
@@ -317,7 +317,7 @@ struct ServerConfig {
317
317
  string("The user that PassengerDefaultUser refers to, '") +
318
318
  defaultUser + "', does not exist.");
319
319
  }
320
-
320
+
321
321
  struct group *groupEntry = getgrgid(userEntry->pw_gid);
322
322
  if (groupEntry == NULL) {
323
323
  throw ConfigurationException(
@@ -326,7 +326,7 @@ struct ServerConfig {
326
326
  "In other words, your system's user account database "
327
327
  "is broken. Please fix it."));
328
328
  }
329
-
329
+
330
330
  defaultGroup = groupEntry->gr_name;
331
331
  }
332
332
  }