summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2018-10-26 10:06:48 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-10-26 10:06:48 +0200
commit47729028fa39c2743d13713ec26f029473c8e262 (patch)
treee6fb3eb9a08c1e515228dcf43086b5bdf65ac378
parent751f1ac312f576104024de56f92a1e1edf799e2c (diff)
downloadcurl-bagder/gtls-values-never-read.tar.gz
openssl: make 'done' a proper booleanbagder/gtls-values-never-read
-rw-r--r--lib/vtls/openssl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 4d1a95ed4..b06705312 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -1262,7 +1262,7 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
ssize_t nread;
int buffsize;
int err;
- int done = 0;
+ bool done = FALSE;
/* This has only been tested on the proftpd server, and the mod_tls code
sends a close notify alert without waiting for a close notify alert in
@@ -1290,7 +1290,7 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
case SSL_ERROR_ZERO_RETURN: /* no more data */
/* This is the expected response. There was no data but only
the close notify alert */
- done = 1;
+ done = TRUE;
break;
case SSL_ERROR_WANT_READ:
/* there's data pending, re-invoke SSL_read() */
@@ -1299,7 +1299,7 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
case SSL_ERROR_WANT_WRITE:
/* SSL wants a write. Really odd. Let's bail out. */
infof(data, "SSL_ERROR_WANT_WRITE\n");
- done = 1;
+ done = TRUE;
break;
default:
/* openssl/ssl.h says "look at error stack/return value/errno" */
@@ -1309,20 +1309,20 @@ static int Curl_ossl_shutdown(struct connectdata *conn, int sockindex)
ossl_strerror(sslerror, buf, sizeof(buf)) :
SSL_ERROR_to_str(err)),
SOCKERRNO);
- done = 1;
+ done = TRUE;
break;
}
}
else if(0 == what) {
/* timeout */
failf(data, "SSL shutdown timeout");
- done = 1;
+ done = TRUE;
}
else {
/* anything that gets here is fatally bad */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
retval = -1;
- done = 1;
+ done = TRUE;
}
} /* while()-loop for the select() */