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

Binary support for saltpack commands #1727

Merged
merged 6 commits into from
Jan 14, 2016
Merged

Binary support for saltpack commands #1727

merged 6 commits into from
Jan 14, 2016

Conversation

patrickxb
Copy link
Contributor

@@ -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
}
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@oconnor663
Copy link
Contributor

Looks good to me apart from the printfs.

@patrickxb
Copy link
Contributor Author

Thanks, I just removed them.

if err == nil {
t.Errorf("Armor62Open worked on binary data: m == %x, hdr == %q, ftr == %q", m, hdr, ftr)
}
*/
Copy link
Contributor Author

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.

@patrickxb patrickxb force-pushed the patrickxb/CORE-2328 branch from 4dace90 to c6e3424 Compare January 14, 2016 17:21
@patrickxb patrickxb merged commit c6e3424 into master Jan 14, 2016
@patrickxb patrickxb deleted the patrickxb/CORE-2328 branch January 14, 2016 17:24
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

Successfully merging this pull request may close these issues.

3 participants