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
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;
}
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;
}