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.

Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +5 -0
  3. data/CHANGELOG +13 -0
  4. data/build/apache2.rb +3 -3
  5. data/build/common_library.rb +3 -3
  6. data/build/nginx.rb +4 -4
  7. data/build/packaging.rb +9 -8
  8. data/build/support/cxx_dependency_map.rb +9 -7
  9. data/build/support/general.rb +39 -0
  10. data/build/support/vendor/cxxcodebuilder/CxxCodeBuilder.sublime-project +8 -0
  11. data/build/support/vendor/cxxcodebuilder/Gemfile +4 -0
  12. data/build/support/vendor/cxxcodebuilder/Gemfile.lock +28 -0
  13. data/build/support/vendor/cxxcodebuilder/LICENSE.md +19 -0
  14. data/build/support/vendor/cxxcodebuilder/README.md +98 -0
  15. data/build/support/vendor/cxxcodebuilder/Rakefile +4 -0
  16. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +23 -0
  17. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +574 -0
  18. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +166 -0
  19. data/build/test_basics.rb +2 -1
  20. data/resources/templates/standalone/server.erb +6 -4
  21. data/src/agent/Core/Controller/ForwardResponse.cpp +5 -5
  22. data/src/agent/Watchdog/WatchdogMain.cpp +0 -10
  23. data/src/apache2_module/ConfigurationCommands.cpp +181 -248
  24. data/src/apache2_module/ConfigurationCommands.cpp.cxxcodebuilder +127 -0
  25. data/src/apache2_module/ConfigurationFields.hpp +135 -51
  26. data/src/apache2_module/ConfigurationFields.hpp.cxxcodebuilder +113 -0
  27. data/src/apache2_module/ConfigurationSetters.cpp +414 -459
  28. data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +144 -0
  29. data/src/apache2_module/CreateDirConfig.cpp +49 -52
  30. data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +81 -0
  31. data/src/apache2_module/Hooks.cpp +0 -14
  32. data/src/apache2_module/MergeDirConfig.cpp +136 -226
  33. data/src/apache2_module/MergeDirConfig.cpp.cxxcodebuilder +97 -0
  34. data/src/apache2_module/SetHeaders.cpp +92 -143
  35. data/src/apache2_module/SetHeaders.cpp.cxxcodebuilder +106 -0
  36. data/src/cxx_supportlib/Constants.h +86 -146
  37. data/src/cxx_supportlib/Constants.h.cxxcodebuilder +43 -0
  38. data/src/cxx_supportlib/DataStructures/LString.h +40 -23
  39. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +60 -25
  40. data/src/cxx_supportlib/MemoryKit/mbuf.h +50 -25
  41. data/src/cxx_supportlib/ServerKit/CookieUtils.h +36 -3
  42. data/src/cxx_supportlib/ServerKit/HeaderTable.h +2 -8
  43. data/src/cxx_supportlib/ServerKit/HttpServer.h +6 -15
  44. data/src/cxx_supportlib/WatchdogLauncher.cpp +4 -4
  45. data/src/cxx_supportlib/WatchdogLauncher.h +2 -3
  46. data/src/nginx_module/CacheLocationConfig.c +623 -780
  47. data/src/nginx_module/CacheLocationConfig.c.cxxcodebuilder +214 -0
  48. data/src/nginx_module/Configuration.h +1 -1
  49. data/src/nginx_module/ConfigurationCommands.c +404 -535
  50. data/src/nginx_module/ConfigurationCommands.c.cxxcodebuilder +157 -0
  51. data/src/nginx_module/CreateLocationConfig.c +82 -206
  52. data/src/nginx_module/CreateLocationConfig.c.cxxcodebuilder +98 -0
  53. data/src/nginx_module/LocationConfig.h +97 -0
  54. data/src/nginx_module/LocationConfig.h.cxxcodebuilder +131 -0
  55. data/src/nginx_module/MergeLocationConfig.c +157 -278
  56. data/src/nginx_module/MergeLocationConfig.c.cxxcodebuilder +144 -0
  57. data/src/nginx_module/ngx_http_passenger_module.c +4 -10
  58. data/src/ruby_supportlib/phusion_passenger.rb +4 -4
  59. data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +2 -2
  60. data/src/ruby_supportlib/phusion_passenger/packaging.rb +2 -0
  61. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +6 -0
  62. data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
  63. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +27 -8
  64. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +120 -2
  65. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +1 -1
  66. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -4
  67. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +1 -1
  68. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +5 -5
  69. metadata +24 -15
  70. data/src/apache2_module/ConfigurationCommands.cpp.erb +0 -109
  71. data/src/apache2_module/ConfigurationFields.hpp.erb +0 -98
  72. data/src/apache2_module/ConfigurationSetters.cpp.erb +0 -128
  73. data/src/apache2_module/CreateDirConfig.cpp.erb +0 -72
  74. data/src/apache2_module/MergeDirConfig.cpp.erb +0 -82
  75. data/src/apache2_module/SetHeaders.cpp.erb +0 -91
  76. data/src/cxx_supportlib/Constants.h.erb +0 -41
  77. data/src/nginx_module/CacheLocationConfig.c.erb +0 -171
  78. data/src/nginx_module/ConfigurationCommands.c.erb +0 -144
  79. data/src/nginx_module/ConfigurationFields.h +0 -145
  80. data/src/nginx_module/ConfigurationFields.h.erb +0 -112
  81. data/src/nginx_module/CreateLocationConfig.c.erb +0 -78
  82. data/src/nginx_module/MergeLocationConfig.c.erb +0 -118
