[Nginx Source parsing] Configuration resolution (event scope)

Source: Internet
Author: User
Handling Events


which conforms to ngx_event_module there are two modules are ngx_event_core_module, Ngx_epoll_module

Core code

  Ngx_modules[i]->ctx_index = ngx_event_max_module++;//Set Module Internal Index} CTX =      Ngx_pcalloc (Cf->pool, sizeof (void *));      if (CTX = = NULL) {return ngx_conf_error;          } *ctx = Ngx_pcalloc (cf->pool, ngx_event_max_module * sizeof (void *));//ctx points to array if (*ctx = = NULL) {      return ngx_conf_error;        } * (void * *) conf = CTX;          for (i = 0; ngx_modules[i]; i++) {if (Ngx_modules[i]->type! = Ngx_event_module) {continue;            } m = ngx_modules[i]->ctx; if (m->create_conf) {//If the Ngx_event_module type module exists create_conf function then call the module's create_conf function and mount it to the EVENT context (*CTX) [Ngx _modules[i]->ctx_index] = m->create_conf (cf->cycle);//Create the appropriate context if ((*CTX) [Ngx_modules[i]->ctx_inde X] = = NULL) {return NGx_conf_error;      }}} PCF = *CF;      Cf->ctx = CTX; Cf->module_type = ngx_event_module;//Set module Environment cf->cmd_type = ngx_event_conf;//SET Command Type RV = Ngx_conf_parse (cf, NULL) ;

Then parse worker_connections1024, the command in Ngx_event_core_module, call the Ngx_event_connections function, set the Connect value to 1024, the structure is as follows:


The above describes the [Nginx source parsing] Configuration resolution (event scope), including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.