Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calling wait_io_or_timeout() (pass is_read properly for writes) #249

Open
wants to merge 1 commit into
base: 3.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libmariadb/secure/gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ ssize_t ma_tls_write(MARIADB_TLS *ctls, const uchar* buffer, size_t length)
{
if (rc != GNUTLS_E_AGAIN && rc != GNUTLS_E_INTERRUPTED)
break;
if (pvio->methods->wait_io_or_timeout(pvio, TRUE, pvio->mysql->options.write_timeout) < 1)
if (pvio->methods->wait_io_or_timeout(pvio, FALSE, pvio->mysql->options.write_timeout) < 1)
break;
}
if (rc <= 0) {
Expand Down
4 changes: 2 additions & 2 deletions libmariadb/secure/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ my_bool ma_tls_connect(MARIADB_TLS *ctls)
try_connect= 0;
break;
case SSL_ERROR_WANT_WRITE:
if (pvio->methods->wait_io_or_timeout(pvio, TRUE, mysql->options.connect_timeout) < 1)
if (pvio->methods->wait_io_or_timeout(pvio, FALSE, mysql->options.connect_timeout) < 1)
try_connect= 0;
break;
default:
Expand Down Expand Up @@ -656,7 +656,7 @@ ssize_t ma_tls_write(MARIADB_TLS *ctls, const uchar* buffer, size_t length)
int error= SSL_get_error((SSL *)ctls->ssl, rc);
if (error != SSL_ERROR_WANT_WRITE)
break;
if (pvio->methods->wait_io_or_timeout(pvio, TRUE, pvio->mysql->options.write_timeout) < 1)
if (pvio->methods->wait_io_or_timeout(pvio, FALSE, pvio->mysql->options.write_timeout) < 1)
break;
}
if (rc <= 0)
Expand Down