compiler warning fixes
This commit is contained in:
parent
dc77d62a5d
commit
e85f975ab0
@ -1,6 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All changes to this project will be documented in this file.
|
All changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [10.0.3] - 2020-07-28
|
||||||
|
|
||||||
|
compiler warning fixes
|
||||||
|
|
||||||
## [10.0.2] - 2020-07-28
|
## [10.0.2] - 2020-07-28
|
||||||
|
|
||||||
(ixcobra) CobraConnection: unsubscribe from all subscriptions when disconnecting
|
(ixcobra) CobraConnection: unsubscribe from all subscriptions when disconnecting
|
||||||
|
@ -19,7 +19,6 @@ namespace snake
|
|||||||
{
|
{
|
||||||
void handleError(const std::string& action,
|
void handleError(const std::string& action,
|
||||||
ix::WebSocket& ws,
|
ix::WebSocket& ws,
|
||||||
const nlohmann::json& pdu,
|
|
||||||
uint64_t pduId,
|
uint64_t pduId,
|
||||||
const std::string& errMsg)
|
const std::string& errMsg)
|
||||||
{
|
{
|
||||||
@ -116,7 +115,7 @@ namespace snake
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Missing channels or channel field in publish data";
|
ss << "Missing channels or channel field in publish data";
|
||||||
handleError("rtm/publish", ws, pdu, pduId, ss.str());
|
handleError("rtm/publish", ws, pduId, ss.str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +135,7 @@ namespace snake
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Cannot publish to redis host " << errMsg;
|
ss << "Cannot publish to redis host " << errMsg;
|
||||||
handleError("rtm/publish", ws, pdu, pduId, ss.str());
|
handleError("rtm/publish", ws, pduId, ss.str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,7 +174,7 @@ namespace snake
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Cannot connect to redis host " << hostname << ":" << port;
|
ss << "Cannot connect to redis host " << hostname << ":" << port;
|
||||||
handleError("rtm/subscribe", ws, pdu, pduId, ss.str());
|
handleError("rtm/subscribe", ws, pduId, ss.str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ namespace snake
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Cannot authenticated to redis";
|
ss << "Cannot authenticated to redis";
|
||||||
handleError("rtm/subscribe", ws, pdu, pduId, ss.str());
|
handleError("rtm/subscribe", ws, pduId, ss.str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -236,7 +235,7 @@ namespace snake
|
|||||||
ix::CoreLogger::log(ss.str().c_str());
|
ix::CoreLogger::log(ss.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto subscription = [&redisClient, state, &ws, &pdu, pduId]
|
auto subscription = [&redisClient, state, &ws, pduId]
|
||||||
{
|
{
|
||||||
if (!redisClient.subscribe(state->appChannel,
|
if (!redisClient.subscribe(state->appChannel,
|
||||||
state->onRedisSubscribeResponseCallback,
|
state->onRedisSubscribeResponseCallback,
|
||||||
@ -244,7 +243,7 @@ namespace snake
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Error subscribing to channel " << state->appChannel;
|
ss << "Error subscribing to channel " << state->appChannel;
|
||||||
handleError("rtm/subscribe", ws, pdu, pduId, ss.str());
|
handleError("rtm/subscribe", ws, pduId, ss.str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -43,7 +43,7 @@ namespace ix
|
|||||||
const std::string& hostname,
|
const std::string& hostname,
|
||||||
const ix::SocketTLSOptions& tlsOptions,
|
const ix::SocketTLSOptions& tlsOptions,
|
||||||
const std::string& remoteUrl,
|
const std::string& remoteUrl,
|
||||||
bool verbose)
|
bool /*verbose*/)
|
||||||
{
|
{
|
||||||
ix::WebSocketServer server(port, hostname);
|
ix::WebSocketServer server(port, hostname);
|
||||||
server.setTLSOptions(tlsOptions);
|
server.setTLSOptions(tlsOptions);
|
||||||
@ -53,8 +53,7 @@ namespace ix
|
|||||||
};
|
};
|
||||||
server.setConnectionStateFactory(factory);
|
server.setConnectionStateFactory(factory);
|
||||||
|
|
||||||
server.setOnConnectionCallback([remoteUrl,
|
server.setOnConnectionCallback([remoteUrl](std::weak_ptr<ix::WebSocket> webSocket,
|
||||||
verbose](std::weak_ptr<ix::WebSocket> webSocket,
|
|
||||||
std::shared_ptr<ConnectionState> connectionState,
|
std::shared_ptr<ConnectionState> connectionState,
|
||||||
std::unique_ptr<ConnectionInfo> connectionInfo) {
|
std::unique_ptr<ConnectionInfo> connectionInfo) {
|
||||||
auto state = std::dynamic_pointer_cast<ProxyConnectionState>(connectionState);
|
auto state = std::dynamic_pointer_cast<ProxyConnectionState>(connectionState);
|
||||||
@ -62,7 +61,7 @@ namespace ix
|
|||||||
|
|
||||||
// Server connection
|
// Server connection
|
||||||
state->webSocket().setOnMessageCallback(
|
state->webSocket().setOnMessageCallback(
|
||||||
[webSocket, state, remoteIp, verbose](const WebSocketMessagePtr& msg) {
|
[webSocket, state, remoteIp](const WebSocketMessagePtr& msg) {
|
||||||
if (msg->type == ix::WebSocketMessageType::Close)
|
if (msg->type == ix::WebSocketMessageType::Close)
|
||||||
{
|
{
|
||||||
state->setTerminated();
|
state->setTerminated();
|
||||||
@ -81,8 +80,7 @@ namespace ix
|
|||||||
auto ws = webSocket.lock();
|
auto ws = webSocket.lock();
|
||||||
if (ws)
|
if (ws)
|
||||||
{
|
{
|
||||||
ws->setOnMessageCallback(
|
ws->setOnMessageCallback([state, remoteUrl](const WebSocketMessagePtr& msg) {
|
||||||
[state, remoteUrl, verbose](const WebSocketMessagePtr& msg) {
|
|
||||||
if (msg->type == ix::WebSocketMessageType::Open)
|
if (msg->type == ix::WebSocketMessageType::Open)
|
||||||
{
|
{
|
||||||
// Connect to the 'real' server
|
// Connect to the 'real' server
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "10.0.2"
|
#define IX_WEBSOCKET_VERSION "10.0.3"
|
||||||
|
@ -85,7 +85,7 @@ namespace ix
|
|||||||
bool startWebSocketEchoServer(ix::WebSocketServer& server)
|
bool startWebSocketEchoServer(ix::WebSocketServer& server)
|
||||||
{
|
{
|
||||||
server.setOnClientMessageCallback(
|
server.setOnClientMessageCallback(
|
||||||
[&server](std::shared_ptr<ConnectionState> connectionState,
|
[&server](std::shared_ptr<ConnectionState> /*connectionState*/,
|
||||||
ConnectionInfo& connectionInfo,
|
ConnectionInfo& connectionInfo,
|
||||||
WebSocket& webSocket,
|
WebSocket& webSocket,
|
||||||
const ix::WebSocketMessagePtr& msg) {
|
const ix::WebSocketMessagePtr& msg) {
|
||||||
|
@ -169,11 +169,10 @@ namespace
|
|||||||
{
|
{
|
||||||
// A dev/null server
|
// A dev/null server
|
||||||
server.setOnClientMessageCallback(
|
server.setOnClientMessageCallback(
|
||||||
[&receivedCloseCode, &receivedCloseReason, &receivedCloseRemote, &mutexWrite
|
[&receivedCloseCode, &receivedCloseReason, &receivedCloseRemote, &mutexWrite](
|
||||||
|
std::shared_ptr<ConnectionState> connectionState,
|
||||||
](std::shared_ptr<ConnectionState> connectionState,
|
|
||||||
ConnectionInfo& connectionInfo,
|
ConnectionInfo& connectionInfo,
|
||||||
WebSocket& webSocket,
|
WebSocket& /*webSocket*/,
|
||||||
const ix::WebSocketMessagePtr& msg) {
|
const ix::WebSocketMessagePtr& msg) {
|
||||||
auto remoteIp = connectionInfo.remoteIp;
|
auto remoteIp = connectionInfo.remoteIp;
|
||||||
if (msg->type == ix::WebSocketMessageType::Open)
|
if (msg->type == ix::WebSocketMessageType::Open)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user