Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

correct file size for raw node #88

Merged
merged 2 commits into from
Apr 21, 2021

Conversation

coryschwartz
Copy link

@coryschwartz coryschwartz commented Apr 16, 2021

While looking at ipfs/kubo#7916 I noticed the file size returned by https://github.com/ipfs/go-ipfs/blob/master/core/commands/get.go#L80 is 0 for this raw dag.

◉ ipfs get QmasYd9docsEaozsdZxCp29yfoZoUJDrvqgkT8Hry66N24
Saving file(s) to QmasYd9docsEaozsdZxCp29yfoZoUJDrvqgkT8Hry66N24
 111.50 KiB / 111.50 KiB [===========================================================================] 100.00% 0s
◉ curl localhost:8082/ipfs/QmasYd9docsEaozsdZxCp29yfoZoUJDrvqgkT8Hry66N24 -o /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  111k  100  111k    0     0  13.6M      0 --:--:-- --:--:-- --:--:-- 13.6M

@welcome
Copy link

welcome bot commented Apr 16, 2021

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@coryschwartz coryschwartz changed the title io/dagreader.go correct file size for raw node Apr 16, 2021
return pbdata.GetFilesize(), nil
case pb.Data_Symlink, pb.Data_Raw:
Copy link
Author

@coryschwartz coryschwartz Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Raw types, data 0 bytes in the data section, but the filesize is set.

i.e.

Type:Raw Data:"" filesize:114178 blocksizes:114178

@coryschwartz coryschwartz marked this pull request as ready for review April 16, 2021 22:36
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Stebalien Stebalien merged commit a20f6cb into ipfs:master Apr 21, 2021
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Jorropo pushed a commit to Jorropo/go-libipfs that referenced this pull request Jan 25, 2023
…filesize-raw

correct file size for raw node

This commit was moved from ipfs/go-unixfs@a20f6cb
Jorropo pushed a commit to ipfs/go-libipfs-rapide that referenced this pull request Mar 23, 2023
…filesize-raw

correct file size for raw node

This commit was moved from ipfs/go-unixfs@a20f6cb
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants