-
Notifications
You must be signed in to change notification settings - Fork 533
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
Recv and send all bytes via network #510
Conversation
Sorry for several issues: I'm not very experienced in github |
0748763
to
247e7bf
Compare
Test in broken in master: #513 |
I like the proposed solution, but I am wondering why this issue is coming up now. Isn't it the callers responsibility to call the API until all data is available? @bagder @willco007 |
@mback2k I was just thinking the same thing. The solution seems good, but it seems odd this would be coming up now. |
Indeed clients are currently handling this, and this code is also in examples. |
73757ae
to
8f2f057
Compare
Looking at the code further, I think @pkittenis is right. All the places in sftp.c I looked at all take into account the possibility of a partial reply. |
OK, let's fix only definitely broken function =). As far as I see length is checked for other usages of Could I ask you to review next iteration of this patch? |
Are there any comments for patch? Could I provide any help here? |
Could you please take a look at this issue? |
Could I provide any help to move forward this issue? |
Hi all! I have client based on libssh2, that suffers from this very issue since my ssh-agent yields chunked data. |
Describe the bug
libssh2 functions return error LIBSSH2_ERROR_AGENT_PROTOCOL for valid client-server protocol.
Reason: posix functions
recv()
/send()
accept buffer_start_pointer and buffer_len. Theese functions return succeed len which could be less then buffer_len. libssh2 doesn't cover this case ( 1, 2 ): so only part of message could be finished.It leads to operations with garbage at the end of buffer on
recv()
.For example in agent_list_identities() in my project:
To Reproduce
I can't provide real steps in client: it depends on network quality and server side.
Expected behavior
Functions should return success code if client-server protocol is correct.
Version (please complete the following information):
Additional context
Duplicate: #511