Fold SSL_want constants into SSL_get_error constants.
There's no sense in having two of these (with similar but slightly
different numbers, no less!). Fold them together and remove the
redundant SSL_want constants. Almost everything uses SSL_get_error.
Update-Note: Most of the SSL_want constants have been removed, except
SSL_NOTHING, SSL_READING, and SSL_WRITING which are used by external
code.
Change-Id: I75727f7cf6333694767ce8129ee6815fd464c163
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/37187
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/ssl_buffer.cc b/ssl/ssl_buffer.cc
index b94f081..49ecf90 100644
--- a/ssl/ssl_buffer.cc
+++ b/ssl/ssl_buffer.cc
@@ -116,7 +116,7 @@
int ret =
BIO_read(ssl->rbio.get(), buf->data(), static_cast<int>(buf->cap()));
if (ret <= 0) {
- ssl->s3->rwstate = SSL_READING;
+ ssl->s3->rwstate = SSL_ERROR_WANT_READ;
return ret;
}
buf->DidWrite(static_cast<size_t>(ret));
@@ -138,7 +138,7 @@
int ret = BIO_read(ssl->rbio.get(), buf->data() + buf->size(),
static_cast<int>(len - buf->size()));
if (ret <= 0) {
- ssl->s3->rwstate = SSL_READING;
+ ssl->s3->rwstate = SSL_ERROR_WANT_READ;
return ret;
}
buf->DidWrite(static_cast<size_t>(ret));
@@ -243,7 +243,7 @@
while (!buf->empty()) {
int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size());
if (ret <= 0) {
- ssl->s3->rwstate = SSL_WRITING;
+ ssl->s3->rwstate = SSL_ERROR_WANT_WRITE;
return ret;
}
buf->Consume(static_cast<size_t>(ret));
@@ -260,7 +260,7 @@
int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size());
if (ret <= 0) {
- ssl->s3->rwstate = SSL_WRITING;
+ ssl->s3->rwstate = SSL_ERROR_WANT_WRITE;
// If the write failed, drop the write buffer anyway. Datagram transports
// can't write half a packet, so the caller is expected to retry from the
// top.