Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/websockets/libwebsockets/LibWebsocketClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ bool LibWebsocketClient::connect(const std::string& url,
info.port = CONTEXT_PORT_NO_LISTEN;
info.protocols = protocols;
info.timeout_secs = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::seconds>(connect_timeout).count());
info.log_cx = &m_logs_context;
m_credentials = credentials;
info.connect_timeout_secs =
static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::seconds>(connect_timeout).count());
info.log_cx = &m_logs_context;
m_credentials = credentials;
if (m_url.protocol() == "wss")
{
if (!m_credentials.tls12_cipher_list.empty())
Expand Down Expand Up @@ -505,6 +507,12 @@ int LibWebsocketClient::eventCallback(struct lws* wsi, enum lws_callback_reasons
{
retry = true;
}

SendMsg* msg;
while (client->m_send_msgs.pop(msg, 0))
{
delete msg;
}
break;

default:
Expand Down
19 changes: 13 additions & 6 deletions src/websockets/libwebsockets/LibWebsocketClientPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void LibWebsocketClientPool::process()

// Dummy vhost to handle context related events
struct lws_protocols protocols[] = {{"LibWebsocketClientPool", &LibWebsocketClientPool::eventCallback, 0, 0, 0, this, 0},
LWS_PROTOCOL_LIST_TERM};
LWS_PROTOCOL_LIST_TERM};
struct lws_context_creation_info vhost_info;
memset(&vhost_info, 0, sizeof(vhost_info));
vhost_info.protocols = protocols;
Expand Down Expand Up @@ -443,11 +443,12 @@ void LibWebsocketClientPool::Client::connectCallback(struct lws_sorted_usec_list
// Fill vhost information
struct lws_context_creation_info vhost_info;
memset(&vhost_info, 0, sizeof(vhost_info));
vhost_info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
vhost_info.port = CONTEXT_PORT_NO_LISTEN;
vhost_info.timeout_secs = client->m_connect_timeout;
vhost_info.protocols = protocols;
vhost_info.log_cx = &pool->m_logs_context;
vhost_info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
vhost_info.port = CONTEXT_PORT_NO_LISTEN;
vhost_info.timeout_secs = client->m_connect_timeout;
vhost_info.connect_timeout_secs = client->m_connect_timeout;
vhost_info.protocols = protocols;
vhost_info.log_cx = &pool->m_logs_context;
if (client->m_url.protocol() == "wss")
{
if (!client->m_credentials.tls12_cipher_list.empty())
Expand Down Expand Up @@ -686,6 +687,12 @@ int LibWebsocketClientPool::Client::eventCallback(
{
retry = true;
}

SendMsg* msg;
while (client->m_send_msgs.pop(msg, 0))
{
delete msg;
}
break;

default:
Expand Down