@@ -1,31 +1,31 @@
1
1
  /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2015 Phusion Holding B.V.
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2016 Phusion Holding B.V.
4
4
  *
5
- * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
- * trademarks of Phusion Holding B.V.
5
+ * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ * trademarks of Phusion Holding B.V.
7
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:
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
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
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
- * 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.
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
- * ConfigurationSetters.cpp is automatically generated from ConfigurationSetters.cpp.erb,
28
+ * ConfigurationSetters.cpp is automatically generated from ConfigurationSetters.cpp.cxxcodebuilder,
29
29
  * using definitions from src/ruby_supportlib/phusion_passenger/apache2/config_options.rb.
30
30
  * Edits to ConfigurationSetters.cpp will be lost.
31
31
  *
@@ -37,445 +37,400 @@
37
37
  * rake src/apache2_module/ConfigurationSetters.cpp
38
38
  */
39
39
 
40
+ static const char *
41
+ cmd_passenger_ruby(cmd_parms *cmd, void *pcfg, const char *arg) {
42
+ DirConfig *config = (DirConfig *) pcfg;
43
+ config->ruby = arg;
44
+ return NULL;
45
+ }
40
46
 
47
+ static const char *
48
+ cmd_passenger_python(cmd_parms *cmd, void *pcfg, const char *arg) {
49
+ DirConfig *config = (DirConfig *) pcfg;
50
+ config->python = arg;
51
+ return NULL;
52
+ }
41
53
 
