Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
torbutton
Commits
1581678d
Commit
1581678d
authored
Nov 15, 2012
by
Mike Perry
Browse files
Bug 6156: Rate limit version check queries
Patch from Pearl Crescent.
parent
9a096a9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/chrome/content/torbutton.js
View file @
1581678d
...
...
@@ -967,6 +967,23 @@ function torbutton_do_async_versioncheck() {
if
(
!
m_tb_tbb
||
!
m_tb_prefs
.
getBoolPref
(
"
extensions.torbutton.versioncheck_enabled
"
))
{
return
;
}
// Suppress update check if done recently.
const
kLastCheckPref
=
"
extension.torbutton.lastUpdateCheck
"
;
const
kMinSecsBetweenChecks
=
15
*
60
;
// 15 minutes
var
now
=
Date
.
now
()
/
1000
;
var
lastCheckTime
;
try
{
lastCheckTime
=
parseFloat
(
m_tb_prefs
.
getCharPref
(
kLastCheckPref
));
if
(
isNaN
(
lastCheckTime
))
lastCheckTime
=
undefined
;
}
catch
(
e
)
{}
if
(
lastCheckTime
&&
((
now
-
lastCheckTime
)
<
kMinSecsBetweenChecks
))
return
;
m_tb_prefs
.
setCharPref
(
kLastCheckPref
,
now
);
torbutton_log
(
3
,
"
Checking version with socks port:
"
+
m_tb_prefs
.
getIntPref
(
"
extensions.torbutton.socks_port
"
));
try
{
...
...
Write
Preview
Supports
Markdown
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