File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ parser-num = ["extendedbigdecimal", "num-traits"]
170170parser-size = [" parser-num" , " procfs" ]
171171parser-glob = [" glob" ]
172172parser = [" parser-num" , " parser-size" , " parser-glob" ]
173- pipes = []
173+ pipes = [" fs " ]
174174process = [" libc" ]
175175proc-info = [" tty" , " walkdir" ]
176176quoting-style = [" i18n-common" ]
Original file line number Diff line number Diff line change @@ -139,12 +139,12 @@ where
139139 // If the first splice manages to copy to the intermediate
140140 // pipe, but the second splice to stdout fails for some reason
141141 // we can recover by copying the data that we have from the
142- // intermediate pipe to stdout using normal read/write. Then
142+ // intermediate pipe to stdout using unbuffered read/write. Then
143143 // we tell the caller to fall back.
144144 debug_assert ! ( n <= MAX_ROOTLESS_PIPE_SIZE , "unexpected RAM usage" ) ;
145145 let mut drain = Vec :: with_capacity ( n) ;
146146 pipe_rd. take ( n as u64 ) . read_to_end ( & mut drain) ?;
147- dest . write_all ( & drain) ?;
147+ crate :: io :: write_all_raw ( dest , & drain) ?;
148148 return Ok ( true ) ;
149149 }
150150 }
@@ -210,9 +210,10 @@ pub fn send_n_bytes(
210210 }
211211 } else {
212212 debug_assert ! ( s <= MAX_ROOTLESS_PIPE_SIZE , "unexpected RAM usage" ) ;
213+ // drain pipe before fallback to raw write
213214 let mut drain = Vec :: with_capacity ( s) ;
214215 broker_r. take ( s as u64 ) . read_to_end ( & mut drain) ?;
215- target . write_all ( & drain) ?;
216+ crate :: io :: write_all_raw ( & target , & drain) ?;
216217 break true ;
217218 }
218219 }
You can’t perform that action at this time.
0 commit comments