aboutsummaryrefslogtreecommitdiffstats
path: root/net-im
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2018-10-23 07:54:46 +0800
committerMartin Matuska <mm@FreeBSD.org>2018-10-23 07:54:46 +0800
commit337148c3576b3397c6e9ef3428a31d28fca1ef4e (patch)
treec42c820b9ef5b7a75d08a91db39849aa621feb35 /net-im
parentb931799a11e75ed85abfbc40ca3bd1a9edc8674f (diff)
downloadfreebsd-ports-gnome-337148c3576b3397c6e9ef3428a31d28fca1ef4e.tar.gz
freebsd-ports-gnome-337148c3576b3397c6e9ef3428a31d28fca1ef4e.tar.zst
freebsd-ports-gnome-337148c3576b3397c6e9ef3428a31d28fca1ef4e.zip
net-im/jabberd: fix build errors with MariaDB 10.2
PR: 228382 Submitted by: Fabian Wenk <fabian@wenks.ch>
Diffstat (limited to 'net-im')
-rw-r--r--net-im/jabberd/Makefile2
-rw-r--r--net-im/jabberd/files/patch-storage__authreg_mysql.c34
2 files changed, 27 insertions, 9 deletions
diff --git a/net-im/jabberd/Makefile b/net-im/jabberd/Makefile
index 749b3af10d50..30cde0047284 100644
--- a/net-im/jabberd/Makefile
+++ b/net-im/jabberd/Makefile
@@ -3,7 +3,7 @@
PORTNAME= jabberd
PORTVERSION= 2.6.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net-im
MASTER_SITES= https://github.com/jabberd2/jabberd2/releases/download/${PORTNAME}-${DISTVERSION}/ \
LOCAL/matthew/${PORTNAME}
diff --git a/net-im/jabberd/files/patch-storage__authreg_mysql.c b/net-im/jabberd/files/patch-storage__authreg_mysql.c
index 9fb06786540f..0d0ea3a4a5d9 100644
--- a/net-im/jabberd/files/patch-storage__authreg_mysql.c
+++ b/net-im/jabberd/files/patch-storage__authreg_mysql.c
@@ -1,11 +1,29 @@
---- storage/authreg_mysql.c.orig 2016-05-22 15:52:07 UTC
+--- storage/authreg_mysql.c.orig 2018-10-22 23:49:34 UTC
+++ storage/authreg_mysql.c
-@@ -20,6 +20,8 @@
+@@ -489,6 +489,8 @@ DLLEXPORT int ar_init(authreg_t ar) {
+ MYSQL *conn;
+ mysqlcontext_t mysqlcontext;
+ int fail = 0;
++ /* enable reconnect */
++ my_bool reconnect= 1;
- /* this module talks to a MySQL server via libmysqlclient */
+ /* configure the database context with field names and SQL statements */
+ mysqlcontext = (mysqlcontext_t) malloc( sizeof( struct mysqlcontext_st ) );
+@@ -620,6 +622,7 @@ DLLEXPORT int ar_init(authreg_t ar) {
-+#include <stdio.h>
-+
- #define _XOPEN_SOURCE 500
- #include "c2s.h"
- #include <mysql.h>
+ mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, "jabberd");
+ mysql_options(conn, MYSQL_SET_CHARSET_NAME, "utf8");
++ mysql_options(conn, MYSQL_OPT_RECONNECT, (void *)&reconnect);
+
+ /* connect with CLIENT_INTERACTIVE to get a (possibly) higher timeout value than default */
+ if(mysql_real_connect(conn, host, user, pass, dbname, atoi(port), NULL, CLIENT_INTERACTIVE) == NULL) {
+@@ -628,9 +631,6 @@ DLLEXPORT int ar_init(authreg_t ar) {
+ }
+
+ mysql_query(conn, "SET NAMES 'utf8'");
+-
+- /* Set reconnect flag to 1 (set to 0 by default from mysql 5 on) */
+- conn->reconnect = 1;
+
+ ar->user_exists = _ar_mysql_user_exists;
+ if (MPC_PLAIN == mysqlcontext->password_type) {