File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ impl hyper::body::Body for BodyKind {
173173 let mut chunk: [ u8 ; 4096 ] = [ 0u8 ; 4096 ] ;
174174 if let Ok ( n) = h. read ( & mut chunk) {
175175 let chunk = Bytes :: copy_from_slice ( & chunk[ ..n] ) ;
176+ log:: debug!( "Yielding chunk of length {}" , chunk. len( ) ) ;
176177 Poll :: Ready ( Some ( Ok ( Frame :: data ( chunk) ) ) )
177178 } else {
178179 Poll :: Ready ( None )
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use std::io::Read;
77use std:: io:: Write ;
88use std:: net:: TcpStream ;
99use std:: path:: Path ;
10+ use xz2:: write:: XzDecoder ;
1011
1112#[ derive( Clone ) ]
1213pub struct Client {
@@ -64,7 +65,10 @@ impl Client {
6465 }
6566
6667 pub fn download_raw ( & self , krate : & Crate ) -> Result < Vec < u8 > > {
67- self . download ( & self . tool . raw_crate_path ( krate) )
68+ let bytes = self . download ( & self . tool . raw_crate_path ( krate) ) ?;
69+ let mut decoder = XzDecoder :: new ( Vec :: new ( ) ) ;
70+ decoder. write_all ( & bytes) ?;
71+ Ok ( decoder. finish ( ) ?)
6872 }
6973
7074 fn download ( & self , key : & str ) -> Result < Vec < u8 > > {
You can’t perform that action at this time.
0 commit comments