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

Streaming download fails with "Invalid argument" for public node #74

Closed
vozhyk- opened this issue Apr 3, 2015 · 6 comments
Closed

Streaming download fails with "Invalid argument" for public node #74

vozhyk- opened this issue Apr 3, 2015 · 6 comments

Comments

@vozhyk-
Copy link

vozhyk- commented Apr 3, 2015

Download to a file works correctly, but a streaming download fails with "Invalid argument".

% ./mega-streaming-test   
[00:58:13][info] Request (GET_PUBLIC_NODE) starting
[00:58:16][info] Request (GET_PUBLIC_NODE) finished
node size: 1790981
---- Normal download:
[00:58:17][info] Transfer (DOWNLOAD) starting. File: test
onTransferUpdate: buf 0 size 0
onTransferUpdate: buf 0 size 2416
onTransferUpdate: buf 0 size 25368
onTransferUpdate: buf 0 size 288712
onTransferUpdate: buf 0 size 324352
onTransferUpdate: buf 0 size 408312
onTransferUpdate: buf 0 size 344280
onTransferUpdate: buf 0 size 257936
[00:58:17][info] Transfer (DOWNLOAD) finished. File: test
onTransferFinish: No error

---- Streaming download:
[00:58:18][warn] Transfer (DOWNLOAD) finished with error: Invalid argument File: (NULL)
onTransferFinish: Invalid argument

https://gist.github.com/vozhyk-/800b1591dea1a6f60804#file-main-cpp

@vozhyk- vozhyk- changed the title segfault in streaming download Streaming download fails with "Invalid argument" for public node Apr 6, 2015
@vozhyk-
Copy link
Author

vozhyk- commented Apr 6, 2015

It seems the error is returned from src/megaapi_impl.cpp:6452

---- Streaming download:

Breakpoint 13, mega::MegaApiImpl::sendPendingTransfers (this=0x61c060)
    at src/megaapi_impl.cpp:6452
6452                    if(!node && !publicNode) { e = API_EARGS; break; }
(gdb) cont
Continuing.

Breakpoint 1, mega::MegaError::getErrorString (errorCode=-2)
    at src/megaapi.cpp:650
650                 return "Invalid argument";
(gdb) cont
Continuing.
[01:26:32][warn] Transfer (DOWNLOAD) finished with error: Invalid argument File: (NULL)

@vozhyk-
Copy link
Author

vozhyk- commented Apr 6, 2015

Now I see, this just isn't implemented.

//TODO: Implement streaming of public nodes

But anyway, the error was returned from src/megaapi_impl.cpp:6555 only after I've set publicNode to the value it had during non-streaming download using gdb.

@javiserrano
Copy link
Contributor

Hi, thank you for your report!
I have just implemented streaming of public nodes in the last commit of the master branch.
Please, let me know if there is still any problem.

@vozhyk-
Copy link
Author

vozhyk- commented Apr 6, 2015

Great, thanks! I will see how it works.

@vozhyk- vozhyk- closed this as completed Apr 7, 2015
@javiserrano
Copy link
Contributor

Sorry for commenting in your closed issue.
I've seen your megahttp project and it looks really good :-)
Please, don't hesitate to contact us if you find any bug in our SDK, if you have any doubt about its usage or you need some assistance.

@vozhyk-
Copy link
Author

vozhyk- commented Apr 10, 2015

I'm glad you like it:) . 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

No branches or pull requests

2 participants