View | Details | Raw Unified | Return to bug 246880
Collapse All | Expand All

(-)Makefile (-2 / +5 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	mosquitto
4
PORTNAME=	mosquitto
5
PORTVERSION=	1.6.7
5
PORTVERSION=	1.6.8
6
CATEGORIES=	net
6
CATEGORIES=	net
7
MASTER_SITES=	http://mosquitto.org/files/source/
7
MASTER_SITES=	http://mosquitto.org/files/source/
8
8
Lines 23-29 Link Here
23
23
24
PLIST_SUB=	PORTVERSION=${PORTVERSION}
24
PLIST_SUB=	PORTVERSION=${PORTVERSION}
25
25
26
OPTIONS_DEFINE=	CARES WS
26
OPTIONS_DEFINE=	CARES WS NETDATA
27
OPTIONS_DEFAULT=	CARES
27
OPTIONS_DEFAULT=	CARES
28
28
29
CARES_LIB_DEPENDS=	libcares.so:dns/c-ares
29
CARES_LIB_DEPENDS=	libcares.so:dns/c-ares
Lines 33-38 Link Here
33
WS_LIB_DEPENDS=	libwebsockets.so:net/libwebsockets
33
WS_LIB_DEPENDS=	libwebsockets.so:net/libwebsockets
34
WS_CMAKE_ON=	-DWITH_WEBSOCKETS:BOOL=ON
34
WS_CMAKE_ON=	-DWITH_WEBSOCKETS:BOOL=ON
35
35
36
NETDATA_DESC=	Apply netdata compatibility patches
37
NETDATA_EXTRA_PATCHES=	${FILESDIR}/extra-patch-netdata
38
36
post-patch:
39
post-patch:
37
	@${REINPLACE_CMD} -e '/ldconfig/d' ${WRKSRC}/src/CMakeLists.txt \
40
	@${REINPLACE_CMD} -e '/ldconfig/d' ${WRKSRC}/src/CMakeLists.txt \
38
		${WRKSRC}/lib/CMakeLists.txt ${WRKSRC}/lib/cpp/CMakeLists.txt
41
		${WRKSRC}/lib/CMakeLists.txt ${WRKSRC}/lib/cpp/CMakeLists.txt
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1571605357
1
TIMESTAMP = 1590873457
2
SHA256 (mosquitto-1.6.7.tar.gz) = bcd31a8fbbd053fee328986fadd8666d3058357ded56b9782f7d4f19931d178e
2
SHA256 (mosquitto-1.6.8.tar.gz) = 7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6
3
SIZE (mosquitto-1.6.7.tar.gz) = 591062
3
SIZE (mosquitto-1.6.8.tar.gz) = 589873
(-)files/extra-patch-netdata (+96 lines)
Line 0 Link Here
1
--- lib/mosquitto.c
2
+++ lib/mosquitto.c
3
@@ -75,6 +75,14 @@ int mosquitto_lib_cleanup(void)
4
 	return MOSQ_ERR_SUCCESS;
5
 }
6
 
7
+int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count))
8
+{
9
+	if(mosq) {
10
+		mosq->external_read_fnc = external_read_fnc;
11
+		mosq->external_write_fnc = external_write_fnc;
12
+	}
13
+}
14
+
15
 struct mosquitto *mosquitto_new(const char *id, bool clean_start, void *userdata)
16
 {
17
 	struct mosquitto *mosq = NULL;
18
--- lib/mosquitto.h
19
+++ lib/mosquitto.h
20
@@ -222,6 +222,7 @@ libmosq_EXPORT int mosquitto_lib_init(void);
21
  */
22
 libmosq_EXPORT int mosquitto_lib_cleanup(void);
23
 
24
+libmosq_EXPORT int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count));
25
 
26
 /* ======================================================================
27
  *
28
--- lib/mosquitto_internal.h
29
+++ lib/mosquitto_internal.h
30
@@ -346,6 +346,8 @@ struct mosquitto {
31
 #ifdef WITH_EPOLL
32
 	uint32_t events;
33
 #endif
34
+	size_t (*external_read_fnc)(void *buf, size_t count);
35
+	size_t (*external_write_fnc)(void *buf, size_t count);
36
 };
37
 
38
 #define STREMPTY(str) (str[0] == '\0')
39
--- lib/net_mosq.c
40
+++ lib/net_mosq.c
41
@@ -824,6 +824,11 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host)
42
 /* Create a socket and connect it to 'ip' on port 'port'.  */
