Module: kamailio
Branch: master
Commit: a2f7147dded679d025a902aa12beb048ee714c32
URL:
https://github.com/kamailio/kamailio/commit/a2f7147dded679d025a902aa12beb04…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-10-08T14:17:34+02:00
rabbitmq: remove deprecation warning
From
https://github.com/alanxz/rabbitmq-c/blob/c3e4176659aac7d0e497da90a46c08c63…
* \deprecated Since v0.13.0 this is a no-op. OpenSSL
automatically manages
* library initialization and uninitialization.
Warning: rabbitmq.c:574:3: warning:
'amqp_set_initialize_ssl_library' is deprecated [-Wdeprecated-declarations]
amqp_set_initialize_ssl_library(1);
^
/usr/include/rabbitmq-c/ssl_socket.h:249:1: note:
'amqp_set_initialize_ssl_library' has been explicitly marked deprecated here
AMQP_DEPRECATED_EXPORT
^
/usr/include/rabbitmq-c/export.h:29:46: note: expanded from macro
'AMQP_DEPRECATED_EXPORT'
# define AMQP_DEPRECATED_EXPORT AMQP_EXPORT AMQP_DEPRECATED
^
/usr/include/rabbitmq-c/export.h:25:43: note: expanded from macro
'AMQP_DEPRECATED'
# define AMQP_DEPRECATED __attribute__ ((__deprecated__))
^
1 warning generated.
---
Modified: src/modules/rabbitmq/rabbitmq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a2f7147dded679d025a902aa12beb04…
Patch:
https://github.com/kamailio/kamailio/commit/a2f7147dded679d025a902aa12beb04…
---
diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c
index 9b57e7a834c..709055dc9ab 100644
--- a/src/modules/rabbitmq/rabbitmq.c
+++ b/src/modules/rabbitmq/rabbitmq.c
@@ -87,7 +87,9 @@ static int max_reconnect_attempts = 1;
static int timeout_sec = 1;
static int timeout_usec = 0;
static int direct_reply_to = 0;
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
static int amqp_ssl_init_called = 0;
+#endif
/* module helper functions */
static int rabbitmq_connect(amqp_connection_state_t *conn);
@@ -569,12 +571,14 @@ static int rabbitmq_connect(amqp_connection_state_t *conn)
int log_ret;
// amqp_rpc_reply_t reply;
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
// amqp_ssl_init_called should only be called once
if(amqp_info.ssl && !amqp_ssl_init_called) {
amqp_set_initialize_ssl_library(1);
amqp_ssl_init_called = 1;
LM_DBG("AMQP SSL library initialized\n");
}
+#endif
// establish a new connection to RabbitMQ server
*conn = amqp_new_connection();