Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
75905d9e
Commit
75905d9e
authored
Mar 31, 2021
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
backported to p9 as 2.9.4-alt0.M90P.0.5 (with rpmbph script)
parents
9ab54c02
e5cea4ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
18 deletions
+17
-18
libuniset2.spec
conf/libuniset2.spec
+5
-2
UWebSocketGate.cc
extensions/UWebSocketGate/UWebSocketGate.cc
+12
-11
uniset2.files
uniset2.files
+0
-5
No files found.
conf/libuniset2.spec
View file @
75905d9e
...
...
@@ -27,7 +27,7 @@
Name: libuniset2
Version: 2.9.4
Release: alt0.M90P.0.
4
Release: alt0.M90P.0.
5
Summary: UniSet - library for building distributed industrial control systems
License: LGPL-2.1
...
...
@@ -576,9 +576,12 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
# history of current unpublished changes
%changelog
*
Sun Mar 28 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.M90P.0.4
*
Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.M90P.0.5
- backport to ALTLinux p9 (by rpmbph script)
* Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.5
- test build for websocketgate
* Sun Mar 28 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.4
- [uwebsocket]: sm2 mode
...
...
extensions/UWebSocketGate/UWebSocketGate.cc
View file @
75905d9e
...
...
@@ -497,7 +497,7 @@ Poco::JSON::Object::Ptr UWebSocketGate::respError( Poco::Net::HTTPServerResponse
return
jdata
;
}
// -----------------------------------------------------------------------------
void
UWebSocketGate
::
onWebSocketSession
(
Poco
::
Net
::
HTTPServerRequest
&
req
,
Poco
::
Net
::
HTTPServerResponse
&
resp
)
void
UWebSocketGate
::
onWebSocketSession
(
Poco
::
Net
::
HTTPServerRequest
&
req
,
Poco
::
Net
::
HTTPServerResponse
&
resp
)
{
using
Poco
::
Net
::
WebSocket
;
using
Poco
::
Net
::
WebSocketException
;
...
...
@@ -597,7 +597,6 @@ std::shared_ptr<UWebSocketGate::UWebSocket> UWebSocketGate::newWebSocket( Poco::
auto
idlist
=
uniset
::
explode
(
slist
);
{
uniset_rwmutex_wrlock
lock
(
wsocksMutex
);
ws
=
make_shared
<
UWebSocket
>
(
req
,
resp
);
ws
->
setHearbeatTime
(
wsHeartbeatTime_sec
);
ws
->
setSendPeriod
(
wsSendTime_sec
);
...
...
@@ -611,6 +610,7 @@ std::shared_ptr<UWebSocketGate::UWebSocket> UWebSocketGate::newWebSocket( Poco::
ws
->
ask
(
i
);
}
uniset_rwmutex_wrlock
lock
(
wsocksMutex
);
wsocks
.
emplace_back
(
ws
);
}
...
...
@@ -620,7 +620,7 @@ std::shared_ptr<UWebSocketGate::UWebSocket> UWebSocketGate::newWebSocket( Poco::
return
ws
;
}
// -----------------------------------------------------------------------------
void
UWebSocketGate
::
delWebSocket
(
std
::
shared_ptr
<
UWebSocket
>&
ws
)
void
UWebSocketGate
::
delWebSocket
(
std
::
shared_ptr
<
UWebSocket
>&
ws
)
{
uniset_rwmutex_wrlock
lock
(
wsocksMutex
);
...
...
@@ -635,10 +635,9 @@ void UWebSocketGate::delWebSocket(std::shared_ptr<UWebSocket>& ws )
}
}
// -----------------------------------------------------------------------------
const
std
::
string
UWebSocketGate
::
UWebSocket
::
ping_str
=
"{
\"
data
\"
: [{
\"
type
\"
:
\"
Ping
\"
}]}"
;
UWebSocketGate
::
UWebSocket
::
UWebSocket
(
Poco
::
Net
::
HTTPServerRequest
*
_req
,
Poco
::
Net
::
HTTPServerResponse
*
_resp
)
:
UWebSocketGate
::
UWebSocket
::
UWebSocket
(
Poco
::
Net
::
HTTPServerRequest
*
_req
,
Poco
::
Net
::
HTTPServerResponse
*
_resp
)
:
Poco
::
Net
::
WebSocket
(
*
_req
,
*
_resp
),
req
(
_req
),
resp
(
_resp
)
...
...
@@ -694,7 +693,7 @@ bool UWebSocketGate::UWebSocket::isActive()
return
iosend
.
is_active
();
}
// -----------------------------------------------------------------------------
void
UWebSocketGate
::
UWebSocket
::
set
(
ev
::
dynamic_loop
&
loop
,
std
::
shared_ptr
<
ev
::
async
>
a
)
void
UWebSocketGate
::
UWebSocket
::
set
(
ev
::
dynamic_loop
&
loop
,
std
::
shared_ptr
<
ev
::
async
>
a
)
{
iosend
.
set
(
loop
);
ioping
.
set
(
loop
);
...
...
@@ -749,6 +748,8 @@ void UWebSocketGate::UWebSocket::send( ev::timer& t, int revents )
}
}
// -----------------------------------------------------------------------------
const
std
::
string
UWebSocketGate
::
UWebSocket
::
ping_str
=
"."
;
// "{\"data\": [{\"type\": \"Ping\"}]}";
void
UWebSocketGate
::
UWebSocket
::
ping
(
ev
::
timer
&
t
,
int
revents
)
{
if
(
EV_ERROR
&
revents
)
...
...
@@ -799,11 +800,11 @@ void UWebSocketGate::UWebSocket::read( ev::io& io, int revents )
if
(
(
flags
&
WebSocket
::
FRAME_OP_BITMASK
)
==
WebSocket
::
FRAME_OP_PING
)
{
sendFrame
(
rbuf
,
n
,
WebSocket
::
FRAME_OP_PONG
);
sendFrame
(
rbuf
,
n
,
WebSocket
::
FRAME_
FLAG_FIN
|
WebSocket
::
FRAME_
OP_PONG
);
return
;
}
if
(
(
flags
&
WebSocket
::
FRAME_OP_BITMASK
)
==
WebSocket
::
FRAME_OP_PONG
)
if
(
(
flags
&
WebSocket
::
FRAME_OP_BITMASK
)
&
WebSocket
::
FRAME_OP_PONG
)
return
;
...
...
@@ -926,7 +927,7 @@ void UWebSocketGate::UWebSocket::sensorInfo( const uniset::SensorMessage* sm )
ioping
.
stop
();
}
// -----------------------------------------------------------------------------
void
UWebSocketGate
::
UWebSocket
::
doCommand
(
const
std
::
shared_ptr
<
SMInterface
>&
ui
)
void
UWebSocketGate
::
UWebSocket
::
doCommand
(
const
std
::
shared_ptr
<
SMInterface
>&
ui
)
{
if
(
qcmd
.
empty
()
)
return
;
...
...
@@ -1171,7 +1172,7 @@ void UWebSocketGate::UWebSocket::write()
}
catch
(
WebSocketException
&
exc
)
{
cerr
<<
"(sendFrame): ERROR: "
<<
exc
.
displayText
()
<<
endl
;
mylog3
<<
"(sendFrame): ERROR: "
<<
exc
.
displayText
()
<<
endl
;
switch
(
exc
.
code
()
)
{
...
...
uniset2.files
View file @
75905d9e
...
...
@@ -297,11 +297,6 @@
./extensions/UniNetwork/uninet.cc
./extensions/UWebSocketGate/main.cc
./extensions/UWebSocketGate/Makefile.am
./extensions/UWebSocketGate.old/main.cc
./extensions/UWebSocketGate.old/Makefile.am
./extensions/UWebSocketGate.old/UWebSocketGate.cc
./extensions/UWebSocketGate.old/UWebSocketGate.h
./extensions/UWebSocketGate.old/UWebSocketGateSugar.h
./extensions/UWebSocketGate/tests/Makefile.am
./extensions/UWebSocketGate/tests/tests_with_sm.cc
./extensions/UWebSocketGate/tests/test_uwebsocketgate.cc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment