|
|
|
@ -856,7 +856,6 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
|
|
|
|
errno = 0;
|
|
|
|
|
#ifdef WITH_TLS
|
|
|
|
|
if(mosq->ssl){
|
|
|
|
|
ERR_clear_error();
|
|
|
|
|
ret = SSL_read(mosq->ssl, buf, count);
|
|
|
|
|
if(ret <= 0){
|
|
|
|
|
err = SSL_get_error(mosq->ssl, ret);
|
|
|
|
@ -871,6 +870,7 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
|
|
|
|
net__print_ssl_error(mosq);
|
|
|
|
|
errno = EPROTO;
|
|
|
|
|
}
|
|
|
|
|
ERR_clear_error();
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
WSASetLastError(errno);
|
|
|
|
|
#endif
|
|
|
|
@ -904,7 +904,6 @@ ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count)
|
|
|
|
|
#ifdef WITH_TLS
|
|
|
|
|
if(mosq->ssl){
|
|
|
|
|
mosq->want_write = false;
|
|
|
|
|
ERR_clear_error();
|
|
|
|
|
ret = SSL_write(mosq->ssl, buf, count);
|
|
|
|
|
if(ret < 0){
|
|
|
|
|
err = SSL_get_error(mosq->ssl, ret);
|
|
|
|
@ -919,6 +918,7 @@ ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count)
|
|
|
|
|
net__print_ssl_error(mosq);
|
|
|
|
|
errno = EPROTO;
|
|
|
|
|
}
|
|
|
|
|
ERR_clear_error();
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
WSASetLastError(errno);
|
|
|
|
|
#endif
|
|
|
|
|