Module: kamailio
Branch: master
Commit: eeb17678d77548073a59b54c0a08ebdb48b25fa2
URL: 
https://github.com/kamailio/kamailio/commit/eeb17678d77548073a59b54c0a08ebdb48b25fa2

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2024-10-08T14:31:29+02:00

kazoo: fix deprecation warning

fixes #3466

>From 
>https://github.com/alanxz/rabbitmq-c/blob/c3e4176659aac7d0e497da90a46c08c63b98282a/include/rabbitmq-c/ssl_socket.h#L250
> * \deprecated Since v0.13.0 this is a no-op. OpenSSL automatically manages
> *    library initialization and uninitialization.

> Warning: kz_amqp.c:857: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/kazoo/kz_amqp.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/eeb17678d77548073a59b54c0a08ebdb48b25fa2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/eeb17678d77548073a59b54c0a08ebdb48b25fa2.patch

---

diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index ed696116514..d702990e8b8 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, 
amqp_channel_t channel)
        kz_amqp_error("closing channel",
                        amqp_channel_close(rmq->conn, channel, 
AMQP_REPLY_SUCCESS));
 }
-
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
 int kz_ssl_initialized = 0;
-
+#endif
 int kz_amqp_connection_open_ssl(kz_amqp_conn_ptr rmq)
 {
-
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
        if(!kz_ssl_initialized) {
                kz_ssl_initialized = 1;
                amqp_set_initialize_ssl_library(1);
        }
-
+#endif
        if(!(rmq->conn = amqp_new_connection())) {
                LM_ERR("Failed to create new AMQP connection\n");
                goto error;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to