×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: ActionScript
Posted by: userf47c5
Added: May 3, 2015 5:01 AM
Views: 2
Tags: no tags
ngx_set_worker_processes
  1. static char *
  2. ngx_set_worker_processes(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
  3. {
  4.     ngx_str_t        *value;
  5.     ngx_core_conf_t  *ccf;
  6.  
  7.     ccf = (ngx_core_conf_t *) conf;
  8.  
  9.     if (ccf->worker_processes != NGX_CONF_UNSET) {
  10.         return "is duplicate";
  11.     }
  12.  
  13.     value = (ngx_str_t *) cf->args->elts;
  14.  
  15.     if (ngx_strcmp(value[1].data, "auto") == 0) {
  16.         ccf->worker_processes = ngx_ncpu;
  17.         return NGX_CONF_OK;
  18.     }
  19.  
  20.     ccf->worker_processes = ngx_atoi(value[1].data, value[1].len);
  21.  
  22.     if (ccf->worker_processes == NGX_ERROR) {
  23.         return "invalid value";
  24.     }
  25.  
  26.     return NGX_CONF_OK;
  27. }