43
 int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, const char *bind_address, bool blocking)
44
 {
45
+	if(mosq->external_write_fnc) {
46
+		mosq->sock = 777;
47
+		return MOSQ_ERR_SUCCESS;
48
+	}
49
+
50
 	mosq_sock_t sock = INVALID_SOCKET;
51
 	int rc, rc2;
52
 
53
@@ -853,6 +858,10 @@ ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
54
 	int err;
55
 #endif
56
 	assert(mosq);
57
+
58
+	if(mosq->external_read_fnc)
59
+		return mosq->external_read_fnc(buf, count);
60
+
61
 	errno = 0;
62
 #ifdef WITH_TLS
63
 	if(mosq->ssl){
64
@@ -900,6 +909,9 @@ ssize_t net__write(struct mosquitto *mosq, void *buf, size_t count)
65
 #endif
66
 	assert(mosq);
67
 
68
+	if(mosq->external_write_fnc)
69
+		return mosq->external_write_fnc(buf, count);
70
+
71
 	errno = 0;
72
 #ifdef WITH_TLS
73
 	if(mosq->ssl){
74
75
--- lib/mosquitto.c
76
+++ lib/mosquitto.c
77
@@ -75,7 +75,7 @@ int mosquitto_lib_cleanup(void)
78
 	return MOSQ_ERR_SUCCESS;
79
 }
80
 
81
-int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count))
82
+void mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count))
83
 {
84
 	if(mosq) {
85
 		mosq->external_read_fnc = external_read_fnc;
86
--- lib/mosquitto.h
87
+++ lib/mosquitto.h
88
@@ -222,7 +222,7 @@ libmosq_EXPORT int mosquitto_lib_init(void);
89
  */
90
 libmosq_EXPORT int mosquitto_lib_cleanup(void);
91
 
92
-libmosq_EXPORT int mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count));
93
+libmosq_EXPORT void mosquitto_external_callbacks_set(struct mosquitto *mosq, size_t (*external_write_fnc)(void *buf, size_t count), size_t (*external_read_fnc)(void *buf, size_t count));
94
 
