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

backported to p9 as 2.8.1-alt0.M90P.1 (with rpmbph script)

parents 448e9baa 695b129b
...@@ -546,7 +546,7 @@ rm -f %buildroot%_docdir/%oname/html/*.md5 ...@@ -546,7 +546,7 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
# history of current unpublished changes # history of current unpublished changes
%changelog %changelog
* Sat Dec 05 2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt0.M90P.1 * Sun Dec 06 2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt0.M90P.1
- backport to ALTLinux p9 (by rpmbph script) - backport to ALTLinux p9 (by rpmbph script)
* Sat Dec 05 2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt1 * Sat Dec 05 2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt1
......
...@@ -29,7 +29,6 @@ using namespace uniset; ...@@ -29,7 +29,6 @@ using namespace uniset;
using namespace uniset::extensions; using namespace uniset::extensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
CommonEventLoop UNetReceiver::loop; CommonEventLoop UNetReceiver::loop;
static UniSetUDP::UDPMessage emptyMessage;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UNetReceiver::UNetReceiver(const std::string& s_host, int _port UNetReceiver::UNetReceiver(const std::string& s_host, int _port
, const std::shared_ptr<SMInterface>& smi , const std::shared_ptr<SMInterface>& smi
...@@ -157,7 +156,6 @@ void UNetReceiver::setLostPacketsID( uniset::ObjectId id ) noexcept ...@@ -157,7 +156,6 @@ void UNetReceiver::setLostPacketsID( uniset::ObjectId id ) noexcept
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetReceiver::setLockUpdate( bool st ) noexcept void UNetReceiver::setLockUpdate( bool st ) noexcept
{ {
lockUpdate = st; lockUpdate = st;
if( !st ) if( !st )
...@@ -208,9 +206,7 @@ bool UNetReceiver::createConnection( bool throwEx ) ...@@ -208,9 +206,7 @@ bool UNetReceiver::createConnection( bool throwEx )
ptRecvTimeout.setTiming(recvTimeout); ptRecvTimeout.setTiming(recvTimeout);
ptPrepare.setTiming(prepareTime); ptPrepare.setTiming(prepareTime);
evprepare(loop.evloop());
if( activated )
evprepare(loop.evloop());
} }
catch( const std::exception& e ) catch( const std::exception& e )
{ {
...@@ -306,8 +302,9 @@ void UNetReceiver::evfinish( const ev::loop_ref& eloop ) noexcept ...@@ -306,8 +302,9 @@ void UNetReceiver::evfinish( const ev::loop_ref& eloop ) noexcept
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetReceiver::forceUpdate() noexcept void UNetReceiver::forceUpdate() noexcept
{ {
rnum = 0; // сбрасываем запомненый номер последнего обработанного пакета // сбрасываем запомненый номер последнего обработанного пакета
// и тем самым заставляем обновить данные в SM (см. update) // и тем самым заставляем обработать заново последний пакет и обновить данные в SM (см. update)
rnum = wnum - 1;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetReceiver::statisticsEvent(ev::periodic& tm, int revents) noexcept void UNetReceiver::statisticsEvent(ev::periodic& tm, int revents) noexcept
...@@ -385,7 +382,11 @@ void UNetReceiver::update() noexcept ...@@ -385,7 +382,11 @@ void UNetReceiver::update() noexcept
if( !ptLostTimeout.checkTime() ) if( !ptLostTimeout.checkTime() )
return; return;
size_t sub = (p->num - rnum); size_t sub = 1;
if( p->num > rnum )
sub = (p->num - rnum);
unetwarn << myname << "(update): lostTimeout(" << ptLostTimeout.getInterval() << ")! pnum=" << p->num << " lost " << sub << " packets " << endl; unetwarn << myname << "(update): lostTimeout(" << ptLostTimeout.getInterval() << ")! pnum=" << p->num << " lost " << sub << " packets " << endl;
lostPackets += sub; lostPackets += sub;
...@@ -657,7 +658,7 @@ bool UNetReceiver::receive() noexcept ...@@ -657,7 +658,7 @@ bool UNetReceiver::receive() noexcept
if( pack->magic != UniSetUDP::UNETUDP_MAGICNUM ) if( pack->magic != UniSetUDP::UNETUDP_MAGICNUM )
return false; return false;
if( abs(long(pack->num - wnum)) > maxDifferens || abs( long(wnum - rnum) ) >= (cbufSize - 2) ) if( size_t(abs(long(pack->num - wnum))) > maxDifferens || size_t(abs( long(wnum - rnum) )) >= (cbufSize - 2) )
{ {
unetcrit << myname << "(receive): DISAGREE " unetcrit << myname << "(receive): DISAGREE "
<< " packnum=" << pack->num << " packnum=" << pack->num
...@@ -750,7 +751,7 @@ UNetReceiver::CacheVec* UNetReceiver::getDCache( UniSetUDP::UDPMessage* pack ) n ...@@ -750,7 +751,7 @@ UNetReceiver::CacheVec* UNetReceiver::getDCache( UniSetUDP::UDPMessage* pack ) n
if( pack->dcount == d_info->size() ) if( pack->dcount == d_info->size() )
return d_info; return d_info;
unetinfo << myname << ": init dcache for " << pack->getDataID() << endl; unetinfo << myname << ": init dcache[" << pack->dcount << "] for " << pack->getDataID() << endl;
d_info->resize(pack->dcount); d_info->resize(pack->dcount);
...@@ -783,7 +784,7 @@ UNetReceiver::CacheVec* UNetReceiver::getACache( UniSetUDP::UDPMessage* pack ) n ...@@ -783,7 +784,7 @@ UNetReceiver::CacheVec* UNetReceiver::getACache( UniSetUDP::UDPMessage* pack ) n
if( pack->acount == a_info->size() ) if( pack->acount == a_info->size() )
return a_info; return a_info;
unetinfo << myname << ": init acache for " << pack->getDataID() << endl; unetinfo << myname << ": init acache[" << pack->acount << "] for " << pack->getDataID() << endl;
a_info->resize(pack->acount); a_info->resize(pack->acount);
......
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