提交 ea837d79 编写于 作者: M Matt Caswell

Remove stale errors from early connection attempts in a client

The init_client() function in the apps sets up the client connection. It
may try multiple addresses until it finds one that works. We should clear
the error queue if we eventually get a successful connection because
otherwise we get stale errors hanging around. This can cause problems in
subsequent calls to SSL_get_error(), i.e. non-fatal NBIO events appear as
fatal.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 1697a81b
......@@ -195,6 +195,8 @@ int init_client(int *sock, const char *host, const char *port,
if (*sock == INVALID_SOCKET) {
ERR_print_errors(bio_err);
} else {
/* Remove any stale errors from previous connection attempts */
ERR_clear_error();
ret = 1;
}
BIO_ADDRINFO_free(res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册