ferristseng / rust-ipfs-api

IPFS HTTP client in Rust
Apache License 2.0
247 stars 68 forks source link

Fix size fields of ObjectStat (and probably other things) #7

Closed icefoxen closed 6 years ago

icefoxen commented 6 years ago

The response::ObjectStatResponse uses isize for all its number fields. This is bad 'cause it will behave differently (and probably wrong) on 32-bit platforms (32-bit ARM, for instance).

Checked with the IPFS people and they say most sizes are stored as a u64, such as defined here: https://github.com/ipfs/go-ipfs/blob/master/merkledag/pb/merkledag.proto#L28 , "but assume it can grow to a 128 or so anytime" (🤦‍).

Say the word and I'll make a PR to fix all these, and (try to) figure out the appropriate sizes where necessary.

ferristseng commented 6 years ago

Yeah, if you could do that it would be awesome! I mostly just looked at the API documentation they have, which was really lacking (and incorrect in some places). There are probably some other places that can be revised too.

icefoxen commented 6 years ago

I feel your pain on the documentation front. ;-) I'll try to get around to this.