Commit 97206d68 authored by Pavel Vainerman's avatar Pavel Vainerman

[uwebsocket]: make style

parent 5e8fd840
...@@ -805,10 +805,10 @@ void UWebSocketGate::UWebSocket::read( ev::io& io, int revents ) ...@@ -805,10 +805,10 @@ void UWebSocketGate::UWebSocket::read( ev::io& io, int revents )
} }
if( (flags & WebSocket::FRAME_OP_BITMASK) & WebSocket::FRAME_OP_PONG ) if( (flags & WebSocket::FRAME_OP_BITMASK) & WebSocket::FRAME_OP_PONG )
{ {
mylog4 << req->clientAddress().toString() << "(read): pong.." << endl; mylog4 << req->clientAddress().toString() << "(read): pong.." << endl;
return; return;
} }
if( (flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE ) if( (flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE )
...@@ -935,7 +935,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>& ...@@ -935,7 +935,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
if( qcmd.empty() ) if( qcmd.empty() )
return; return;
for( size_t i = 0; i < maxcmd && !qcmd.empty(); i++ ) for( size_t i = 0; i < maxcmd && !qcmd.empty(); i++ )
{ {
auto s = qcmd.front(); auto s = qcmd.front();
qcmd.pop(); qcmd.pop();
...@@ -953,7 +953,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>& ...@@ -953,7 +953,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
if( s.cmd == "ask" ) if( s.cmd == "ask" )
{ {
ui->askSensor(s.id, UniversalIO::UIONotify); ui->askSensor(s.id, UniversalIO::UIONotify);
smap[s.id] = s; smap[s.id] = s;
} }
else if( s.cmd == "del" ) else if( s.cmd == "del" )
{ {
...@@ -961,17 +961,17 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>& ...@@ -961,17 +961,17 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
auto it = smap.find(s.id); auto it = smap.find(s.id);
if( it != smap.end() ) if( it != smap.end() )
smap.erase(it); smap.erase(it);
} }
else if( s.cmd == "set" ) else if( s.cmd == "set" )
{ {
ui->setValue(s.id, s.value); ui->setValue(s.id, s.value);
} }
else if( s.cmd == "get" ) else if( s.cmd == "get" )
{ {
s.value = ui->getValue(s.id); s.value = ui->getValue(s.id);
s.err = ""; s.err = "";
sendShortResponse(s); sendShortResponse(s);
} }
s.err = ""; s.err = "";
...@@ -981,11 +981,11 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>& ...@@ -981,11 +981,11 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
{ {
mycrit << "(UWebSocket::doCommand): " << ex.what() << endl; mycrit << "(UWebSocket::doCommand): " << ex.what() << endl;
s.err = ex.what(); s.err = ex.what();
sendResponse(s); sendResponse(s);
} }
} }
if( !qcmd.empty() && cmdsignal ) if( !qcmd.empty() && cmdsignal )
cmdsignal->send(); cmdsignal->send();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -1129,10 +1129,10 @@ void UWebSocketGate::UWebSocket::write() ...@@ -1129,10 +1129,10 @@ void UWebSocketGate::UWebSocket::write()
int flags = WebSocket::FRAME_TEXT; int flags = WebSocket::FRAME_TEXT;
if( msg->len == ping_str.size() ) if( msg->len == ping_str.size() )
{ {
flags = WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PING; flags = WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PING;
mylog4 << req->clientAddress().toString() << "(write): ping.." << endl; mylog4 << req->clientAddress().toString() << "(write): ping.." << endl;
} }
try try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment