2
* Phusion Passenger - https://www.phusionpassenger.com/
3
* Copyright (c) 2010-2013 Phusion
5
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
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:
14
* The above copyright notice and this permission notice shall be included in
15
* all copies or substantial portions of the Software.
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
27
* CacheLocationConfig.c is automatically generated from CacheLocationConfig.c.erb,
28
* using definitions from lib/phusion_passenger/nginx/config_options.rb.
29
* Edits to CacheLocationConfig.c will be lost.
31
* To update CacheLocationConfig.c:
34
* To force regeneration of CacheLocationConfig.c:
35
* rm -f ext/nginx/CacheLocationConfig.c
36
* rake ext/nginx/CacheLocationConfig.c
42
u_char int_buf[32], *end, *buf, *pos;
44
/* Calculate lengths */
47
if (conf->ruby.data != NULL) {
49
len += conf->ruby.len + 1;
54
if (conf->python.data != NULL) {
56
len += conf->python.len + 1;
61
if (conf->nodejs.data != NULL) {
63
len += conf->nodejs.len + 1;
68
if (conf->environment.data != NULL) {
70
len += conf->environment.len + 1;
75
if (conf->friendly_error_pages != NGX_CONF_UNSET) {
77
len += conf->friendly_error_pages ? sizeof("true") : sizeof("false");
82
if (conf->min_instances != NGX_CONF_UNSET) {
83
end = ngx_snprintf(int_buf,
88
len += end - int_buf + 1;
93
if (conf->max_requests != NGX_CONF_UNSET) {
94
end = ngx_snprintf(int_buf,
99
len += end - int_buf + 1;
104
if (conf->start_timeout != NGX_CONF_UNSET) {
105
end = ngx_snprintf(int_buf,
108
conf->start_timeout);
110
len += end - int_buf + 1;
115
if (conf->user.data != NULL) {
117
len += conf->user.len + 1;
122
if (conf->group.data != NULL) {
124
len += conf->group.len + 1;
129
if (conf->app_group_name.data != NULL) {
131
len += conf->app_group_name.len + 1;
136
if (conf->app_root.data != NULL) {
138
len += conf->app_root.len + 1;
143
if (conf->app_rights.data != NULL) {
145
len += conf->app_rights.len + 1;
150
if (conf->union_station_support != NGX_CONF_UNSET) {
152
len += conf->union_station_support ? sizeof("true") : sizeof("false");
157
if (conf->debugger != NGX_CONF_UNSET) {
159
len += conf->debugger ? sizeof("true") : sizeof("false");
164
if (conf->show_version_in_header != NGX_CONF_UNSET) {
166
len += conf->show_version_in_header ? sizeof("true") : sizeof("false");
171
if (conf->max_preloader_idle_time != NGX_CONF_UNSET) {
172
end = ngx_snprintf(int_buf,
175
conf->max_preloader_idle_time);
177
len += end - int_buf + 1;
182
if (conf->spawn_method.data != NULL) {
184
len += conf->spawn_method.len + 1;
189
if (conf->load_shell_envvars != NGX_CONF_UNSET) {
191
len += conf->load_shell_envvars ? sizeof("true") : sizeof("false");
196
if (conf->union_station_key.data != NULL) {
198
len += conf->union_station_key.len + 1;
203
if (conf->max_request_queue_size != NGX_CONF_UNSET) {
204
end = ngx_snprintf(int_buf,
207
conf->max_request_queue_size);
209
len += end - int_buf + 1;
214
if (conf->request_queue_overflow_status_code != NGX_CONF_UNSET) {
215
end = ngx_snprintf(int_buf,
218
conf->request_queue_overflow_status_code);
220
len += end - int_buf + 1;
225
if (conf->restart_dir.data != NULL) {
227
len += conf->restart_dir.len + 1;
232
if (conf->startup_file.data != NULL) {
234
len += conf->startup_file.len + 1;
240
buf = pos = ngx_pnalloc(cf->pool, len);
244
if (conf->ruby.data != NULL) {
257
if (conf->python.data != NULL) {
270
if (conf->nodejs.data != NULL) {
283
if (conf->environment.data != NULL) {
288
conf->environment.data,
289
conf->environment.len);
296
if (conf->friendly_error_pages != NGX_CONF_UNSET) {
298
"PASSENGER_FRIENDLY_ERROR_PAGES",
300
if (conf->friendly_error_pages) {
301
pos = ngx_copy(pos, "true", sizeof("true"));
303
pos = ngx_copy(pos, "false", sizeof("false"));
309
if (conf->min_instances != NGX_CONF_UNSET) {
311
"PASSENGER_MIN_INSTANCES",
313
end = ngx_snprintf(int_buf,
316
conf->min_instances);
326
if (conf->max_requests != NGX_CONF_UNSET) {
328
"PASSENGER_MAX_REQUESTS",
330
end = ngx_snprintf(int_buf,
343
if (conf->start_timeout != NGX_CONF_UNSET) {
345
"PASSENGER_START_TIMEOUT",
347
end = ngx_snprintf(int_buf,
350
conf->start_timeout);
360
if (conf->user.data != NULL) {
373
if (conf->group.data != NULL) {
386
if (conf->app_group_name.data != NULL) {
388
"PASSENGER_APP_GROUP_NAME",
391
conf->app_group_name.data,
392
conf->app_group_name.len);
399
if (conf->app_root.data != NULL) {
401
"PASSENGER_APP_ROOT",
412
if (conf->app_rights.data != NULL) {
414
"PASSENGER_APP_RIGHTS",
417
conf->app_rights.data,
418
conf->app_rights.len);
425
if (conf->union_station_support != NGX_CONF_UNSET) {
427
"UNION_STATION_SUPPORT",
429
if (conf->union_station_support) {
430
pos = ngx_copy(pos, "true", sizeof("true"));
432
pos = ngx_copy(pos, "false", sizeof("false"));
438
if (conf->debugger != NGX_CONF_UNSET) {
440
"PASSENGER_DEBUGGER",
442
if (conf->debugger) {
443
pos = ngx_copy(pos, "true", sizeof("true"));
445
pos = ngx_copy(pos, "false", sizeof("false"));
451
if (conf->show_version_in_header != NGX_CONF_UNSET) {
453
"PASSENGER_SHOW_VERSION_IN_HEADER",
455
if (conf->show_version_in_header) {
456
pos = ngx_copy(pos, "true", sizeof("true"));
458
pos = ngx_copy(pos, "false", sizeof("false"));
464
if (conf->max_preloader_idle_time != NGX_CONF_UNSET) {
466
"PASSENGER_MAX_PRELOADER_IDLE_TIME",
468
end = ngx_snprintf(int_buf,
471
conf->max_preloader_idle_time);
481
if (conf->spawn_method.data != NULL) {
483
"PASSENGER_SPAWN_METHOD",
486
conf->spawn_method.data,
487
conf->spawn_method.len);
494
if (conf->load_shell_envvars != NGX_CONF_UNSET) {
496
"PASSENGER_LOAD_SHELL_ENVVARS",
498
if (conf->load_shell_envvars) {
499
pos = ngx_copy(pos, "true", sizeof("true"));
501
pos = ngx_copy(pos, "false", sizeof("false"));
507
if (conf->union_station_key.data != NULL) {
512
conf->union_station_key.data,
513
conf->union_station_key.len);
520
if (conf->max_request_queue_size != NGX_CONF_UNSET) {
522
"PASSENGER_MAX_REQUEST_QUEUE_SIZE",
524
end = ngx_snprintf(int_buf,
527
conf->max_request_queue_size);
537
if (conf->request_queue_overflow_status_code != NGX_CONF_UNSET) {
539
"PASSENGER_REQUEST_QUEUE_OVERFLOW_STATUS_CODE",
541
end = ngx_snprintf(int_buf,
544
conf->request_queue_overflow_status_code);
554
if (conf->restart_dir.data != NULL) {
556
"PASSENGER_RESTART_DIR",
559
conf->restart_dir.data,
560
conf->restart_dir.len);
567
if (conf->startup_file.data != NULL) {
569
"PASSENGER_STARTUP_FILE",
572
conf->startup_file.data,
573
conf->startup_file.len);
580
conf->options_cache.data = buf;
581
conf->options_cache.len = pos - buf;