Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
sftp request does not complete with authentication failure in multi mode #357
When executing an sftp request with the multi interface, it doesn't seem to complete if the request fails due to an authentication error. It seems easy enough to reproduce with the hiperfifo example. After starting hiperfifo, I send the url "sftp://s@localhost/var/l", which results in the following output:
Note that the last message is "No identity would match", but the REMAINING count is still one. So, the request is still active. Compare this to the output of curl against the same url:
Note the "Authentication failure" message that shows up here, but not in multi mode. So, it seems like the final state transition is not happening. It also looks like the problem does not occur in all multi-mode interfaces, it might just be when using curl_multi_socket_action(). I tried to write a test program that used curl_multi_wait()/curl_multi_perform() and that seemed to work.
The SSH state machine didn't clear the 'rc' variable appropriately in a two places which prevented it from looping the way it should. And it lacked an 'else' statement that made it possible to erroneously get stuck in the SSH_AUTH_AGENT state. Reported-by: Tim Stack Closes curl#357