- Notifications
You must be signed in to change notification settings - Fork2.5k
Clear data after negotiation#6947
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Just as well we have tests for this... I think I'm on the right lines here though. |
@@ -433,6 +433,7 @@ int git_smart__negotiate_fetch( | |||
if ((error = git_smart__negotiation_step(&t->parent, data.ptr, data.size)) < 0) | |||
goto on_error; | |||
git_str_clear(&data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You are indeed - I think that you need to differentiate the clearing of data based on whether we're in RPC mode (HTTP) or not (SSH).
git_str_clear(&data); | |
if (!t->rpc) | |
git_str_clear(&data); |
?
eb84531
intolibgit2:mainUh oh!
There was an error while loading.Please reload this page.
Fixes#6889.
I'm not sure why this works with https and not ssh. There are claims it works with the ssh "exec" backend but that wasn't the case for me.
Because we don't clear the data buffer, the "wants" get sent twice to the server. The second time is the call to git_smart__negotiation_step in line 568 of smart_protocol.c