December 22th Tuesday 2009

    In nginx, during parsing the configure file the function ngx_mail_block() is called.  The function ngx_mail_block() allocate buffer for main configure information and server configure information.  At one time the create_main_conf() and the create_srv_conf() hooks in all mail module are invoked.  And so on, the init_main_conf() and the merge_srv_conf() are both called.  At the end of the function ngx_mail_block(), ngx_mail_optimize_servers() is called.

 

   In the function ngx_mail_optimize_servers(), the following code is so important.

 

            ...

            ls = ngx_create_listening(cf, addr[i].sockaddr, addr[i].socklen);
            if (ls == NULL) {
                return NGX_CONF_ERROR;
            }

            ls->addr_ntop = 1;
            ls->handler = ngx_mail_init_connection;
            ls->pool_size = 256;

            ...

 

   The ngx_mail_init_connection() is set.  OK.  The function ngx_mail_init_connection() is started for a connection.

 

   The above is for the mail module.  The http module is similar to it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值