Dave Cheney
unread,Aug 11, 2012, 4:06:36 AM8/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to da...@cheney.net, gusta...@gmail.com, a...@golang.org, ful...@gmail.com, hu...@google.com, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
> "Methods like channel.stdin.Write still need to check that they are not
> passing more than maxpacket - header worth of data."
>
> As soon as you do anything vaguely interesting like using Stdin as an
> io.Writer to which you write protocol buffers, gob, or large strings,
> you don't really have control over how large your writes are.
Ahh, yes, that does need some explaining. TL;DR the contract for
stdin.Write is not changing.
What is changing is callers to channel.writePacket() need to be aware
there is a limit, and that limit is channel.maxPacket. In the case of
callers like stdin.Write, they also need to consider the 9 byte header
that precedes the data. That is also taken care of by
chanWriter.Write.
Hopefully this clarifies things.