hashicorp/yamux

Unnecessary loop in Session.send()

slackpad opened this issue · 1 comments

While spelunking I noticed that there's a loop that attempts to write all bytes of a header:

https://github.com/hashicorp/yamux/blob/master/session.go#L358

Looking at the Go documentation, a Write() call that doesn't get all the bytes out will always return a non-nil error, so this loop can never run. We should just delete the loop.

Nevermind - I was looking at a more specific conn type - in general this loop is ok.