Commits
- Commit:
c74282f87c41aad90bbd9edc99c3c1fe45d65953
- From:
- Stephen Day <stevvooe@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #30 from stevvooe/truncate-twrite-msize
channel: truncate twrite messages based on msize
- Commit:
0f5f58bba93f6b0a435fdf59157ef453a2291ba1
- From:
- Stephen J Day <stephen.day@docker.com>
- Date:
channel: truncate twrite messages based on msize
While there are a few problems around handling of msize, the easiest to
address and, arguably, the most problematic is that of Twrite. We now
truncate Twrite.Data to the correct length if it will overflow the msize
limit negotiated on the session. ErrShortWrite is returned by the
`Session.Write` method if written data is truncated.
In addition, we now reject incoming messages from `ReadFcall` that
overflow the msize. Such messages are probably terminal in practice, but
can be detected with the `Overflow` function.
Tread is also handled accordingly, such that the Count field will be
rewritten such that the response doesn't overflow the msize.
Signed-off-by: Stephen J Day <stephen.day@docker.com>