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
56d91733
Commit
56d91733
authored
Oct 08, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(LogSession): исправил логическую ошибку, соединения никогда не закрывались.
parent
e9a19faa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
logserver.cc
Utilities/ULog/logserver.cc
+2
-3
LogSession.h
include/LogSession.h
+2
-0
LogServer.cc
src/Log/LogServer.cc
+3
-2
LogSession.cc
src/Log/LogSession.cc
+10
-3
No files found.
Utilities/ULog/logserver.cc
View file @
56d91733
...
...
@@ -167,7 +167,6 @@ int main( int argc, char** argv )
la->printLogList(cout);
return 0;
#endif
LogServer
ls
(
la
);
ls
.
setMaxSessionCount
(
msess
);
...
...
@@ -214,9 +213,9 @@ int main( int argc, char** argv )
{
cerr
<<
"(logserver): "
<<
ex
<<
endl
;
}
catch
(
...
)
catch
(
std
::
exception
&
ex
)
{
cerr
<<
"(logserver):
catch(...)"
<<
endl
;
cerr
<<
"(logserver):
"
<<
ex
.
what
()
<<
endl
;
}
return
0
;
...
...
include/LogSession.h
View file @
56d91733
...
...
@@ -77,6 +77,8 @@ class LogSession
std
::
string
getShortInfo
()
noexcept
;
std
::
string
name
()
const
noexcept
;
protected
:
// LogSession( ost::TCPSocket& server );
...
...
src/Log/LogServer.cc
View file @
56d91733
...
...
@@ -53,6 +53,7 @@ LogServer::LogServer( std::shared_ptr<DebugStream> log ) noexcept:
sock
(
0
),
elog
(
log
)
{
}
// -------------------------------------------------------------------------
LogServer
::
LogServer
()
noexcept
:
...
...
@@ -213,7 +214,7 @@ void LogServer::ioAccept( ev::io& watcher, int revents )
}
{
uniset_rwmutex_
w
rlock
l
(
mutSList
);
uniset_rwmutex_rlock
l
(
mutSList
);
if
(
slist
.
size
()
>=
sessMaxCount
)
{
...
...
@@ -298,7 +299,7 @@ string LogServer::getShortInfo()
<<
endl
;
{
uniset_rwmutex_
w
rlock
l
(
mutSList
);
uniset_rwmutex_rlock
l
(
mutSList
);
for
(
const
auto
&
s
:
slist
)
inf
<<
" "
<<
s
->
getShortInfo
()
<<
endl
;
...
...
src/Log/LogSession.cc
View file @
56d91733
...
...
@@ -597,10 +597,12 @@ void LogSession::onCheckConnectionTimer( ev::timer& watcher, int revents ) noexc
// если клиент уже отвалился.. то при попытке write.. сессия будет закрыта.
// длинное сообщение ("keep alive message") забивает логи, что потом неудобно смотреть, поэтому пишем "пустоту"
// длинное сообщение ("keep alive message") забивает логи, что потом неудобно смотреть
// поэтому используем "пробел и возврат на один символ"
try
{
logbuf
.
emplace
(
new
UTCPCore
::
Buffer
(
""
));
//
logbuf
.
emplace
(
new
UTCPCore
::
Buffer
(
"
\b
"
));
}
catch
(...){}
...
...
@@ -658,7 +660,7 @@ string LogSession::getShortInfo() noexcept
ostringstream
inf
;
inf
<<
"client: "
<<
caddr
<<
endl
inf
<<
"client: "
<<
caddr
<<
" :"
<<
" buffer["
<<
maxRecordsNum
<<
"]: size="
<<
sz
<<
" maxCount="
<<
maxCount
<<
" minSizeMsg="
<<
minSizeMsg
...
...
@@ -669,3 +671,8 @@ string LogSession::getShortInfo() noexcept
return
std
::
move
(
inf
.
str
());
}
// ---------------------------------------------------------------------
string
LogSession
::
name
()
const
noexcept
{
return
caddr
;
}
// ---------------------------------------------------------------------
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