42
-
43
- static const char *
44
- cmd_passenger_ruby(cmd_parms *cmd, void *pcfg, const char *arg) {
45
- DirConfig *config = (DirConfig *) pcfg;
46
- config->ruby = arg;
47
- return NULL;
48
- }
49
-
50
-
51
- static const char *
52
- cmd_passenger_python(cmd_parms *cmd, void *pcfg, const char *arg) {
53
- DirConfig *config = (DirConfig *) pcfg;
54
- config->python = arg;
55
- return NULL;
56
- }
57
-
58
-
59
- static const char *
60
- cmd_passenger_nodejs(cmd_parms *cmd, void *pcfg, const char *arg) {
61
- DirConfig *config = (DirConfig *) pcfg;
62
- config->nodejs = arg;
63
- return NULL;
64
- }
65
-
66
-
67
- static const char *
68
- cmd_passenger_meteor_app_settings(cmd_parms *cmd, void *pcfg, const char *arg) {
69
- DirConfig *config = (DirConfig *) pcfg;
70
- config->meteorAppSettings = arg;
71
- return NULL;
72
- }
73
-
74
-
75
- static const char *
76
- cmd_passenger_app_env(cmd_parms *cmd, void *pcfg, const char *arg) {
77
- DirConfig *config = (DirConfig *) pcfg;
78
- config->appEnv = arg;
79
- return NULL;
80
- }
81
-
82
-
83
- static const char *
84
- cmd_passenger_min_instances(cmd_parms *cmd, void *pcfg, const char *arg) {
85
- DirConfig *config = (DirConfig *) pcfg;
86
- char *end;
87
- long result;
88
-
89
- result = strtol(arg, &end, 10);
90
- if (*end != '\0') {
91
- string message = "Invalid number specified for ";
92
- message.append(cmd->directive->directive);
93
- message.append(".");
94
-
95
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
96
- message.size() + 1);
97
- memcpy(messageStr, message.c_str(), message.size() + 1);
98
- return messageStr;
99
-
100
- } else if (result < 0) {
101
- string message = "Value for ";
102
- message.append(cmd->directive->directive);
103
- message.append(" must be greater than or equal to 0.");
104
-
105
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
106
- message.size() + 1);
107
- memcpy(messageStr, message.c_str(), message.size() + 1);
108
- return messageStr;
109
-
110
- } else {
111
- config->minInstances = (int) result;
112
- return NULL;
113
- }
114
- }
115
-
116
-
117
- static const char *
118
- cmd_passenger_max_instances_per_app(cmd_parms *cmd, void *pcfg, const char *arg) {
119
- DirConfig *config = (DirConfig *) pcfg;
120
- char *end;
121
- long result;
122
-
123
- result = strtol(arg, &end, 10);
124
- if (*end != '\0') {
125
- string message = "Invalid number specified for ";
126
- message.append(cmd->directive->directive);
127
- message.append(".");
128
-
129
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
130
- message.size() + 1);
131
- memcpy(messageStr, message.c_str(), message.size() + 1);
132
- return messageStr;
133
-
134
- } else {
135
- config->maxInstancesPerApp = (int) result;
136
- return NULL;
137
- }
138
- }
139
-
140
-
141
- static const char *
142
- cmd_passenger_user(cmd_parms *cmd, void *pcfg, const char *arg) {
143
- DirConfig *config = (DirConfig *) pcfg;
144
- config->user = arg;
145
- return NULL;
146
- }
147
-
148
-
149
- static const char *
150
- cmd_passenger_group(cmd_parms *cmd, void *pcfg, const char *arg) {
151
- DirConfig *config = (DirConfig *) pcfg;
152
- config->group = arg;
153
- return NULL;
154
- }
155
-
156
-
157
- static const char *
158
- cmd_passenger_error_override(cmd_parms *cmd, void *pcfg, const char *arg) {
159
- DirConfig *config = (DirConfig *) pcfg;
160
- config->errorOverride =
161
- arg ?
162
- DirConfig::ENABLED :
163
- DirConfig::DISABLED;
164
- return NULL;
165
- }
166
-
167
-
168
- static const char *
169
- cmd_passenger_max_requests(cmd_parms *cmd, void *pcfg, const char *arg) {
170
- DirConfig *config = (DirConfig *) pcfg;
171
- char *end;
172
- long result;
173
-
174
- result = strtol(arg, &end, 10);
175
- if (*end != '\0') {
176
- string message = "Invalid number specified for ";
177
- message.append(cmd->directive->directive);
178
- message.append(".");
179
-
180
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
181
- message.size() + 1);
182
- memcpy(messageStr, message.c_str(), message.size() + 1);
183
- return messageStr;
184
-
185
- } else if (result < 0) {
186
- string message = "Value for ";
187
- message.append(cmd->directive->directive);
188
- message.append(" must be greater than or equal to 0.");
189
-
190
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
191
- message.size() + 1);
192
- memcpy(messageStr, message.c_str(), message.size() + 1);
193
- return messageStr;
194
-
195
- } else {
196
- config->maxRequests = (int) result;
197
- return NULL;
198
- }
199
- }
200
-
201
-
202
- static const char *
203
- cmd_passenger_start_timeout(cmd_parms *cmd, void *pcfg, const char *arg) {
204
- DirConfig *config = (DirConfig *) pcfg;
205
- char *end;
206
- long result;
207
-
208
- result = strtol(arg, &end, 10);
209
- if (*end != '\0') {
210
- string message = "Invalid number specified for ";
211
- message.append(cmd->directive->directive);
212
- message.append(".");
213
-
214
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
215
- message.size() + 1);
216
- memcpy(messageStr, message.c_str(), message.size() + 1);
217
- return messageStr;
218
-
219
- } else if (result < 1) {
220
- string message = "Value for ";
221
- message.append(cmd->directive->directive);
222
- message.append(" must be greater than or equal to 1.");
223
-
224
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
225
- message.size() + 1);
226
- memcpy(messageStr, message.c_str(), message.size() + 1);
227
- return messageStr;
228
-
229
- } else {
230
- config->startTimeout = (int) result;
231
- return NULL;
232
- }
233
- }
234
-
235
-
236
- static const char *
237
- cmd_passenger_high_performance(cmd_parms *cmd, void *pcfg, const char *arg) {
238
- DirConfig *config = (DirConfig *) pcfg;
239
- config->highPerformance =
240
- arg ?
241
- DirConfig::ENABLED :
242
- DirConfig::DISABLED;
243
- return NULL;
244
- }
245
-
246
-
247
- static const char *
248
- cmd_passenger_enabled(cmd_parms *cmd, void *pcfg, const char *arg) {
249
- DirConfig *config = (DirConfig *) pcfg;
250
- config->enabled =
251
- arg ?
252
- DirConfig::ENABLED :
253
- DirConfig::DISABLED;
254
- return NULL;
255
- }
256
-
257
-
258
- static const char *
259
- cmd_passenger_max_request_queue_size(cmd_parms *cmd, void *pcfg, const char *arg) {
260
- DirConfig *config = (DirConfig *) pcfg;
261
- char *end;
262
- long result;
263
-
264
- result = strtol(arg, &end, 10);
265
- if (*end != '\0') {
266
- string message = "Invalid number specified for ";
267
- message.append(cmd->directive->directive);
268
- message.append(".");
269
-
270
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
271
- message.size() + 1);
272
- memcpy(messageStr, message.c_str(), message.size() + 1);
273
- return messageStr;
274
-
275
- } else if (result < 0) {
276
- string message = "Value for ";
277
- message.append(cmd->directive->directive);
278
- message.append(" must be greater than or equal to 0.");
279
-
280
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
281
- message.size() + 1);
282
- memcpy(messageStr, message.c_str(), message.size() + 1);
283
- return messageStr;
284
-
285
- } else {
286
- config->maxRequestQueueSize = (int) result;
287
- return NULL;
288
- }
289
- }
290
-
291
-
292
- static const char *
293
- cmd_passenger_max_preloader_idle_time(cmd_parms *cmd, void *pcfg, const char *arg) {
294
- DirConfig *config = (DirConfig *) pcfg;
295
- char *end;
296
- long result;
297
-
298
- result = strtol(arg, &end, 10);
299
- if (*end != '\0') {
300
- string message = "Invalid number specified for ";
301
- message.append(cmd->directive->directive);
302
- message.append(".");
303
-
304
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
305
- message.size() + 1);
306
- memcpy(messageStr, message.c_str(), message.size() + 1);
307
- return messageStr;
308
-
309
- } else if (result < 0) {
310
- string message = "Value for ";
311
- message.append(cmd->directive->directive);
312
- message.append(" must be greater than or equal to 0.");
313
-
314
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
315
- message.size() + 1);
316
- memcpy(messageStr, message.c_str(), message.size() + 1);
317
- return messageStr;
318
-
319
- } else {
320
- config->maxPreloaderIdleTime = (int) result;
321
- return NULL;
322
- }
323
- }
324
-
325
-
326
- static const char *
327
- cmd_passenger_load_shell_envvars(cmd_parms *cmd, void *pcfg, const char *arg) {
328
- DirConfig *config = (DirConfig *) pcfg;
329
- config->loadShellEnvvars =
330
- arg ?
331
- DirConfig::ENABLED :
332
- DirConfig::DISABLED;
333
- return NULL;
334
- }
335
-
336
-
337
- static const char *
338
- cmd_passenger_buffer_upload(cmd_parms *cmd, void *pcfg, const char *arg) {
339
- DirConfig *config = (DirConfig *) pcfg;
340
- config->bufferUpload =
341
- arg ?
342
- DirConfig::ENABLED :
343
- DirConfig::DISABLED;
344
- return NULL;
345
- }
346
-
347
-
348
- static const char *
349
- cmd_passenger_app_type(cmd_parms *cmd, void *pcfg, const char *arg) {
350
- DirConfig *config = (DirConfig *) pcfg;
351
- config->appType = arg;
352
- return NULL;
353
- }
354
-
355
-
356
- static const char *
357
- cmd_passenger_startup_file(cmd_parms *cmd, void *pcfg, const char *arg) {
358
- DirConfig *config = (DirConfig *) pcfg;
359
- config->startupFile = arg;
360
- return NULL;
361
- }
362
-
363
-
364
- static const char *
365
- cmd_passenger_sticky_sessions(cmd_parms *cmd, void *pcfg, const char *arg) {
366
- DirConfig *config = (DirConfig *) pcfg;
367
- config->stickySessions =
368
- arg ?
369
- DirConfig::ENABLED :
370
- DirConfig::DISABLED;
371
- return NULL;
372
- }
373
-
374
-
375
- static const char *
376
- cmd_passenger_sticky_sessions_cookie_name(cmd_parms *cmd, void *pcfg, const char *arg) {
377
- DirConfig *config = (DirConfig *) pcfg;
378
- config->stickySessionsCookieName =
379
- arg ?
380
- DirConfig::ENABLED :
381
- DirConfig::DISABLED;
382
- return NULL;
383
- }
384
-
385
-
386
- static const char *
387
- cmd_passenger_show_version_in_header(cmd_parms *cmd, void *pcfg, const char *arg) {
388
- DirConfig *config = (DirConfig *) pcfg;
389
- config->showVersionInHeader =
390
- arg ?
391
- DirConfig::ENABLED :
392
- DirConfig::DISABLED;
393
- return NULL;
394
- }
395
-
396
-
397
- static const char *
398
- cmd_passenger_friendly_error_pages(cmd_parms *cmd, void *pcfg, const char *arg) {
399
- DirConfig *config = (DirConfig *) pcfg;
400
- config->friendlyErrorPages =
401
- arg ?
402
- DirConfig::ENABLED :
403
- DirConfig::DISABLED;
404
- return NULL;
405
- }
406
-
407
-
408
- static const char *
409
- cmd_passenger_restart_dir(cmd_parms *cmd, void *pcfg, const char *arg) {
410
- DirConfig *config = (DirConfig *) pcfg;
411
- config->restartDir = arg;
412
- return NULL;
413
- }
414
-
415
-
416
- static const char *
417
- cmd_passenger_app_group_name(cmd_parms *cmd, void *pcfg, const char *arg) {
418
- DirConfig *config = (DirConfig *) pcfg;
419
- config->appGroupName = arg;
420
- return NULL;
421
- }
422
-
423
-
424
- static const char *
425
- cmd_passenger_force_max_concurrent_requests_per_process(cmd_parms *cmd, void *pcfg, const char *arg) {
426
- DirConfig *config = (DirConfig *) pcfg;
427
- char *end;
428
- long result;
429
-
430
- result = strtol(arg, &end, 10);
431
- if (*end != '\0') {
432
- string message = "Invalid number specified for ";
433
- message.append(cmd->directive->directive);
434
- message.append(".");
435
-
436
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
437
- message.size() + 1);
438
- memcpy(messageStr, message.c_str(), message.size() + 1);
439
- return messageStr;
440
-
441
- } else {
442
- config->forceMaxConcurrentRequestsPerProcess = (int) result;
443
- return NULL;
444
- }
445
- }
446
-
447
-
448
- static const char *
449
- cmd_passenger_lve_min_uid(cmd_parms *cmd, void *pcfg, const char *arg) {
450
- DirConfig *config = (DirConfig *) pcfg;
451
- char *end;
452
- long result;
453
-
454
- result = strtol(arg, &end, 10);
455
- if (*end != '\0') {
456
- string message = "Invalid number specified for ";
457
- message.append(cmd->directive->directive);
458
- message.append(".");
459
-
460
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
461
- message.size() + 1);
462
- memcpy(messageStr, message.c_str(), message.size() + 1);
463
- return messageStr;
464
-
465
- } else if (result < 0) {
466
- string message = "Value for ";
467
- message.append(cmd->directive->directive);
468
- message.append(" must be greater than or equal to 0.");
469
-
470
- char *messageStr = (char *) apr_palloc(cmd->temp_pool,
471
- message.size() + 1);
472
- memcpy(messageStr, message.c_str(), message.size() + 1);
473
- return messageStr;
474
-
475
- } else {
476
- config->lveMinUid = (int) result;
477
- return NULL;
478
- }
479
- }
480
-
54
+ static const char *
55
+ cmd_passenger_nodejs(cmd_parms *cmd, void *pcfg, const char *arg) {
56
+ DirConfig *config = (DirConfig *) pcfg;
57
+ config->nodejs = arg;
58
+ return NULL;
59
+ }
60
+
61
+ static const char *
62
+ cmd_passenger_meteor_app_settings(cmd_parms *cmd, void *pcfg, const char *arg) {
63
+ DirConfig *config = (DirConfig *) pcfg;
64
+ config->meteorAppSettings = arg;
65
+ return NULL;
66
+ }
67
+
68
+ static const char *
69
+ cmd_passenger_app_env(cmd_parms *cmd, void *pcfg, const char *arg) {
70
+ DirConfig *config = (DirConfig *) pcfg;
71
+ config->appEnv = arg;
72
+ return NULL;
73
+ }
74
+
75
+ static const char *
76
+ cmd_passenger_min_instances(cmd_parms *cmd, void *pcfg, const char *arg) {
77
+ DirConfig *config = (DirConfig *) pcfg;
78
+ char *end;
79
+ long result;
80
+
81
+ result = strtol(arg, &end, 10);
82
+ if (*end != '\0') {
83
+ string message = "Invalid number specified for ";
84
+ message.append(cmd->directive->directive);
85
+ message.append(".");
86
+
87
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
88
+ message.size() + 1);
89
+ memcpy(messageStr, message.c_str(), message.size() + 1);
90
+ return messageStr;
91
+ } else if (result < 0) {
92
+ string message = "Value for ";
93
+ message.append(cmd->directive->directive);
94
+ message.append(" must be greater than or equal to 0.");
95
+
96
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
97
+ message.size() + 1);
98
+ memcpy(messageStr, message.c_str(), message.size() + 1);
99
+ return messageStr;
100
+ } else {
101
+ config->minInstances = (int) result;
102
+ return NULL;
103
+ }
104
+ }
105
+
106
+ static const char *
107
+ cmd_passenger_max_instances_per_app(cmd_parms *cmd, void *pcfg, const char *arg) {
108
+ DirConfig *config = (DirConfig *) pcfg;
109
+ char *end;
110
+ long result;
111
+
112
+ result = strtol(arg, &end, 10);
113
+ if (*end != '\0') {
114
+ string message = "Invalid number specified for ";
115
+ message.append(cmd->directive->directive);
116
+ message.append(".");
117
+
118
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
119
+ message.size() + 1);
120
+ memcpy(messageStr, message.c_str(), message.size() + 1);
121
+ return messageStr;
122
+ } else {
123
+ config->maxInstancesPerApp = (int) result;
124
+ return NULL;
125
+ }
126
+ }
127
+
128
+ static const char *
129
+ cmd_passenger_user(cmd_parms *cmd, void *pcfg, const char *arg) {
130
+ DirConfig *config = (DirConfig *) pcfg;
131
+ config->user = arg;
132
+ return NULL;
133
+ }
134
+
135
+ static const char *
136
+ cmd_passenger_group(cmd_parms *cmd, void *pcfg, const char *arg) {
137
+ DirConfig *config = (DirConfig *) pcfg;
138
+ config->group = arg;
139
+ return NULL;
140
+ }
141
+
142
+ static const char *
143
+ cmd_passenger_error_override(cmd_parms *cmd, void *pcfg, const char *arg) {
144
+ DirConfig *config = (DirConfig *) pcfg;
145
+ config->errorOverride =
146
+ arg ?
147
+ DirConfig::ENABLED :
148
+ DirConfig::DISABLED;
149
+ return NULL;
150
+ }
151
+
152
+ static const char *
153
+ cmd_passenger_max_requests(cmd_parms *cmd, void *pcfg, const char *arg) {
154
+ DirConfig *config = (DirConfig *) pcfg;
155
+ char *end;
156
+ long result;
157
+
158
+ result = strtol(arg, &end, 10);
159
+ if (*end != '\0') {
160
+ string message = "Invalid number specified for ";
161
+ message.append(cmd->directive->directive);
162
+ message.append(".");
163
+
164
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
165
+ message.size() + 1);
166
+ memcpy(messageStr, message.c_str(), message.size() + 1);
167
+ return messageStr;
168
+ } else if (result < 0) {
169
+ string message = "Value for ";
170
+ message.append(cmd->directive->directive);
171
+ message.append(" must be greater than or equal to 0.");
172
+
173
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
174
+ message.size() + 1);
175
+ memcpy(messageStr, message.c_str(), message.size() + 1);
176
+ return messageStr;
177
+ } else {
178
+ config->maxRequests = (int) result;
179
+ return NULL;
180
+ }
181
+ }
182
+
183
+ static const char *
184
+ cmd_passenger_start_timeout(cmd_parms *cmd, void *pcfg, const char *arg) {
185
+ DirConfig *config = (DirConfig *) pcfg;
186
+ char *end;
187
+ long result;
188
+
189
+ result = strtol(arg, &end, 10);
190
+ if (*end != '\0') {
191
+ string message = "Invalid number specified for ";
192
+ message.append(cmd->directive->directive);
193
+ message.append(".");
194
+
195
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
196
+ message.size() + 1);
197
+ memcpy(messageStr, message.c_str(), message.size() + 1);
198
+ return messageStr;
199
+ } else if (result < 1) {
200
+ string message = "Value for ";
201
+ message.append(cmd->directive->directive);
202
+ message.append(" must be greater than or equal to 1.");
203
+
204
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
205
+ message.size() + 1);
206
+ memcpy(messageStr, message.c_str(), message.size() + 1);
207
+ return messageStr;
208
+ } else {
209
+ config->startTimeout = (int) result;
210
+ return NULL;
211
+ }
212
+ }
213
+
214
+ static const char *
215
+ cmd_passenger_high_performance(cmd_parms *cmd, void *pcfg, const char *arg) {
216
+ DirConfig *config = (DirConfig *) pcfg;
217
+ config->highPerformance =
218
+ arg ?
219
+ DirConfig::ENABLED :
220
+ DirConfig::DISABLED;
221
+ return NULL;
222
+ }
223
+
224
+ static const char *
225
+ cmd_passenger_enabled(cmd_parms *cmd, void *pcfg, const char *arg) {
226
+ DirConfig *config = (DirConfig *) pcfg;
227
+ config->enabled =
228
+ arg ?
229
+ DirConfig::ENABLED :
230
+ DirConfig::DISABLED;
231
+ return NULL;
232
+ }
233
+
234
+ static const char *
235
+ cmd_passenger_max_request_queue_size(cmd_parms *cmd, void *pcfg, const char *arg) {
236
+ DirConfig *config = (DirConfig *) pcfg;
237
+ char *end;
238
+ long result;
239
+
240
+ result = strtol(arg, &end, 10);
241
+ if (*end != '\0') {
242
+ string message = "Invalid number specified for ";
243
+ message.append(cmd->directive->directive);
244
+ message.append(".");
245
+
246
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
247
+ message.size() + 1);
248
+ memcpy(messageStr, message.c_str(), message.size() + 1);
249
+ return messageStr;
250
+ } else if (result < 0) {
251
+ string message = "Value for ";
252
+ message.append(cmd->directive->directive);
253
+ message.append(" must be greater than or equal to 0.");
254
+
255
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
256
+ message.size() + 1);
257
+ memcpy(messageStr, message.c_str(), message.size() + 1);
258
+ return messageStr;
259
+ } else {
260
+ config->maxRequestQueueSize = (int) result;
261
+ return NULL;
262
+ }
263
+ }
264
+
265
+ static const char *
266
+ cmd_passenger_max_preloader_idle_time(cmd_parms *cmd, void *pcfg, const char *arg) {
267
+ DirConfig *config = (DirConfig *) pcfg;
268
+ char *end;
269
+ long result;
270
+
271
+ result = strtol(arg, &end, 10);
272
+ if (*end != '\0') {
273
+ string message = "Invalid number specified for ";
274
+ message.append(cmd->directive->directive);
275
+ message.append(".");
276
+
277
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
278
+ message.size() + 1);
279
+ memcpy(messageStr, message.c_str(), message.size() + 1);
280
+ return messageStr;
281
+ } else if (result < 0) {
282
+ string message = "Value for ";
283
+ message.append(cmd->directive->directive);
284
+ message.append(" must be greater than or equal to 0.");
285
+
286
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
287
+ message.size() + 1);
288
+ memcpy(messageStr, message.c_str(), message.size() + 1);
289
+ return messageStr;
290
+ } else {
291
+ config->maxPreloaderIdleTime = (int) result;
292
+ return NULL;
293
+ }
294
+ }
295
+
296
+ static const char *
297
+ cmd_passenger_load_shell_envvars(cmd_parms *cmd, void *pcfg, const char *arg) {
298
+ DirConfig *config = (DirConfig *) pcfg;
299
+ config->loadShellEnvvars =
300
+ arg ?
301
+ DirConfig::ENABLED :
302
+ DirConfig::DISABLED;
303
+ return NULL;
304
+ }
305
+
306
+ static const char *
307
+ cmd_passenger_buffer_upload(cmd_parms *cmd, void *pcfg, const char *arg) {
308
+ DirConfig *config = (DirConfig *) pcfg;
309
+ config->bufferUpload =
310
+ arg ?
311
+ DirConfig::ENABLED :
312
+ DirConfig::DISABLED;
313
+ return NULL;
314
+ }
315
+
316
+ static const char *
317
+ cmd_passenger_app_type(cmd_parms *cmd, void *pcfg, const char *arg) {
318
+ DirConfig *config = (DirConfig *) pcfg;
319
+ config->appType = arg;
320
+ return NULL;
321
+ }
322
+
323
+ static const char *
324
+ cmd_passenger_startup_file(cmd_parms *cmd, void *pcfg, const char *arg) {
325
+ DirConfig *config = (DirConfig *) pcfg;
326
+ config->startupFile = arg;
327
+ return NULL;
328
+ }
329
+
330
+ static const char *
331
+ cmd_passenger_sticky_sessions(cmd_parms *cmd, void *pcfg, const char *arg) {
332
+ DirConfig *config = (DirConfig *) pcfg;
333
+ config->stickySessions =
334
+ arg ?
335
+ DirConfig::ENABLED :
336
+ DirConfig::DISABLED;
337
+ return NULL;
338
+ }
339
+
340
+ static const char *
341
+ cmd_passenger_sticky_sessions_cookie_name(cmd_parms *cmd, void *pcfg, const char *arg) {
342
+ DirConfig *config = (DirConfig *) pcfg;
343
+ config->stickySessionsCookieName =
344
+ arg ?
345
+ DirConfig::ENABLED :
346
+ DirConfig::DISABLED;
347
+ return NULL;
348
+ }
349
+
350
+ static const char *
351
+ cmd_passenger_show_version_in_header(cmd_parms *cmd, void *pcfg, const char *arg) {
352
+ DirConfig *config = (DirConfig *) pcfg;
353
+ config->showVersionInHeader =
354
+ arg ?
355
+ DirConfig::ENABLED :
356
+ DirConfig::DISABLED;
357
+ return NULL;
358
+ }
359
+
360
+ static const char *
361
+ cmd_passenger_friendly_error_pages(cmd_parms *cmd, void *pcfg, const char *arg) {
362
+ DirConfig *config = (DirConfig *) pcfg;
363
+ config->friendlyErrorPages =
364
+ arg ?
365
+ DirConfig::ENABLED :
366
+ DirConfig::DISABLED;
367
+ return NULL;
368
+ }
369
+
370
+ static const char *
371
+ cmd_passenger_restart_dir(cmd_parms *cmd, void *pcfg, const char *arg) {
372
+ DirConfig *config = (DirConfig *) pcfg;
373
+ config->restartDir = arg;
374
+ return NULL;
375
+ }
376
+
377
+ static const char *
378
+ cmd_passenger_app_group_name(cmd_parms *cmd, void *pcfg, const char *arg) {
379
+ DirConfig *config = (DirConfig *) pcfg;
380
+ config->appGroupName = arg;
381
+ return NULL;
382
+ }
383
+
384
+ static const char *
385
+ cmd_passenger_force_max_concurrent_requests_per_process(cmd_parms *cmd, void *pcfg, const char *arg) {
386
+ DirConfig *config = (DirConfig *) pcfg;
387
+ char *end;
388
+ long result;
389
+
390
+ result = strtol(arg, &end, 10);
391
+ if (*end != '\0') {
392
+ string message = "Invalid number specified for ";
393
+ message.append(cmd->directive->directive);
394
+ message.append(".");
395
+
396
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
397
+ message.size() + 1);
398
+ memcpy(messageStr, message.c_str(), message.size() + 1);
399
+ return messageStr;
400
+ } else {
401
+ config->forceMaxConcurrentRequestsPerProcess = (int) result;
402
+ return NULL;
403
+ }
404
+ }
405
+
406
+ static const char *
407
+ cmd_passenger_lve_min_uid(cmd_parms *cmd, void *pcfg, const char *arg) {
408
+ DirConfig *config = (DirConfig *) pcfg;
409
+ char *end;
410
+ long result;
411
+
412
+ result = strtol(arg, &end, 10);
413
+ if (*end != '\0') {
414
+ string message = "Invalid number specified for ";
415
+ message.append(cmd->directive->directive);
416
+ message.append(".");
417
+
418
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
419
+ message.size() + 1);
420
+ memcpy(messageStr, message.c_str(), message.size() + 1);
421
+ return messageStr;
422
+ } else if (result < 0) {
423
+ string message = "Value for ";
424
+ message.append(cmd->directive->directive);
425
+ message.append(" must be greater than or equal to 0.");
426
+
427
+ char *messageStr = (char *) apr_palloc(cmd->temp_pool,
428
+ message.size() + 1);
429
+ memcpy(messageStr, message.c_str(), message.size() + 1);
430
+ return messageStr;
431
+ } else {
432
+ config->lveMinUid = (int) result;
433
+ return NULL;
434
+ }
435
+ }
481
436