[Asterisk-code-review] tcptls: improve type-safety of periodic_fn callback argument. (asterisk[master])

Jaco Kroon asteriskteam at digium.com
Mon Sep 5 02:13:17 CDT 2022


Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19057 )


Change subject: tcptls: improve type-safety of periodic_fn callback argument.
......................................................................

tcptls: improve type-safety of periodic_fn callback argument.

Since the argument is always of type struct ast_tcptls_session_args*,
use that type rather than void*.

Change-Id: I2279b8d7365eb7f9ae513caaf90333fffc53863e
Signed-off-by: Jaco Kroon <jaco at uls.co.za>
---
M include/asterisk/tcptls.h
M main/manager.c
2 files changed, 15 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/57/19057/1

diff --git a/include/asterisk/tcptls.h b/include/asterisk/tcptls.h
index 1b1b56c..b417209 100644
--- a/include/asterisk/tcptls.h
+++ b/include/asterisk/tcptls.h
@@ -138,7 +138,7 @@
 	/*! Server accept_fn thread ID used for external shutdown requests. */
 	pthread_t master;
 	void *(*accept_fn)(void *); /*!< the function in charge of doing the accept */
-	void (*periodic_fn)(void *);/*!< something we may want to run before after select on the accept socket */
+	void (*periodic_fn)(struct ast_tcptls_session_args *);/*!< something we may want to run before after select on the accept socket */
 	void *(*worker_fn)(void *); /*!< the function in charge of doing the actual work */
 	const char *name;
 	struct ast_tls_config *old_tls_cfg; /*!< copy of the SSL configuration to determine whether changes have been made */
diff --git a/main/manager.c b/main/manager.c
index eb0459e..d03b46c 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -8635,7 +8635,7 @@
 /*! \brief cleanup code called at each iteration of server_root,
  * guaranteed to happen every 5 seconds at most
  */
-static void purge_old_stuff(void *data)
+static void purge_old_stuff(struct ast_tcptls_session_args *data)
 {
 	purge_sessions(1);
 	purge_events();

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19057
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I2279b8d7365eb7f9ae513caaf90333fffc53863e
Gerrit-Change-Number: 19057
Gerrit-PatchSet: 1
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220905/101bbdcd/attachment-0001.html>


More information about the asterisk-code-review mailing list