Module: kamailio
Branch: master
Commit: b8c0a3757eb282ddb9e4878deb7120c4efd7f571
URL:
https://github.com/kamailio/kamailio/commit/b8c0a3757eb282ddb9e4878deb7120c…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-02-03T10:41:43+01:00
db_mysql: fix build for stretch
* mysql_optionsv is not there. We still use the deprecated flavour
* MYSQL_OPT_SSL_ENFORCE is not there
---
Modified: src/modules/db_mysql/km_my_con.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b8c0a3757eb282ddb9e4878deb7120c…
Patch:
https://github.com/kamailio/kamailio/commit/b8c0a3757eb282ddb9e4878deb7120c…
---
diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 88c950417a6..b4c4dca33b0 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -129,10 +129,14 @@ struct my_con *db_mysql_new_connection(const struct db_id *id)
case 2: /* SSL_MODE_PREFERRED */
case 3: /* SSL_MODE_REQUIRED */
case 4: /* SSL_MODE_VERIFY_CA */
- mysql_optionsv(ptr->con, MYSQL_OPT_SSL_ENFORCE, (void *)&(int){1});
+#if MYSQL_VERSION_ID >= 100339
+ mysql_options(ptr->con, MYSQL_OPT_SSL_ENFORCE, (void *)&(int){1});
+#else
+ LM_WARN("ssl mode not supported by %s\n", MARIADB_BASE_VERSION);
+#endif
break;
case 5: /* SSL_MODE_VERIFY_IDENTITY */
- mysql_optionsv(ptr->con, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ mysql_options(ptr->con, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(void *)&(int){1});
break;
default: