Skip to content

Commit e512202

Browse files
author
Chrono Law
committed
main conf cycle
1 parent c592ca9 commit e512202

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ngxpp/NgxModule.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ class NgxModuleConfig final
8686
return get<T3>(ctx(cf)->loc_conf);
8787
}
8888

89+
public:
90+
// cycle->conf_ccycle->conf_ctxtx[ngx_http_module.index] must not null
91+
META_TYPE(T1) main(ngx_cycle_t* cycle) const
92+
{
93+
return get<T1>(ctx(cycle)->main_conf);
94+
}
95+
96+
ngx_http_conf_ctx_t* ctx(ngx_cycle_t* cycle) const
97+
{
98+
return reinterpret_cast<ngx_http_conf_ctx_t*>(cycle->conf_ctx[ngx_http_module.index]);
99+
}
89100
private:
90101
ngx_http_conf_ctx_t* ctx(ngx_conf_t* cf) const
91102
{

0 commit comments

Comments
 (0)