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
a912367c
Commit
a912367c
authored
May 11, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Правки по результатам скинирования coverity_scan
parent
f6103f6a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
35 deletions
+38
-35
libuniset2.spec
conf/libuniset2.spec
+4
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+10
-9
MBSlave.h
extensions/ModbusSlave/MBSlave.h
+6
-6
TestProc.cc
extensions/tests/SMemoryTest/TestProc.cc
+1
-2
TestProc.h
extensions/tests/SMemoryTest/TestProc.h
+2
-2
LogServer.h
include/LogServer.h
+5
-5
ModbusServer.h
include/modbus/ModbusServer.h
+8
-8
ModbusTCPServer.h
include/modbus/ModbusTCPServer.h
+1
-1
UniSetTypes.cc
src/ObjectRepository/UniSetTypes.cc
+1
-1
No files found.
conf/libuniset2.spec
View file @
a912367c
...
...
@@ -14,7 +14,7 @@
Name: libuniset2
Version: 2.3
Release: alt
4
Release: alt
5
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
...
...
@@ -483,6 +483,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# ..
%changelog
* Wed May 11 2016 Pavel Vainerman <pv@altlinux.ru> 2.3-alt5
- fixes after coverity_scan
* Thu Apr 28 2016 Pavel Vainerman <pv@altlinux.ru> 2.3-alt4
- build new version
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
a912367c
...
...
@@ -211,23 +211,24 @@ MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const
tcpserver
->
setLog
(
l
);
conf
->
initLogStream
(
l
,
prefix
+
"-exchangelog"
);
updateStatTime
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-update-stat-time"
,
it
.
getProp
(
"updateStatTime"
));
int
tmpval
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-update-stat-time"
,
it
.
getProp
(
"updateStatTime"
));
if
(
updateStatTime
==
0
)
updateStatTime
=
4000
;
if
(
tmpval
>
0
)
updateStatTime
=
tmpval
;
vmonit
(
updateStatTime
);
sessTimeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-timeout"
,
it
.
getProp
(
"sessTimeout"
));
if
(
sessTimeout
==
0
)
sessTimeout
=
2000
;
tmpval
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-timeout"
,
it
.
getProp
(
"sessTimeout"
));
if
(
tmpval
>
0
)
sessTimeout
=
tmpval
;
vmonit
(
sessTimeout
);
sessMaxNum
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-maxnum"
,
it
.
getProp
(
"sessMaxNum"
));
tmpval
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-session-maxnum"
,
it
.
getProp
(
"sessMaxNum"
));
if
(
sessMaxNum
==
0
)
sessMaxNum
=
5
;
if
(
tmpval
>
0
)
sessMaxNum
=
tmpval
;
vmonit
(
sessMaxNum
);
...
...
extensions/ModbusSlave/MBSlave.h
View file @
a912367c
...
...
@@ -578,11 +578,11 @@ class MBSlave:
// TCPServer section..
void
initTCPClients
(
UniXML
::
iterator
confnode
);
timeout_t
sessTimeout
;
/*!< таймаут на сессию */
timeout_t
updateStatTime
;
timeout_t
sessTimeout
=
{
2000
}
;
/*!< таймаут на сессию */
timeout_t
updateStatTime
=
{
4000
}
;
ModbusTCPServer
::
Sessions
sess
;
/*!< список открытых сессий */
UniSetTypes
::
uniset_mutex
sessMutex
;
unsigned
int
sessMaxNum
;
unsigned
int
sessMaxNum
=
{
5
}
;
std
::
shared_ptr
<
ModbusTCPServerSlot
>
tcpserver
;
struct
ClientInfo
...
...
@@ -593,7 +593,7 @@ class MBSlave:
ptTimeout
.
setTiming
(
0
);
}
std
::
string
iaddr
;
std
::
string
iaddr
=
{
""
}
;
UniSetTypes
::
ObjectId
respond_s
=
{
UniSetTypes
::
DefaultObjectId
};
IOController
::
IOStateList
::
iterator
respond_it
;
...
...
@@ -601,7 +601,7 @@ class MBSlave:
PassiveTimer
ptTimeout
;
timeout_t
tout
=
{
2000
};
long
askCount
;
long
askCount
=
{
0
}
;
UniSetTypes
::
ObjectId
askcount_s
=
{
UniSetTypes
::
DefaultObjectId
};
IOController
::
IOStateList
::
iterator
askcount_it
;
...
...
@@ -617,7 +617,7 @@ class MBSlave:
typedef
std
::
unordered_map
<
std
::
string
,
ClientInfo
>
ClientsMap
;
ClientsMap
cmap
;
UniSetTypes
::
ObjectId
sesscount_id
;
UniSetTypes
::
ObjectId
sesscount_id
=
{
UniSetTypes
::
DefaultObjectId
}
;
IOController
::
IOStateList
::
iterator
sesscount_it
;
std
::
atomic_bool
tcpCancelled
=
{
true
};
...
...
extensions/tests/SMemoryTest/TestProc.cc
View file @
a912367c
...
...
@@ -6,8 +6,7 @@ using namespace std;
using
namespace
UniSetTypes
;
// -----------------------------------------------------------------------------
TestProc
::
TestProc
(
UniSetTypes
::
ObjectId
id
,
xmlNode
*
confnode
)
:
TestProc_SK
(
id
,
confnode
),
state
(
false
)
TestProc_SK
(
id
,
confnode
)
{
loglevels
.
push_back
(
Debug
::
INFO
);
loglevels
.
push_back
(
Debug
::
WARN
);
...
...
extensions/tests/SMemoryTest/TestProc.h
View file @
a912367c
...
...
@@ -35,8 +35,8 @@ class TestProc:
void
test_loglevel
();
private
:
bool
state
;
bool
undef
;
bool
state
=
{
false
}
;
bool
undef
=
{
false
}
;
std
::
vector
<
Debug
::
type
>
loglevels
;
std
::
vector
<
Debug
::
type
>::
iterator
lit
;
...
...
include/LogServer.h
View file @
a912367c
...
...
@@ -142,9 +142,9 @@ class LogServer:
size_t
scount
=
{
0
};
UniSetTypes
::
uniset_rwmutex
mutSList
;
timeout_t
timeout
;
timeout_t
cmdTimeout
;
Debug
::
type
sessLogLevel
;
timeout_t
timeout
=
{
TIMEOUT_INF
}
;
timeout_t
cmdTimeout
=
{
2000
}
;
Debug
::
type
sessLogLevel
=
{
Debug
::
NONE
}
;
size_t
sessMaxCount
=
{
10
};
DebugStream
mylog
;
...
...
@@ -163,8 +163,8 @@ class LogServer:
std
::
unordered_map
<
DebugStream
*
,
Debug
::
type
>
defaultLogLevels
;
std
::
string
myname
=
{
"LogServer"
};
std
::
string
addr
;
ost
::
tpport_t
port
;
std
::
string
addr
=
{
""
}
;
ost
::
tpport_t
port
=
{
0
}
;
std
::
atomic_bool
isrunning
=
{
false
};
};
...
...
include/modbus/ModbusServer.h
View file @
a912367c
...
...
@@ -315,13 +315,13 @@ class ModbusServer
ModbusRTU
::
mbErrCode
recv_pdu
(
ModbusRTU
::
ModbusMessage
&
rbuf
,
timeout_t
timeout
);
UniSetTypes
::
uniset_mutex
recvMutex
;
timeout_t
recvTimeOut_ms
;
/*!< таймаут на приём */
timeout_t
replyTimeout_ms
;
/*!< таймаут на формирование ответа */
timeout_t
aftersend_msec
;
/*!< пауза после посылки ответа */
timeout_t
sleepPause_msec
;
/*!< пауза между попытками чтения символа из канала */
bool
onBroadcast
;
/*!< включен режим работы с broadcst-сообщениями */
bool
crcNoCheckit
;
bool
cleanBeforeSend
;
timeout_t
recvTimeOut_ms
=
{
50
}
;
/*!< таймаут на приём */
timeout_t
replyTimeout_ms
=
{
2000
}
;
/*!< таймаут на формирование ответа */
timeout_t
aftersend_msec
=
{
0
}
;
/*!< пауза после посылки ответа */
timeout_t
sleepPause_msec
=
{
10
}
;
/*!< пауза между попытками чтения символа из канала */
bool
onBroadcast
=
{
false
}
;
/*!< включен режим работы с broadcst-сообщениями */
bool
crcNoCheckit
=
{
false
}
;
bool
cleanBeforeSend
=
{
false
}
;
void
printProcessingTime
();
PassiveTimer
tmProcessing
;
...
...
@@ -329,7 +329,7 @@ class ModbusServer
std
::
shared_ptr
<
DebugStream
>
dlog
;
// статистика сервера
size_t
askCount
;
size_t
askCount
=
{
0
}
;
ExchangeErrorMap
errmap
;
/*!< статистика ошибок обмена */
PreReceiveSignal
m_pre_signal
;
...
...
include/modbus/ModbusTCPServer.h
View file @
a912367c
...
...
@@ -154,7 +154,7 @@ class ModbusTCPServer:
ev
::
timer
ioTimer
;
std
::
shared_ptr
<
UTCPSocket
>
sock
;
const
std
::
unordered_set
<
ModbusRTU
::
ModbusAddr
>*
vmbaddr
;
const
std
::
unordered_set
<
ModbusRTU
::
ModbusAddr
>*
vmbaddr
=
{
nullptr
}
;
TimerSignal
m_timer_signal
;
timeout_t
tmTime_msec
=
{
TIMEOUT_INF
};
// время по умолчанию для таймера (TimerSignal)
...
...
src/ObjectRepository/UniSetTypes.cc
View file @
a912367c
...
...
@@ -576,7 +576,7 @@ std::string UniSetTypes::replace_all( const std::string& src, const std::string&
if
(
from
.
empty
()
)
return
std
::
move
(
res
);
size_t
pos
=
res
.
find
(
from
,
pos
);
size_t
pos
=
res
.
find
(
from
,
0
);
while
(
pos
!=
std
::
string
::
npos
)
{
...
...
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