ixcobra / fix crash in CobraConnection::publishNext when the queue is empty + handle CobraConnection_PublishMode_Batch in CobraMetricsThreadedPublisher
This commit is contained in:
parent
06297ac756
commit
3c8cd6289b
@ -1 +1 @@
|
|||||||
6.2.9
|
6.3.0
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [6.3.0] - 2019-09-28
|
||||||
|
|
||||||
|
- ixcobra / fix crash in CobraConnection::publishNext when the queue is empty + handle CobraConnection_PublishMode_Batch in CobraMetricsThreadedPublisher
|
||||||
|
|
||||||
## [6.2.9] - 2019-09-27
|
## [6.2.9] - 2019-09-27
|
||||||
|
|
||||||
- mbedtls fixes / the unittest now pass on macOS, and hopefully will on Windows/AppVeyor as well.
|
- mbedtls fixes / the unittest now pass on macOS, and hopefully will on Windows/AppVeyor as well.
|
||||||
|
@ -233,6 +233,11 @@ namespace ix
|
|||||||
_publishMode = publishMode;
|
_publishMode = publishMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CobraConnectionPublishMode CobraConnection::getPublishMode()
|
||||||
|
{
|
||||||
|
return _publishMode;
|
||||||
|
}
|
||||||
|
|
||||||
void CobraConnection::configure(const std::string& appkey,
|
void CobraConnection::configure(const std::string& appkey,
|
||||||
const std::string& endpoint,
|
const std::string& endpoint,
|
||||||
const std::string& rolename,
|
const std::string& rolename,
|
||||||
@ -487,10 +492,11 @@ namespace ix
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(_queueMutex);
|
std::lock_guard<std::mutex> lock(_queueMutex);
|
||||||
|
|
||||||
|
if (_messageQueue.empty()) return true;
|
||||||
|
|
||||||
auto&& msg = _messageQueue.back();
|
auto&& msg = _messageQueue.back();
|
||||||
if (!publishMessage(msg))
|
if (!publishMessage(msg))
|
||||||
{
|
{
|
||||||
_messageQueue.push_back(msg);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_messageQueue.pop_back();
|
_messageQueue.pop_back();
|
||||||
|
@ -114,6 +114,9 @@ namespace ix
|
|||||||
/// Set the publish mode
|
/// Set the publish mode
|
||||||
void setPublishMode(CobraConnectionPublishMode publishMode);
|
void setPublishMode(CobraConnectionPublishMode publishMode);
|
||||||
|
|
||||||
|
/// Query the publish mode
|
||||||
|
CobraConnectionPublishMode getPublishMode();
|
||||||
|
|
||||||
/// Lifecycle management. Free resources when backgrounding
|
/// Lifecycle management. Free resources when backgrounding
|
||||||
void suspend();
|
void suspend();
|
||||||
void resume();
|
void resume();
|
||||||
|
@ -166,7 +166,10 @@ namespace ix
|
|||||||
|
|
||||||
case MessageKind::Message:
|
case MessageKind::Message:
|
||||||
{
|
{
|
||||||
_cobra_connection.publishNext();
|
if (_cobra_connection.getPublishMode() == CobraConnection_PublishMode_Immediate)
|
||||||
|
{
|
||||||
|
_cobra_connection.publishNext();
|
||||||
|
}
|
||||||
}; break;
|
}; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "6.2.9"
|
#define IX_WEBSOCKET_VERSION "6.3.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user