Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 5435041

Browse files
author
Alex Helfet
committed
Comments about bugs.
1 parent 6fd6291 commit 5435041

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/bin/itmdump.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,21 @@ fn run() -> Result<()> {
117117
Err(Error(ErrorKind::Io(ref e), _))
118118
if e.kind() == io::ErrorKind::UnexpectedEof => {
119119
if follow {
120-
// TODO: There's a bug here where we can lose
121-
// data. UnexpectedEof is returned when
122-
// read_exact() encounters EOF before it fills its
123-
// buffer, but in that case it may have already
124-
// read _some_ data, which we discard here.
120+
// FIXME: We can lose data here. UnexpectedEof is
121+
// returned when read_exact() encounters EOF
122+
// before it fills its buffer, but in that case it
123+
// may have already read _some_ data, which we
124+
// discard.
125125
//
126126
// Instead we could buffer input until we can read
127-
// a full packet, or turn parsing into a state
128-
// machine.
127+
// a full packet, turn parsing into a state
128+
// machine, or create a reader that sleeps on EOF.
129129
thread::sleep(Duration::from_millis(100));
130130
} else {
131131
// !follow and EOF. Exit.
132+
133+
// FIXME: We may have reached EOF part way into a
134+
// packet but don't report missing data.
132135
return Ok(())
133136
}
134137
},

0 commit comments

Comments
 (0)