95
 /* ======================================================================
96
  *
(-)files/patch-CMakeLists.txt (-14 / +2 lines)
Lines 1-8 Link Here
1
Index: CMakeLists.txt
1
Index: CMakeLists.txt
2
===================================================================
2
===================================================================
3
--- CMakeLists.txt.orig
3
--- CMakeLists.txt.orig	2019-11-28 17:15:13 UTC
4
+++ CMakeLists.txt
4
+++ CMakeLists.txt
5
@@ -15,6 +15,9 @@ set (VERSION 1.6.4)
5
@@ -15,6 +15,9 @@ set (VERSION 1.6.8)
6
 
6
 
7
 add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")
7
 add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")
8
 
8
 
Lines 12-26 Link Here
12
 if (WIN32)
12
 if (WIN32)
13
 	add_definitions("-D_CRT_SECURE_NO_WARNINGS")
13
 	add_definitions("-D_CRT_SECURE_NO_WARNINGS")
14
 	add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")
14
 	add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")
15
@@ -108,9 +111,9 @@ install(FILES mosquitto.conf aclfile.exa
16
 # ========================================
17
 
18
 configure_file(libmosquitto.pc.in libmosquitto.pc @ONLY)
19
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
20
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquitto.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")
21
 configure_file(libmosquittopp.pc.in libmosquittopp.pc @ONLY)
22
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
23
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libmosquittopp.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")
24
 
25
 # ========================================
26
 # Testing
(-)files/patch-config.mk (-2 / +2 lines)
Lines 1-8 Link Here
1
Index: config.mk
1
Index: config.mk
2
===================================================================
2
===================================================================
3
--- config.mk.orig
3
--- config.mk.orig	2019-11-28 17:15:13 UTC
4
+++ config.mk
4
+++ config.mk
5
@@ -283,7 +283,7 @@ ifeq ($(WITH_WEBSOCKETS),static)
5
@@ -288,7 +288,7 @@ ifeq ($(WITH_WEBSOCKETS),static)
6
 endif
6
 endif
7
 
7
 
8
 INSTALL?=install
8
 INSTALL?=install
(-)files/patch-mosquitto.conf (-1 / +1 lines)
Lines 1-6 Link Here
1
Index: mosquitto.conf
1
Index: mosquitto.conf
2
===================================================================
2
===================================================================
3
--- mosquitto.conf.orig
3
--- mosquitto.conf.orig	2019-11-28 17:15:13 UTC
4
+++ mosquitto.conf
4
+++ mosquitto.conf
5
@@ -158,7 +158,7 @@
5
@@ -158,7 +158,7 @@
6
 # This should be set to /var/run/mosquitto.pid if mosquitto is
6
 # This should be set to /var/run/mosquitto.pid if mosquitto is
(-)files/patch-src_CMakeLists.txt (-1 / +1 lines)
Lines 1-6 Link Here
1
Index: src/CMakeLists.txt
1
Index: src/CMakeLists.txt
2
===================================================================
2
===================================================================
3
--- src/CMakeLists.txt.orig
3
--- src/CMakeLists.txt.orig	2019-11-28 17:15:13 UTC
4
+++ src/CMakeLists.txt
4
+++ src/CMakeLists.txt
5
@@ -126,6 +126,7 @@ if (WIN32 OR CYGWIN)
5
@@ -126,6 +126,7 @@ if (WIN32 OR CYGWIN)
6
 endif (WIN32 OR CYGWIN)
6
 endif (WIN32 OR CYGWIN)
(-)files/patch-src_mosquitto__passwd.c (-3 / +3 lines)
Lines 1-8 Link Here
1
Index: src/mosquitto_passwd.c
1
Index: src/mosquitto_passwd.c
2
===================================================================
2
===================================================================
3
--- src/mosquitto_passwd.c.orig
3
--- src/mosquitto_passwd.c.orig	2019-11-28 17:15:13 UTC
4
+++ src/mosquitto_passwd.c
4
+++ src/mosquitto_passwd.c
5
@@ -141,7 +141,7 @@ int output_new_password(FILE *fptr, cons
5
@@ -141,7 +141,7 @@ int output_new_password(FILE *fptr, const char *userna
6
 	unsigned char hash[EVP_MAX_MD_SIZE];
6
 	unsigned char hash[EVP_MAX_MD_SIZE];
7
 	unsigned int hash_len;
7
 	unsigned int hash_len;
8
 	const EVP_MD *digest;
8
 	const EVP_MD *digest;
Lines 11-17 Link Here
11
 	EVP_MD_CTX context;
11
 	EVP_MD_CTX context;
12
 #else
12
 #else
13
 	EVP_MD_CTX *context;
13
 	EVP_MD_CTX *context;
14
@@ -168,7 +168,7 @@ int output_new_password(FILE *fptr, cons
14
@@ -168,7 +168,7 @@ int output_new_password(FILE *fptr, const char *userna
15
 		return 1;
15
 		return 1;
16
 	}
16
 	}
17
 
17
 
(-)files/patch-src_security__default.c (-2 / +2 lines)
Lines 1-4 Link Here
1
--- src/security_default.c.orig	2018-10-11 00:28:56 UTC
1
--- src/security_default.c.orig	2019-11-28 17:15:13 UTC
2
+++ src/security_default.c
2
+++ src/security_default.c
3
@@ -18,7 +18,7 @@ Contributors:
3
@@ -18,7 +18,7 @@ Contributors:
4
 
4
 
Lines 8-11 Link Here
8
+#include <openssl/opensslv.h>
8
+#include <openssl/opensslv.h>
9
 #include "mosquitto_broker_internal.h"
9
 #include "mosquitto_broker_internal.h"
10
 #include "memory_mosq.h"
10
 #include "memory_mosq.h"
11
 #include "util_mosq.h"
11
 #include "mqtt_protocol.h"

Return to bug 246880