File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -259,10 +259,8 @@ impl<'a> Resolution<'a> {
259259 . copy_to_nonoverlapping ( sockaddr. cast ( ) , addr. socklen as usize )
260260 } ;
261261
262- let name = unsafe {
263- ngx_str_t:: from_bytes ( pool. as_ref ( ) as * const _ as * mut _ , addr. name . as_bytes ( ) )
264- }
265- . ok_or ( Error :: AllocationFailed ) ?;
262+ let name = unsafe { ngx_str_t:: from_bytes ( pool. as_ptr ( ) , addr. name . as_bytes ( ) ) }
263+ . ok_or ( Error :: AllocationFailed ) ?;
266264
267265 Ok ( ngx_addr_t {
268266 sockaddr,
Original file line number Diff line number Diff line change @@ -145,6 +145,12 @@ impl Pool {
145145 Pool ( NonNull :: new_unchecked ( pool) )
146146 }
147147
148+ /// Expose the underlying `ngx_pool_t` pointer, for use with `ngx::ffi`
149+ /// functions.
150+ pub fn as_ptr ( & self ) -> * mut ngx_pool_t {
151+ self . 0 . as_ptr ( )
152+ }
153+
148154 /// Creates a buffer of the specified size in the memory pool.
149155 ///
150156 /// Returns `Some(TemporaryBuffer)` if the buffer is successfully created, or `None` if
You can’t perform that action at this time.
0 commit comments