소스 검색

Clear receive token in Console Device (#62)

conradgrobler 2 년 전
부모
커밋
1bcb15cc9b
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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)