mirror of
https://github.com/curl/curl.git
synced 2026-07-23 10:57:18 +03:00
openssl: return -1 on error in the BIO callbacks
BIO_read and BIO_write return negative numbers on error, including
retryable ones. A regression from 55807e6. Both branches should be
returning -1.
The APIs are patterned after POSIX read and write which, similarly,
return -1 on errors, not zero, with EAGAIN treated as an error.
Bug: https://github.com/curl/curl/issues/10013#issuecomment-1335308146
Reported-by: David Benjamin
Closes #10021
This commit is contained in:
parent
0ed8ff2d37
commit
5ec759247a
1 changed files with 2 additions and 12 deletions
|
|
@ -713,13 +713,8 @@ static int bio_cf_out_write(BIO *bio, const char *buf, int blen)
|
|||
BIO_clear_retry_flags(bio);
|
||||
connssl->backend->io_result = result;
|
||||
if(nwritten < 0) {
|
||||
if(CURLE_AGAIN == result) {
|
||||
if(CURLE_AGAIN == result)
|
||||
BIO_set_retry_write(bio);
|
||||
nwritten = 0;
|
||||
}
|
||||
else {
|
||||
nwritten = -1;
|
||||
}
|
||||
}
|
||||
return (int)nwritten;
|
||||
}
|
||||
|
|
@ -743,13 +738,8 @@ static int bio_cf_in_read(BIO *bio, char *buf, int blen)
|
|||
BIO_clear_retry_flags(bio);
|
||||
connssl->backend->io_result = result;
|
||||
if(nread < 0) {
|
||||
if(CURLE_AGAIN == result) {
|
||||
if(CURLE_AGAIN == result)
|
||||
BIO_set_retry_read(bio);
|
||||
nread = 0;
|
||||
}
|
||||
else {
|
||||
nread = -1;
|
||||
}
|
||||
}
|
||||
return (int)nread;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue