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

Maxsize of Libuplinkc download_read function #3499

Closed
shivam201312 opened this issue Nov 5, 2019 · 2 comments · Fixed by #3525
Closed

Maxsize of Libuplinkc download_read function #3499

shivam201312 opened this issue Nov 5, 2019 · 2 comments · Fixed by #3525

Comments

@shivam201312
Copy link

I am trying to download file for storj V3 network , for this purpose . i am using download_read function of the libuplinkc library

I have uploaded 999.4 KB of file on storj V3 network by using upload_write . i have created an array of size 200,00 and uploaded byte data on storj V3 network after reading data in chunk .
upload_write function is working fine it is uploading data of size 200,00 but when i am trying to download or read data from storj V3 network using download_read. i have some issue .

I passed length 200,00 to function download_read function but function downloads maximum 7408 size of stream from the storj V3 network .

I have added some print statement to the libuplinkc library.
download_read_function

Output of the following code

downloadoutput

Question :

  1. What is maximum size of downloading & uploading stream of data (upload function is uploading 200,00 size of data but download function is only downloading 7408 size of data )?
  2. Why download function is downloading max size of 7408 ?
@egonelbre
Copy link
Member

The amount of data being returned by Read depend on the different buffer sizes in uplink and storagenode, which may vary and change.

There are buffers in multiple places and Read returns as much as possible immediately without doing extra requests.

The length should be regarded as a the buffer size and returned size as how much was read. This does not imply anything about how much data actually can be read. So, in one call it could return 100B and in another 1MB.

To download all the content, you need to call download_read until you read 0 bytes or receive an error.

@ifraixedes ifraixedes added the Waiting for Feedback Waiting on Feedback of author label Nov 6, 2019
@ifraixedes ifraixedes removed the Waiting for Feedback Waiting on Feedback of author label Nov 11, 2019
@shivam201312
Copy link
Author

@egonelbre Thank you

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 a pull request may close this issue.

3 participants