summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavide Galassi <davide.galassi@gmail.com>2016-04-18 15:48:27 +0200
committerRichard Levitte <levitte@openssl.org>2016-04-20 21:26:01 +0200
commita043d0b91d62fd8526a3fd791e3ad2ebcf888cd9 (patch)
treebb424b3424eea85e44b75fe1174155716c75789b
parent098a23828fb8914e39f8d441a57e1c6486d8d97c (diff)
BIO socket connect failure was not handled correctly.
The state was always set to BIO_CONN_S_OK. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r--crypto/bio/bss_conn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index a4949b3d60..c1abe87e25 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -198,7 +198,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
ret = BIO_connect(b->num, BIO_ADDRINFO_address(c->addr_iter),
BIO_SOCK_KEEPALIVE | c->connect_mode);
b->retry_reason = 0;
- if (ret < 0) {
+ if (ret == 0) {
if (BIO_sock_should_retry(ret)) {
BIO_set_retry_special(b);
c->state = BIO_CONN_S_BLOCKED_CONNECT;