mirror of https://github.com/sipwise/sems.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
929 B
42 lines
929 B
|
|
#include "XmlRpcSource.h"
|
|
#include "XmlRpcSocket.h"
|
|
#include "XmlRpcUtil.h"
|
|
|
|
namespace XmlRpc {
|
|
|
|
|
|
XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/)
|
|
: _ssl(false), _ssl_ctx(NULL), _ssl_ssl(NULL), _ssl_meth(NULL),
|
|
_fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false)
|
|
{
|
|
}
|
|
|
|
XmlRpcSource::~XmlRpcSource()
|
|
{
|
|
}
|
|
|
|
|
|
void
|
|
XmlRpcSource::close()
|
|
{
|
|
if (_fd != -1) {
|
|
XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
|
|
XmlRpcSocket::close(_fd);
|
|
XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd);
|
|
_fd = -1;
|
|
}
|
|
if (_deleteOnClose) {
|
|
XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
|
|
_deleteOnClose = false;
|
|
delete this;
|
|
}
|
|
if (_ssl_ssl != (SSL *) NULL) {
|
|
SSL_shutdown (_ssl_ssl);
|
|
SSL_free (_ssl_ssl);
|
|
SSL_CTX_free (_ssl_ctx);
|
|
}
|
|
}
|
|
|
|
} // namespace XmlRpc
|