Updates all usages of ast_tcptls_session_instance to be managed by reference counts so that they only get destroyed when all threads are done using

them, and memory does not get free'd causing strange issues with SIP. 

This code was originally written by russellb in the team/group/issue_11972/ branch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Brett Bryant
2008-06-17 21:46:57 +00:00
parent 9d403c379f
commit 2aae0ba13d
7 changed files with 99 additions and 76 deletions

View File

@@ -50,6 +50,7 @@
#define _ASTERISK_SERVER_H
#include "asterisk/utils.h"
#include "asterisk/astobj2.h"
#if defined(HAVE_OPENSSL) && (defined(HAVE_FUNOPEN) || defined(HAVE_FOPENCOOKIE))
#define DO_SSL /* comment in/out if you want to support ssl */
@@ -127,6 +128,7 @@ struct ast_tcptls_session_instance {
int client;
struct sockaddr_in requestor;
struct server_args *parent;
ast_mutex_t lock;
};
/*! \brief
@@ -166,11 +168,4 @@ void *ast_make_file_from_fd(void *data);
HOOK_T ast_tcptls_server_read(struct ast_tcptls_session_instance *ser, void *buf, size_t count);
HOOK_T ast_tcptls_server_write(struct ast_tcptls_session_instance *ser, void *buf, size_t count);
/*!
* \brief Destroy a server instance
*
* \return NULL for convenience
*/
struct ast_tcptls_session_instance *ast_tcptls_session_instance_destroy(struct ast_tcptls_session_instance *i);
#endif /* _ASTERISK_SERVER_H */