comparison src/core/nginx.c @ 690:b5b7eea22fda NGINX_1_3_8

nginx 1.3.8 *) Feature: the "optional_no_ca" parameter of the "ssl_verify_client" directive. Thanks to Mike Kazantsev and Eric O'Connor. *) Feature: the $bytes_sent, $connection, and $connection_requests variables can now be used not only in the "log_format" directive. Thanks to Benjamin Grössing. *) Feature: the "auto" parameter of the "worker_processes" directive. *) Bugfix: "cache file ... has md5 collision" alert. *) Bugfix: in the ngx_http_gunzip_filter_module. *) Bugfix: in the "ssl_stapling" directive.
author Igor Sysoev <http://sysoev.ru>
date Tue, 30 Oct 2012 00:00:00 +0400
parents 660139fd80ca
children
comparison
equal deleted inserted replaced
689:4d942f0d1703 690:b5b7eea22fda
19 static char *ngx_set_user(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 19 static char *ngx_set_user(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
20 static char *ngx_set_env(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 20 static char *ngx_set_env(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
21 static char *ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 21 static char *ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
22 static char *ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, 22 static char *ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd,
23 void *conf); 23 void *conf);
24 static char *ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd,
25 void *conf);
24 26
25 27
26 static ngx_conf_enum_t ngx_debug_points[] = { 28 static ngx_conf_enum_t ngx_debug_points[] = {
27 { ngx_string("stop"), NGX_DEBUG_POINTS_STOP }, 29 { ngx_string("stop"), NGX_DEBUG_POINTS_STOP },
28 { ngx_string("abort"), NGX_DEBUG_POINTS_ABORT }, 30 { ngx_string("abort"), NGX_DEBUG_POINTS_ABORT },
67 offsetof(ngx_core_conf_t, lock_file), 69 offsetof(ngx_core_conf_t, lock_file),
68 NULL }, 70 NULL },
69 71
70 { ngx_string("worker_processes"), 72 { ngx_string("worker_processes"),
71 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, 73 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
72 ngx_conf_set_num_slot, 74 ngx_set_worker_processes,
73 0, 75 0,
74 offsetof(ngx_core_conf_t, worker_processes), 76 0,
75 NULL }, 77 NULL },
76 78
77 { ngx_string("debug_points"), 79 { ngx_string("debug_points"),
78 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, 80 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
79 ngx_conf_set_enum_slot, 81 ngx_conf_set_enum_slot,
1327 return ccf->cpu_affinity[n]; 1329 return ccf->cpu_affinity[n];
1328 } 1330 }
1329 1331
1330 return ccf->cpu_affinity[ccf->cpu_affinity_n - 1]; 1332 return ccf->cpu_affinity[ccf->cpu_affinity_n - 1];
1331 } 1333 }
1334
1335
1336 static char *
1337 ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1338 {
1339 ngx_str_t *value;
1340 ngx_core_conf_t *ccf;
1341
1342 ccf = (ngx_core_conf_t *) conf;
1343
1344 if (ccf->worker_processes != NGX_CONF_UNSET) {
1345 return "is duplicate";
1346 }
1347
1348 value = (ngx_str_t *) cf->args->elts;
1349
1350 if (ngx_strcmp(value[1].data, "auto") == 0) {
1351 ccf->worker_processes = ngx_ncpu;
1352 return NGX_CONF_OK;
1353 }
1354
1355 ccf->worker_processes = ngx_atoi(value[1].data, value[1].len);
1356
1357 if (ccf->worker_processes == NGX_ERROR) {
1358 return "invalid value";
1359 }
1360
1361 return NGX_CONF_OK;
1362 }