@@ -196,7 +196,7 @@ http_variable_get!(
196196 if let Some ( obj) = ctx {
197197 ngx_log_debug_http!( request, "httporigdst: found context and binding variable" , ) ;
198198 obj. bind_addr( v) ;
199- return core:: Status :: NGX_OK ;
199+ return core:: Status :: NGX_OK . into ( ) ;
200200 }
201201 // lazy initialization:
202202 // get original dest information
@@ -207,18 +207,14 @@ http_variable_get!(
207207 let r = ngx_get_origdst( request) ;
208208 match r {
209209 Err ( e) => {
210- return e;
210+ return e. into ( ) ;
211211 }
212212 Ok ( ( ip, port) ) => {
213213 // create context,
214214 // set context
215215 let new_ctx = request
216216 . pool( )
217- . allocate:: <NgxHttpOrigDstCtx >( Default :: default ( ) ) ;
218-
219- if new_ctx. is_null( ) {
220- return core:: Status :: NGX_ERROR ;
221- }
217+ . allocate_with_cleanup:: <NgxHttpOrigDstCtx >( Default :: default ( ) ) ?;
222218
223219 ngx_log_debug_http!(
224220 request,
@@ -232,7 +228,7 @@ http_variable_get!(
232228 . set_module_ctx( new_ctx as * mut c_void, & * addr_of!( ngx_http_orig_dst_module) ) ;
233229 }
234230 }
235- core:: Status :: NGX_OK
231+ core:: Status :: NGX_OK . into ( )
236232 }
237233) ;
238234
@@ -243,7 +239,7 @@ http_variable_get!(
243239 if let Some ( obj) = ctx {
244240 ngx_log_debug_http!( request, "httporigdst: found context and binding variable" , ) ;
245241 obj. bind_port( v) ;
246- return core:: Status :: NGX_OK ;
242+ return core:: Status :: NGX_OK . into ( ) ;
247243 }
248244 // lazy initialization:
249245 // get original dest information
@@ -254,18 +250,14 @@ http_variable_get!(
254250 let r = ngx_get_origdst( request) ;
255251 match r {
256252 Err ( e) => {
257- return e;
253+ return e. into ( ) ;
258254 }
259255 Ok ( ( ip, port) ) => {
260256 // create context,
261257 // set context
262258 let new_ctx = request
263259 . pool( )
264- . allocate:: <NgxHttpOrigDstCtx >( Default :: default ( ) ) ;
265-
266- if new_ctx. is_null( ) {
267- return core:: Status :: NGX_ERROR ;
268- }
260+ . allocate_with_cleanup:: <NgxHttpOrigDstCtx >( Default :: default ( ) ) ?;
269261
270262 ngx_log_debug_http!(
271263 request,
@@ -279,7 +271,7 @@ http_variable_get!(
279271 . set_module_ctx( new_ctx as * mut c_void, & * addr_of!( ngx_http_orig_dst_module) ) ;
280272 }
281273 }
282- core:: Status :: NGX_OK
274+ core:: Status :: NGX_OK . into ( )
283275 }
284276) ;
285277
0 commit comments