-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Binary support for saltpack commands #1727
Conversation
@@ -190,6 +188,10 @@ func (d *decoder) Read(p []byte) (int, error) { | |||
d.nbuf -= numBytesToDecode | |||
copy(d.buf[0:d.nbuf], d.buf[numBytesToDecode:numBytesToDecode+d.nbuf]) | |||
|
|||
if ret == 0 && d.err == nil && len(p) != 0 { | |||
return 0, io.EOF | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this fix a bug you ran into?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patrick mentioned something about today on the slack channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see slack and TestBinaryInput in armor_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an infinite loop without this.
Looks good to me apart from the printfs. |
Thanks, I just removed them. |
if err == nil { | ||
t.Errorf("Armor62Open worked on binary data: m == %x, hdr == %q, ftr == %q", m, hdr, ftr) | ||
} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not crazy about this: Armor62Open with invalid data returns nil, "", "", nil.
Add test for Armor62Open on binary data infinite loop
4dace90
to
c6e3424
Compare
r? @maxtaco @oconnor663