@@ -17,8 +17,8 @@ use ngx::{
17
17
NGX_HTTP_MODULE , NGX_HTTP_UPS_CONF , NGX_LOG_EMERG , NGX_RS_HTTP_SRV_CONF_OFFSET , NGX_RS_MODULE_SIGNATURE ,
18
18
} ,
19
19
http:: {
20
- ngx_http_conf_get_module_srv_conf , ngx_http_conf_upstream_srv_conf_immutable ,
21
- ngx_http_conf_upstream_srv_conf_mutable , HTTPModule , Merge , MergeConfigError , Request ,
20
+ ngx_http_conf_get_module_srv_conf_mut_ptr , ngx_http_conf_upstream_srv_conf_mut_ptr ,
21
+ ngx_http_conf_upstream_srv_conf_ptr , HTTPModule , Merge , MergeConfigError , Request ,
22
22
} ,
23
23
http_upstream_init_peer_pt,
24
24
log:: DebugMask ,
@@ -146,13 +146,13 @@ http_upstream_init_peer_pt!(
146
146
|request: & mut Request , us: * mut ngx_http_upstream_srv_conf_t| {
147
147
ngx_log_debug_http!( request, "CUSTOM UPSTREAM request peer init" ) ;
148
148
149
- let mut hcpd = request. pool( ) . alloc_type :: <UpstreamPeerData >( ) ;
149
+ let mut hcpd = request. pool( ) . alloc_type_mut_ptr :: <UpstreamPeerData >( ) ;
150
150
if hcpd. is_null( ) {
151
151
return Status :: NGX_ERROR ;
152
152
}
153
153
154
154
let maybe_conf: Option <* const SrvConfig > =
155
- unsafe { ngx_http_conf_upstream_srv_conf_immutable ( us, & ngx_http_upstream_custom_module) } ;
155
+ unsafe { ngx_http_conf_upstream_srv_conf_ptr ( us, & ngx_http_upstream_custom_module) } ;
156
156
if maybe_conf. is_none( ) {
157
157
return Status :: NGX_ERROR ;
158
158
}
@@ -163,7 +163,7 @@ http_upstream_init_peer_pt!(
163
163
return Status :: NGX_ERROR ;
164
164
}
165
165
166
- let maybe_upstream = request. upstream ( ) ;
166
+ let maybe_upstream = request. upstream_mut_ptr ( ) ;
167
167
if maybe_upstream. is_none( ) {
168
168
return Status :: NGX_ERROR ;
169
169
}
@@ -173,7 +173,7 @@ http_upstream_init_peer_pt!(
173
173
( * hcpd) . conf = Some ( hccf) ;
174
174
( * hcpd) . upstream = maybe_upstream;
175
175
( * hcpd) . data = ( * upstream_ptr) . peer. data;
176
- ( * hcpd) . client_connection = Some ( request. connection ( ) ) ;
176
+ ( * hcpd) . client_connection = Some ( request. connection_mut_ptr ( ) ) ;
177
177
( * hcpd) . original_get_peer = ( * upstream_ptr) . peer. get;
178
178
( * hcpd) . original_free_peer = ( * upstream_ptr) . peer. free;
179
179
@@ -244,7 +244,7 @@ unsafe extern "C" fn ngx_http_upstream_init_custom(
244
244
ngx_log_debug_mask ! ( DebugMask :: Http , ( * cf) . log, "CUSTOM UPSTREAM peer init_upstream" ) ;
245
245
246
246
let maybe_conf: Option < * mut SrvConfig > =
247
- ngx_http_conf_upstream_srv_conf_mutable ( us, & ngx_http_upstream_custom_module) ;
247
+ ngx_http_conf_upstream_srv_conf_mut_ptr ( us, & ngx_http_upstream_custom_module) ;
248
248
if maybe_conf. is_none ( ) {
249
249
ngx_conf_log_error (
250
250
NGX_LOG_EMERG as usize ,
@@ -309,7 +309,7 @@ unsafe extern "C" fn ngx_http_upstream_commands_set_custom(
309
309
}
310
310
311
311
let uscf: * mut ngx_http_upstream_srv_conf_t =
312
- ngx_http_conf_get_module_srv_conf ( cf, & ngx_http_upstream_module) as * mut ngx_http_upstream_srv_conf_t ;
312
+ ngx_http_conf_get_module_srv_conf_mut_ptr ( cf, & ngx_http_upstream_module) as * mut ngx_http_upstream_srv_conf_t ;
313
313
314
314
ccf. original_init_upstream = if ( * uscf) . peer . init_upstream . is_some ( ) {
315
315
( * uscf) . peer . init_upstream
@@ -336,7 +336,7 @@ impl HTTPModule for Module {
336
336
337
337
unsafe extern "C" fn create_srv_conf ( cf : * mut ngx_conf_t ) -> * mut c_void {
338
338
let mut pool = Pool :: from_ngx_pool ( ( * cf) . pool ) ;
339
- let conf = pool. alloc_type :: < SrvConfig > ( ) ;
339
+ let conf = pool. alloc_type_mut_ptr :: < SrvConfig > ( ) ;
340
340
if conf. is_null ( ) {
341
341
ngx_conf_log_error (
342
342
NGX_LOG_EMERG as usize ,
0 commit comments