[GODRIVER-700] JSON scanner fails when underlying reader reads less than the requested bytes and also returns io.EOF Created: 13/Dec/18 Updated: 28/Oct/23 Resolved: 15/Dec/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | JSON & ExtJSON |
| Affects Version/s: | None |
| Fix Version/s: | 0.2.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Craig Wilson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Issue is here: https://github.com/mongodb/mongo-go-driver/blob/6310dd3c4b6b7db65c30139cb2396288e7d6a7e1/bson/bsonrw/json_scanner.go#L100-L104
Just because the underying reader returned io.EOF doesn't mean it totally failed. In this case, the gzip.Reader will return EOF and also less than the requested number of bytes, which are still valid bytes.
|
| Comments |
| Comment by Githook User [ 14/Dec/18 ] |
|
Author: {'username': 'craiggwilson', 'email': 'craiggwilson@gmail.com', 'name': 'Craig Wilson'}Message: Change-Id: Ibad8c2dcada1f5ea0d88129681cdf1d57f51f9a3 |