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

Remove workaround after MDEV-13492 was fixed.

SSL connection on Windows used retry logic initially, to "fix" MDEV-13492
This actual bug is now understood, and was fixed a while ago.
Remove the workaround now.
This commit is contained in:
Vladislav Vaintroub
2025-04-17 19:43:06 +02:00
committed by Georg Richter
parent 55abb32038
commit 126a753069

View File

@@ -1553,42 +1553,8 @@ mysql_real_connect(MYSQL *mysql, const char *host, const char *user,
return my;
}
}
#ifndef HAVE_SCHANNEL
return mysql->methods->db_connect(mysql, host, user, passwd,
db, port, unix_socket, client_flag);
#else
/*
With older windows versions (prior Win 10) TLS connections periodically
fail with SEC_E_INVALID_TOKEN, SEC_E_BUFFER_TOO_SMALL or SEC_E_MESSAGE_ALTERED
error (see MDEV-13492). If the connect attempt returns on of these error codes
in mysql->net.extended_errno we will try to connect again (max. 3 times)
*/
#define MAX_SCHANNEL_CONNECT_ATTEMPTS 3
{
int ssl_retry= (mysql->options.use_ssl) ? MAX_SCHANNEL_CONNECT_ATTEMPTS : 1;
MYSQL *my= NULL;
while (ssl_retry)
{
if ((my= mysql->methods->db_connect(mysql, host, user, passwd,
db, port, unix_socket, client_flag | CLIENT_REMEMBER_OPTIONS)))
return my;
switch (mysql->net.extension->extended_errno) {
case SEC_E_INVALID_TOKEN:
case SEC_E_BUFFER_TOO_SMALL:
case SEC_E_MESSAGE_ALTERED:
ssl_retry--;
break;
default:
ssl_retry= 0;
break;
}
}
if (!my && !(client_flag & CLIENT_REMEMBER_OPTIONS))
mysql_close_options(mysql);
return my;
}
#endif
}
struct st_host {