Kaynağa Gözat

Clear receive token in Console Device (#62)

conradgrobler 2 yıl önce
ebeveyn
işleme
1bcb15cc9b
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      src/device/console.rs

+ 3 - 0
src/device/console.rs

@@ -155,6 +155,9 @@ impl<H: Hal, T: Transport> VirtIOConsole<'_, H, T> {
                 assert_ne!(len, 0);
                 self.cursor = 0;
                 self.pending_len = len as usize;
+                // Clear `receive_token` so that when the buffer is used up the next call to
+                // `poll_retrieve` will add a new pending request.
+                self.receive_token.take();
             }
         }
         Ok(flag)