File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ pub async fn fetch_data(
3232 request. write ( & mut stream) . await ?;
3333 stream. flush ( ) . await ?;
3434
35+ log:: trace!( "Wrote message" ) ;
36+
3537 // we expect the to receive messages to be smaller than data_buf
3638 let mut data_buf = vec ! [ 0 ; 4096 ] ;
3739 let mut bytes_received = 0 ;
@@ -51,7 +53,9 @@ pub async fn fetch_data(
5153 }
5254 } ;
5355
54- stream. shutdown ( ) . await ?;
56+ log:: trace!( "Received response" ) ;
57+
58+ let _ = stream. shutdown ( ) . await ;
5559
5660 let records: Vec < _ > = records. into_iter ( ) . map ( |r| r. into_owned ( ) ) . collect ( ) ;
5761
Original file line number Diff line number Diff line change @@ -760,6 +760,8 @@ impl<'a> Record<'a> {
760760 * buf = & buf[ ( 4 + record_length) ..] ;
761761 Ok ( res)
762762 } else {
763+ // Not enough data, last record
764+ * buf = & [ ] ;
763765 Ok ( None )
764766 }
765767 }
You can’t perform that action at this time.
0 commit comments