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
4b503e52
Commit
4b503e52
authored
Dec 06, 2020
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
backported to p9 as 2.8.1-alt0.M90P.1 (with rpmbph script)
parents
448e9baa
695b129b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
libuniset2.spec
conf/libuniset2.spec
+1
-1
UNetReceiver.cc
extensions/UNetUDP/UNetReceiver.cc
+11
-10
No files found.
conf/libuniset2.spec
View file @
4b503e52
...
...
@@ -546,7 +546,7 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
# history of current unpublished changes
%changelog
* S
at Dec 05
2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt0.M90P.1
* S
un Dec 06
2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt0.M90P.1
- backport to ALTLinux p9 (by rpmbph script)
* Sat Dec 05 2020 Pavel Vainerman <pv@altlinux.ru> 2.8.1-alt1
...
...
extensions/UNetUDP/UNetReceiver.cc
View file @
4b503e52
...
...
@@ -29,7 +29,6 @@ using namespace uniset;
using
namespace
uniset
::
extensions
;
// -----------------------------------------------------------------------------
CommonEventLoop
UNetReceiver
::
loop
;
static
UniSetUDP
::
UDPMessage
emptyMessage
;
// -----------------------------------------------------------------------------
UNetReceiver
::
UNetReceiver
(
const
std
::
string
&
s_host
,
int
_port
,
const
std
::
shared_ptr
<
SMInterface
>&
smi
...
...
@@ -157,7 +156,6 @@ void UNetReceiver::setLostPacketsID( uniset::ObjectId id ) noexcept
// -----------------------------------------------------------------------------
void
UNetReceiver
::
setLockUpdate
(
bool
st
)
noexcept
{
lockUpdate
=
st
;
if
(
!
st
)
...
...
@@ -208,8 +206,6 @@ bool UNetReceiver::createConnection( bool throwEx )
ptRecvTimeout
.
setTiming
(
recvTimeout
);
ptPrepare
.
setTiming
(
prepareTime
);
if
(
activated
)
evprepare
(
loop
.
evloop
());
}
catch
(
const
std
::
exception
&
e
)
...
...
@@ -306,8 +302,9 @@ void UNetReceiver::evfinish( const ev::loop_ref& eloop ) noexcept
// -----------------------------------------------------------------------------
void
UNetReceiver
::
forceUpdate
()
noexcept
{
rnum
=
0
;
// сбрасываем запомненый номер последнего обработанного пакета
// и тем самым заставляем обновить данные в SM (см. update)
// сбрасываем запомненый номер последнего обработанного пакета
// и тем самым заставляем обработать заново последний пакет и обновить данные в SM (см. update)
rnum
=
wnum
-
1
;
}
// -----------------------------------------------------------------------------
void
UNetReceiver
::
statisticsEvent
(
ev
::
periodic
&
tm
,
int
revents
)
noexcept
...
...
@@ -385,7 +382,11 @@ void UNetReceiver::update() noexcept
if
(
!
ptLostTimeout
.
checkTime
()
)
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
;
lostPackets
+=
sub
;
...
...
@@ -657,7 +658,7 @@ bool UNetReceiver::receive() noexcept
if
(
pack
->
magic
!=
UniSetUDP
::
UNETUDP_MAGICNUM
)
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 "
<<
" packnum="
<<
pack
->
num
...
...
@@ -750,7 +751,7 @@ UNetReceiver::CacheVec* UNetReceiver::getDCache( UniSetUDP::UDPMessage* pack ) n
if
(
pack
->
dcount
==
d_info
->
size
()
)
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
);
...
...
@@ -783,7 +784,7 @@ UNetReceiver::CacheVec* UNetReceiver::getACache( UniSetUDP::UDPMessage* pack ) n
if
(
pack
->
acount
==
a_info
->
size
()
)
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
);
...
...
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