Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary loop in Session.send() #10

Closed
slackpad opened this issue Aug 18, 2015 · 1 comment
Closed

Unnecessary loop in Session.send() #10

slackpad opened this issue Aug 18, 2015 · 1 comment

Comments

@slackpad
Copy link
Contributor

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.

@slackpad
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant