@@ -95,7 +95,10 @@ impl Processor {
95
95
96
96
fn list_files ( & self , path : & str ) -> anyhow:: Result < Response > {
97
97
let dir_path = Path :: new ( & self . root_dir ) . join ( path) ;
98
- log:: info!( "Listing files at {}" , dir_path. to_str( ) . unwrap_or( "<Unknown>" ) ) ;
98
+ log:: info!(
99
+ "Listing files at {}" ,
100
+ dir_path. to_str( ) . unwrap_or( "<Unknown>" )
101
+ ) ;
99
102
// Ideally we should find a way to learn the size of all files, but we need to
100
103
// iterate over all files anyway... so.. maybe not? :/
101
104
let mut files: Vec < File > = vec ! [ ] ;
@@ -143,7 +146,8 @@ impl Processor {
143
146
let mut buf = vec ! [ 0 ; chunk_size as usize ] ;
144
147
for offset in ( 0 ..file_size) . step_by ( chunk_size as usize ) {
145
148
file. read ( & mut buf) ?;
146
- assert_eq ! ( file. stream_position( ) . unwrap( ) , offset) ;
149
+ // TODO: somehow stream_position doesn't work correctly?
150
+ // assert_eq!(file.stream_position().unwrap(), offset);
147
151
send ( CommandResponse {
148
152
id : req_id. to_string ( ) ,
149
153
response : FetchFileChunk {
@@ -216,9 +220,12 @@ pub async fn process_events(
216
220
Ok ( request) => processor. as_mut ( ) . unwrap ( ) . process (
217
221
& request,
218
222
|response : CommandResponse | match response. response {
219
- FetchFileChunk { .. } => {
220
- // TODO:
221
- }
223
+ FetchFileChunk { .. } => client
224
+ . send (
225
+ FrameType :: Binary ( false ) ,
226
+ & rmp_serde:: to_vec ( & response) . unwrap ( ) ,
227
+ )
228
+ . unwrap ( ) ,
222
229
_ => client
223
230
. send (
224
231
FrameType :: Text ( false ) ,
0 commit comments