Permit connTLSWrite to handle a zero sized write

Former-commit-id: 4be609ff2c80fd6261edc214bb099d6cf6ab1db3
This commit is contained in:
John Sully 2022-01-06 19:15:31 -05:00
parent ce95ae7800
commit 258291efcc

View File

@ -817,6 +817,9 @@ static int connTLSWrite(connection *conn_, const void *data, size_t data_len) {
tls_connection *conn = (tls_connection *) conn_;
int ret, ssl_err;
if (data_len == 0)
return 0;
if (conn->c.state != CONN_STATE_CONNECTED) return -1;
ERR_clear_error();
ret = SSL_write(conn->ssl, data, data_len);