whitequark 7 жил өмнө
parent
commit
64d306340b

+ 1 - 1
src/socket/tcp.rs

@@ -1375,7 +1375,7 @@ impl<'a> TcpSocket<'a> {
                     (Some(remote_last_ts), Some(timeout))
                     (Some(remote_last_ts), Some(timeout))
                             if !self.tx_buffer.is_empty() =>
                             if !self.tx_buffer.is_empty() =>
                         Some(remote_last_ts + timeout),
                         Some(remote_last_ts + timeout),
-                    (None, Some(timeout)) =>
+                    (None, Some(_timeout)) =>
                         Some(0),
                         Some(0),
                     (_, _) =>
                     (_, _) =>
                         None
                         None

+ 1 - 1
src/storage/assembler.rs

@@ -152,7 +152,7 @@ impl Assembler {
         while index != self.contigs.len() && size != 0 {
         while index != self.contigs.len() && size != 0 {
             let contig = self.contigs[index];
             let contig = self.contigs[index];
 
 
-            if let Some(new_offset) = offset.checked_sub(contig.total_size()) {
+            if offset >= contig.total_size() {
                 // The range being added does not cover this contig, skip it.
                 // The range being added does not cover this contig, skip it.
                 index += 1;
                 index += 1;
             } else if offset == 0 && size >= contig.hole_size && index > 0 {
             } else if offset == 0 && size >= contig.hole_size && index > 0 {