Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
What happens here is the following: When using chunked encoding, the ChunkStream sometimes mixes async and sync requests on the underlying stream. The async calls work great - just the sync ones create problems. In this particular bug, the server returns two ApplicationData records - one big one and then a smaller one. The chunk parser requests a sync read of 1024 bytes which then result in a series of sync reads on the underlying network stream. The first two or three network reads don't return enough data to fill the huge ApplicationData record - the last one then returns so much data that it fills both the remainder of the first record and the entire second one. If the caller issued a second sync read, then the implementation would catch this - but the async code path does not.
- Loading branch information