Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
37e08cfb
Commit
37e08cfb
authored
Nov 18, 2014
by
woogerboy21
Browse files
added logic to only write debug if max user value is reached
parent
197ae921
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/serversocketinterface.cpp
View file @
37e08cfb
...
...
@@ -117,14 +117,16 @@ bool ServerSocketInterface::initSession()
SessionEvent
*
identSe
=
prepareSessionEvent
(
identEvent
);
sendProtocolItem
(
*
identSe
);
delete
identSe
;
int
maxUsers
=
servatrice
->
getMaxUsersPerAddress
();
//allow unlimited number of connections from the trusted sources
QString
trustedSources
=
settingsCache
->
value
(
"server/trusted_sources"
,
"127.0.0.1,::1"
).
toString
();
if
(
trustedSources
.
contains
(
socket
->
peerAddress
().
toString
(),
Qt
::
CaseInsensitive
))
qDebug
()
<<
"Allowing user from trusted source: "
<<
socket
->
peerAddress
().
toString
();
if
(
servatrice
->
getUsersWithAddress
(
socket
->
peerAddress
())
>=
maxUsers
)
qDebug
()
<<
"Allowing user from trusted source: "
<<
socket
->
peerAddress
().
toString
();
return
true
;
int
maxUsers
=
servatrice
->
getMaxUsersPerAddress
();
if
((
maxUsers
>
0
)
&&
(
servatrice
->
getUsersWithAddress
(
socket
->
peerAddress
())
>=
maxUsers
))
{
Event_ConnectionClosed
event
;
event
.
set_reason
(
Event_ConnectionClosed
::
TOO_MANY_CONNECTIONS
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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