Ticket #128 (closed defect: fixed)
Error message is not updated on failure
|Reported by:||anonymous||Owned by:|
Error message in LIBSSH2_SESSION is not updated on failure in some places. For example (libssh2-1.2.2): src/userauth.c line 299 and line 1355 - no calls to libssh2_error(). When using libssh2_session_last_error(), I get messages from previous failure. As a result, my own error messages look like the following (error messages from libssh2 are "quoted"):
authentication by password failed: "Would block requesting userauth list"; authentication by keyboard-interactive failed: "Would block requesting userauth list".
Just adding function to clear current error message from session might be fine. Then it would be possible to save error message from one call, clear error message in session, then call another function and save its error message. Missing error messages can be treated as some generic failure.
Observed with non-blocking API on windows vista with custom build of libssh2-1.2.1 using Visual Studio 2005.