This repository was archived by the owner on Dec 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -117,18 +117,21 @@ fn run() -> Result<()> {
117
117
Err ( Error ( ErrorKind :: Io ( ref e) , _) )
118
118
if e. kind ( ) == io:: ErrorKind :: UnexpectedEof => {
119
119
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.
125
125
//
126
126
// 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 .
129
129
thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
130
130
} else {
131
131
// !follow and EOF. Exit.
132
+
133
+ // FIXME: We may have reached EOF part way into a
134
+ // packet but don't report missing data.
132
135
return Ok ( ( ) )
133
136
}
134
137
} ,
You can’t perform that action at this time.
0 commit comments