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

LinkSize > 0 even when NumLinks === 0 #2260

Closed
daviddias opened this issue Jan 28, 2016 · 6 comments
Closed

LinkSize > 0 even when NumLinks === 0 #2260

daviddias opened this issue Jan 28, 2016 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws) kind/support A question or request for support

Comments

@daviddias
Copy link
Member

» ipfs object stat QmeGYYkoAwJWooGSoW9Lx1rEmkDfqpTXgGR4hCs7yDV6Wx
NumLinks: 0
BlockSize: 126
LinksSize: 2
DataSize: 124
CumulativeSize: 126

Is there any reason I'm missing on why it is 2?

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) kind/support A question or request for support labels Jan 28, 2016
@rht
Copy link
Contributor

rht commented Jan 28, 2016

@daviddias daviddias removed the kind/bug A bug in existing code (including security flaws) label Jan 28, 2016
@daviddias
Copy link
Member Author

oh, I see. Thank you @rht :)

@rht
Copy link
Contributor

rht commented Jan 29, 2016

(I'd consider it a bug. LinksSize can already be determined accurately through the sum of the size of the links. It doesn't make sense to put anything associated with the data to the links (this is certain). The framing and the encoded links should have been put into DataSize can be figured from BlockSize-DataSize.)

@whyrusleeping
Copy link
Member

yeah, that doesnt seem right to me. the comment is vague, i'm not sure what is meant to 'include framing'. with zero links, linksize should be zero

@daviddias daviddias added the kind/bug A bug in existing code (including security flaws) label Jan 29, 2016
@whyrusleeping
Copy link
Member

This should be resolved now. The links field is normalized to be null if no links are present. The two bytes was caused by a non-null but zero length links array in the protobuf

@daviddias
Copy link
Member Author

So, just to be sure, do we put an empty array on the protobuf taking those couple of bytes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) kind/support A question or request for support
Projects
None yet
Development

No branches or pull requests

3 participants