1
1

channel_free: ignore problems with channel_close()

As was pointed out in bug #182, we must not return failure from
_libssh2_channel_free() when _libssh2_channel_close() returns an error
that isn't EAGAIN. It can effectively cause the function to never go
through, like it did now in the case where the socket was actually
closed but socket_state still said LIBSSH2_SOCKET_CONNECTED.

I consider this fix the right thing as it now also survives other
errors, even if making sure socket_state isn't lying is also a good
idea.
Этот коммит содержится в:
Daniel Stenberg 2010-06-30 22:47:22 +02:00
родитель 46be03f92b
Коммит c375e5e5ad

Просмотреть файл

@ -2387,10 +2387,9 @@ int _libssh2_channel_free(LIBSSH2_CHANNEL *channel)
if(rc == LIBSSH2_ERROR_EAGAIN)
return rc;
else if (rc < 0) {
channel->free_state = libssh2_NB_state_idle;
return rc;
}
/* ignore all other errors as they otherwise risk blocking the channel
free from happening */
}
channel->free_state = libssh2_NB_state_idle;