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> {
259
259
. copy_to_nonoverlapping ( sockaddr. cast ( ) , addr. socklen as usize )
260
260
} ;
261
261
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 ) ?;
266
264
267
265
Ok ( ngx_addr_t {
268
266
sockaddr,
Original file line number Diff line number Diff line change @@ -145,6 +145,12 @@ impl Pool {
145
145
Pool ( NonNull :: new_unchecked ( pool) )
146
146
}
147
147
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
+
148
154
/// Creates a buffer of the specified size in the memory pool.
149
155
///
150
156
/// Returns `Some(TemporaryBuffer)` if the buffer is successfully created, or `None` if
You can’t perform that action at this time.
0 commit comments