Commit 4e6b2dbe authored by Pavel Vainerman's avatar Pavel Vainerman

backported to p9 as 2.9.4-alt0.M90P.0.6 (with rpmbph script)

parents 75905d9e 770e1a62
......@@ -27,7 +27,7 @@
Name: libuniset2
Version: 2.9.4
Release: alt0.M90P.0.5
Release: alt0.M90P.0.6
Summary: UniSet - library for building distributed industrial control systems
License: LGPL-2.1
......@@ -203,6 +203,13 @@ Summary: Websocket gate for uniset
%description extension-wsgate
Websocket gate for uniset
%package extension-wsgate-devel
Group: Development/Tools
Summary: Websocket gate develop libraries
%description extension-wsgate-devel
Websocket gate develop libraries
%endif
%if_enabled mysql
......@@ -551,6 +558,11 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
%if_enabled api
%files extension-wsgate
%_bindir/%oname-wsgate*
%files extension-wsgate-devel
%_pkgconfigdir/libUniSet2UWebSocketGate*.pc
%_libdir/libUniSet2UWebSocketGate*.so
%_includedir/%oname/extensions/wsgate/
%endif
%files extension-common-devel
......@@ -576,9 +588,12 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
# history of current unpublished changes
%changelog
* Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.M90P.0.5
* Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.M90P.0.6
- backport to ALTLinux p9 (by rpmbph script)
* Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.6
- test build for websocketgate (wsgate-devel package)
* Wed Mar 31 2021 Pavel Vainerman <pv@altlinux.ru> 2.9.4-alt0.5
- test build for websocketgate
......
......@@ -595,6 +595,7 @@ AC_CONFIG_FILES([Makefile
extensions/HttpResolver/tests/Makefile
extensions/UWebSocketGate/Makefile
extensions/UWebSocketGate/tests/Makefile
extensions/UWebSocketGate/libUniSet2UWebSocketGate.pc
testsuite/Makefile
wrappers/Makefile
wrappers/python/lib/Makefile
......
if ENABLE_REST_API
bin_PROGRAMS = @PACKAGE@-wsgate
WSGATE_VER=@LIBVER@
lib_LTLIBRARIES = libUniSet2UWebSocketGate.la
libUniSet2UWebSocketGate_la_SOURCES = UWebSocketGate.cc
libUniSet2UWebSocketGate_la_LDFLAGS = -version-info $(WSGATE_VER)
libUniSet2UWebSocketGate_la_LIBADD = $(top_builddir)/lib/libUniSet2.la \
$(top_builddir)/extensions/SharedMemory/libUniSet2SharedMemory.la \
$(top_builddir)/extensions/lib/libUniSet2Extensions.la \
$(SIGC_LIBS) $(POCO_LIBS)
libUniSet2UWebSocketGate_la_CXXFLAGS = -I$(top_builddir)/extensions/include \
-I$(top_builddir)/extensions/SharedMemory $(SIGC_CFLAGS) $(POCO_CFLAGS)
@PACKAGE@_wsgate_SOURCES = main.cc
@PACKAGE@_wsgate_CXXFLAGS = -I$(top_builddir)/extensions/include -I$(top_builddir)/extensions/SharedMemory $(SIGC_CFLAGS) $(POCO_CFLAGS)
@PACKAGE@_wsgate_LDADD = $(top_builddir)/lib/libUniSet2.la \
@PACKAGE@_wsgate_LDADD = libUniSet2UWebSocketGate.la $(top_builddir)/lib/libUniSet2.la \
$(top_builddir)/extensions/SharedMemory/libUniSet2SharedMemory.la \
$(top_builddir)/extensions/lib/libUniSet2Extensions.la \
$(SIGC_LIBS) $(POCO_LIBS)
@PACKAGE@_wsgate_SOURCES = UWebSocketGate.cc main.cc
# install
devel_include_HEADERS = *.h
devel_includedir = $(pkgincludedir)/extensions/wsgate
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libUniSet2UWebSocketGate.pc
include $(top_builddir)/include.mk
endif
......@@ -805,7 +805,10 @@ void UWebSocketGate::UWebSocket::read( ev::io& io, int revents )
}
if( (flags & WebSocket::FRAME_OP_BITMASK) & WebSocket::FRAME_OP_PONG )
{
mylog4 << req->clientAddress().toString() << "(read): pong.." << endl;
return;
}
if( (flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE )
......@@ -932,7 +935,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
if( qcmd.empty() )
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();
qcmd.pop();
......@@ -950,7 +953,7 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
if( s.cmd == "ask" )
{
ui->askSensor(s.id, UniversalIO::UIONotify);
smap[s.id] = s;
smap[s.id] = s;
}
else if( s.cmd == "del" )
{
......@@ -958,17 +961,17 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
auto it = smap.find(s.id);
if( it != smap.end() )
smap.erase(it);
smap.erase(it);
}
else if( s.cmd == "set" )
{
ui->setValue(s.id, s.value);
}
ui->setValue(s.id, s.value);
}
else if( s.cmd == "get" )
{
s.value = ui->getValue(s.id);
s.err = "";
sendShortResponse(s);
sendShortResponse(s);
}
s.err = "";
......@@ -978,11 +981,11 @@ void UWebSocketGate::UWebSocket::doCommand( const std::shared_ptr<SMInterface>&
{
mycrit << "(UWebSocket::doCommand): " << ex.what() << endl;
s.err = ex.what();
sendResponse(s);
sendResponse(s);
}
}
if( !qcmd.empty() && cmdsignal )
if( !qcmd.empty() && cmdsignal )
cmdsignal->send();
}
// -----------------------------------------------------------------------------
......@@ -1126,7 +1129,10 @@ void UWebSocketGate::UWebSocket::write()
int flags = WebSocket::FRAME_TEXT;
if( msg->len == ping_str.size() )
{
flags = WebSocket::FRAME_FLAG_FIN | WebSocket::FRAME_OP_PING;
mylog4 << req->clientAddress().toString() << "(write): ping.." << endl;
}
try
{
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libUniSet2UWebSocketGate
Description: Support library for UniSet2UWebSocketGate
Requires: libUniSet2Extensions
Version: @VERSION@
Libs: -L${libdir} -lUniSet2UWebSocketGate
Cflags: -I${includedir}/@PACKAGE@/extensions/wsgate
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