@@ -81,11 +81,11 @@ cfg_if! {
8181 use std:: io:: IoSlice ;
8282
8383 #[ derive( Clone , Debug ) ]
84- struct SendfileHeaderTrailer <' a>(
85- libc:: sf_hdtr,
86- Option <Vec <IoSlice <' a>>>,
87- Option <Vec <IoSlice <' a>>>,
88- ) ;
84+ struct SendfileHeaderTrailer <' a> {
85+ raw : libc:: sf_hdtr,
86+ _headers : Option <Vec <IoSlice <' a>>>,
87+ _trailers : Option <Vec <IoSlice <' a>>>,
88+ }
8989
9090 impl <' a> SendfileHeaderTrailer <' a> {
9191 fn new(
@@ -96,8 +96,9 @@ cfg_if! {
9696 headers. map( |s| s. iter( ) . map( |b| IoSlice :: new( b) ) . collect( ) ) ;
9797 let mut trailer_iovecs: Option <Vec <IoSlice <' _>>> =
9898 trailers. map( |s| s. iter( ) . map( |b| IoSlice :: new( b) ) . collect( ) ) ;
99- SendfileHeaderTrailer (
100- libc:: sf_hdtr {
99+
100+ SendfileHeaderTrailer {
101+ raw: libc:: sf_hdtr {
101102 headers: {
102103 header_iovecs
103104 . as_mut( )
@@ -113,9 +114,9 @@ cfg_if! {
113114 } ,
114115 trl_cnt: trailer_iovecs. as_ref( ) . map( |v| v. len( ) ) . unwrap_or( 0 ) as i32
115116 } ,
116- header_iovecs,
117- trailer_iovecs,
118- )
117+ _headers : header_iovecs,
118+ _trailers : trailer_iovecs,
119+ }
119120 }
120121 }
121122 } else if #[ cfg( solarish) ] {
@@ -221,7 +222,7 @@ cfg_if! {
221222 let flags: u32 = ( ra32 << 16 ) | ( flags. bits( ) as u32 ) ;
222223 let mut bytes_sent: off_t = 0 ;
223224 let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
224- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
225+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
225226 let return_code = unsafe {
226227 libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
227228 out_sock. as_fd( ) . as_raw_fd( ) ,
@@ -264,7 +265,7 @@ cfg_if! {
264265 ) -> ( Result <( ) >, off_t) {
265266 let mut bytes_sent: off_t = 0 ;
266267 let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
267- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
268+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
268269 let return_code = unsafe {
269270 libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
270271 out_sock. as_fd( ) . as_raw_fd( ) ,
@@ -310,7 +311,7 @@ cfg_if! {
310311 ) -> ( Result <( ) >, off_t) {
311312 let mut len = count. unwrap_or( 0 ) ;
312313 let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
313- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
314+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
314315 let return_code = unsafe {
315316 libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
316317 out_sock. as_fd( ) . as_raw_fd( ) ,
0 commit comments