Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain DEP.
biboumi
Commits
0d886d5f
Commit
0d886d5f
authored
Jun 26, 2018
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default the throttle limit to 10 if not built with database support
parent
7f8a612c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/irc/irc_client.cpp
src/irc/irc_client.cpp
+10
-1
src/irc/irc_client.hpp
src/irc/irc_client.hpp
+1
-0
No files found.
src/irc/irc_client.cpp
View file @
0d886d5f
...
...
@@ -144,7 +144,7 @@ IrcClient::IrcClient(std::shared_ptr<Poller>& poller, std::string hostname,
welcomed
(
false
),
chanmodes
({
""
,
""
,
""
,
""
}),
chantypes
({
'#'
,
'&'
}),
tokens_bucket
(
Database
::
get_irc_server_options
(
bridge
.
get_bare_jid
(),
hostname
).
col
<
Database
::
ThrottleLimit
>
(),
1s
,
[
this
]()
{
tokens_bucket
(
this
->
get_throttle_limit
(),
1s
,
[
this
]()
{
if
(
message_queue
.
empty
())
return
true
;
this
->
actual_send
(
std
::
move
(
this
->
message_queue
.
front
()));
...
...
@@ -1283,3 +1283,12 @@ bool IrcClient::abort_on_invalid_cert() const
return
true
;
}
#endif
std
::
size_t
IrcClient
::
get_throttle_limit
()
const
{
#ifdef USE_DATABASE
return
Database
::
get_irc_server_options
(
this
->
bridge
.
get_bare_jid
(),
this
->
hostname
).
col
<
Database
::
ThrottleLimit
>
();
#else
return
10
;
#endif
}
src/irc/irc_client.hpp
View file @
0d886d5f
...
...
@@ -397,6 +397,7 @@ private:
*/
Resolver
dns_resolver
;
TokensBucket
tokens_bucket
;
std
::
size_t
get_throttle_limit
()
const
;
};
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