1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for CONC-320:

Non blocking/asynchronous support for OpenSSL and GnuTLS.
Please note that Schannel in asynchronous mode is not supported yet.
This commit is contained in:
Georg Richter
2018-04-17 10:35:49 +02:00
parent 1b95733b57
commit f226c3b257
5 changed files with 139 additions and 17 deletions

View File

@@ -155,7 +155,9 @@ static int async1(MYSQL *unused __attribute__((unused)))
mysql_options(&mysql, MYSQL_OPT_READ_TIMEOUT, &default_timeout);
mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, &default_timeout);
mysql_options(&mysql, MYSQL_OPT_WRITE_TIMEOUT, &default_timeout);
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp");
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp");
if (force_tls)
mysql_ssl_set(&mysql, NULL, NULL, NULL, NULL,NULL);
/* Returns 0 when done, else flag for what to wait for when need to block. */
status= mysql_real_connect_start(&ret, &mysql, hostname, username, password, schema, port, socketname, 0);
@@ -170,6 +172,12 @@ static int async1(MYSQL *unused __attribute__((unused)))
FAIL_IF(!ret, "Failed to mysql_real_connect()");
}
if (force_tls && !mysql_get_ssl_cipher(&mysql))
{
diag("Error: No tls connection");
return FAIL;
}
status= mysql_real_query_start(&err, &mysql, SL("SHOW STATUS"));
while (status)
{