Compare commits
1 Commits
v7.6.5
...
feature/ma
Author | SHA1 | Date | |
---|---|---|---|
|
8192da790f |
@@ -1,16 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All changes to this project will be documented in this file.
|
All changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [7.6.5] - 2019-12-24
|
|
||||||
|
|
||||||
(cobra client) send a websocket ping every 30s to keep the connection opened
|
|
||||||
|
|
||||||
## [7.6.4] - 2019-12-22
|
## [7.6.4] - 2019-12-22
|
||||||
|
|
||||||
(client) error handling, quote url in error case when failing to parse one
|
(client) error handling, quote url in error case when failing to parse one
|
||||||
(ws) ws_cobra_publish: register callbacks before connecting
|
(ws) ws_cobra_publish: register callbacks before connecting
|
||||||
(doc) mention mbedtls in supported ssl server backend
|
(doc) mention mbedtls in supported ssl server backend
|
||||||
|
|
||||||
|
|
||||||
## [7.6.3] - 2019-12-20
|
## [7.6.3] - 2019-12-20
|
||||||
|
|
||||||
(tls) add a simple description of the TLS configuration routine for debugging
|
(tls) add a simple description of the TLS configuration routine for debugging
|
||||||
|
@@ -24,7 +24,6 @@ namespace ix
|
|||||||
PublishTrackerCallback CobraConnection::_publishTrackerCallback = nullptr;
|
PublishTrackerCallback CobraConnection::_publishTrackerCallback = nullptr;
|
||||||
constexpr size_t CobraConnection::kQueueMaxSize;
|
constexpr size_t CobraConnection::kQueueMaxSize;
|
||||||
constexpr CobraConnection::MsgId CobraConnection::kInvalidMsgId;
|
constexpr CobraConnection::MsgId CobraConnection::kInvalidMsgId;
|
||||||
constexpr int CobraConnection::kPingIntervalSecs;
|
|
||||||
|
|
||||||
CobraConnection::CobraConnection() :
|
CobraConnection::CobraConnection() :
|
||||||
_webSocket(new WebSocket()),
|
_webSocket(new WebSocket()),
|
||||||
@@ -229,10 +228,6 @@ namespace ix
|
|||||||
ss << "HTTP Status: " << msg->errorInfo.http_status << std::endl;
|
ss << "HTTP Status: " << msg->errorInfo.http_status << std::endl;
|
||||||
invokeErrorCallback(ss.str(), std::string());
|
invokeErrorCallback(ss.str(), std::string());
|
||||||
}
|
}
|
||||||
else if (msg->type == ix::WebSocketMessageType::Pong)
|
|
||||||
{
|
|
||||||
invokeEventCallback(ix::CobraConnection_EventType_Pong);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +260,6 @@ namespace ix
|
|||||||
_webSocket->setUrl(url);
|
_webSocket->setUrl(url);
|
||||||
_webSocket->setPerMessageDeflateOptions(webSocketPerMessageDeflateOptions);
|
_webSocket->setPerMessageDeflateOptions(webSocketPerMessageDeflateOptions);
|
||||||
_webSocket->setTLSOptions(socketTLSOptions);
|
_webSocket->setTLSOptions(socketTLSOptions);
|
||||||
_webSocket->setPingInterval(kPingIntervalSecs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@@ -30,8 +30,7 @@ namespace ix
|
|||||||
CobraConnection_EventType_Closed = 3,
|
CobraConnection_EventType_Closed = 3,
|
||||||
CobraConnection_EventType_Subscribed = 4,
|
CobraConnection_EventType_Subscribed = 4,
|
||||||
CobraConnection_EventType_UnSubscribed = 5,
|
CobraConnection_EventType_UnSubscribed = 5,
|
||||||
CobraConnection_EventType_Published = 6,
|
CobraConnection_EventType_Published = 6
|
||||||
CobraConnection_EventType_Pong = 7
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CobraConnectionPublishMode
|
enum CobraConnectionPublishMode
|
||||||
@@ -216,9 +215,6 @@ namespace ix
|
|||||||
|
|
||||||
// Each pdu sent should have an incremental unique id
|
// Each pdu sent should have an incremental unique id
|
||||||
std::atomic<uint64_t> _id;
|
std::atomic<uint64_t> _id;
|
||||||
|
|
||||||
// Frequency at which we send a websocket ping to the backing cobra connection
|
|
||||||
static constexpr int kPingIntervalSecs = 30;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ix
|
} // namespace ix
|
||||||
|
@@ -65,10 +65,6 @@ namespace ix
|
|||||||
{
|
{
|
||||||
ss << "Published message " << msgId << " acked";
|
ss << "Published message " << msgId << " acked";
|
||||||
}
|
}
|
||||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
|
||||||
{
|
|
||||||
ss << "Received websocket pong";
|
|
||||||
}
|
|
||||||
|
|
||||||
ix::IXCoreLogger::Log(ss.str().c_str());
|
ix::IXCoreLogger::Log(ss.str().c_str());
|
||||||
});
|
});
|
||||||
|
@@ -146,8 +146,52 @@ namespace ix
|
|||||||
|
|
||||||
bool SocketAppleSSL::accept(std::string& errMsg)
|
bool SocketAppleSSL::accept(std::string& errMsg)
|
||||||
{
|
{
|
||||||
errMsg = "TLS not supported yet in server mode with apple ssl backend";
|
OSStatus status;
|
||||||
return false;
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
|
|
||||||
|
_sslContext = SSLCreateContext(kCFAllocatorDefault, kSSLServerSide, kSSLStreamType);
|
||||||
|
|
||||||
|
SSLSetIOFuncs(_sslContext, SocketAppleSSL::readFromSocket, SocketAppleSSL::writeToSocket);
|
||||||
|
SSLSetConnection(_sslContext, (SSLConnectionRef)(long) _sockfd);
|
||||||
|
SSLSetProtocolVersionMin(_sslContext, kTLSProtocol12);
|
||||||
|
|
||||||
|
if (_tlsOptions.isPeerVerifyDisabled())
|
||||||
|
{
|
||||||
|
Boolean option(1);
|
||||||
|
SSLSetSessionOption(_sslContext, kSSLSessionOptionBreakOnServerAuth, option);
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = SSLHandshake(_sslContext);
|
||||||
|
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||||
|
|
||||||
|
if (status == errSSLServerAuthCompleted)
|
||||||
|
{
|
||||||
|
// proceed with the handshake
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = SSLHandshake(_sslContext);
|
||||||
|
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = SSLHandshake(_sslContext);
|
||||||
|
} while (errSSLWouldBlock == status || errSSLServerAuthCompleted == status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (noErr != status)
|
||||||
|
{
|
||||||
|
errMsg = getSSLErrorDescription(status);
|
||||||
|
close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No wait support
|
// No wait support
|
||||||
|
@@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "7.6.5"
|
#define IX_WEBSOCKET_VERSION "7.6.4"
|
||||||
|
@@ -91,10 +91,6 @@ namespace ix
|
|||||||
spdlog::info("Published message id {} acked", msgId);
|
spdlog::info("Published message id {} acked", msgId);
|
||||||
messageAcked = true;
|
messageAcked = true;
|
||||||
}
|
}
|
||||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
|
||||||
{
|
|
||||||
spdlog::info("Received websocket pong");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
conn.connect();
|
conn.connect();
|
||||||
|
@@ -100,10 +100,6 @@ namespace ix
|
|||||||
{
|
{
|
||||||
spdlog::error("Published message hacked: {}", msgId);
|
spdlog::error("Published message hacked: {}", msgId);
|
||||||
}
|
}
|
||||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
|
||||||
{
|
|
||||||
spdlog::info("Received websocket pong");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
@@ -245,10 +245,6 @@ namespace ix
|
|||||||
{
|
{
|
||||||
spdlog::error("Published message hacked: {}", msgId);
|
spdlog::error("Published message hacked: {}", msgId);
|
||||||
}
|
}
|
||||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
|
||||||
{
|
|
||||||
spdlog::info("Received websocket pong");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
@@ -160,10 +160,6 @@ namespace ix
|
|||||||
{
|
{
|
||||||
spdlog::error("Published message hacked: {}", msgId);
|
spdlog::error("Published message hacked: {}", msgId);
|
||||||
}
|
}
|
||||||
else if (eventType == ix::CobraConnection_EventType_Pong)
|
|
||||||
{
|
|
||||||
spdlog::info("Received websocket pong");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
Reference in New Issue
Block a user