hmac cache limit + android ux:

onscroll doesnt trigger so files dont load in
This commit is contained in:
ed 2022-10-08 17:46:04 +02:00
parent 0b265bd673
commit 4f811eb9e9
2 changed files with 4 additions and 1 deletions

View file

@ -643,6 +643,9 @@ class HMaccas(object):
try:
return self.cache[msg]
except:
if len(self.cache) > 9000:
self.cache = {}
zb = hmac.new(self.key, msg, hashlib.sha512).digest()
zs = base64.urlsafe_b64encode(zb)[: self.retlen].decode("utf-8")
self.cache[msg] = zs

View file

@ -4658,7 +4658,7 @@ var treectl = (function () {
setwrap(bcfg_bind(r, 'wtree', 'wraptree', true, setwrap));
setwrap(bcfg_bind(r, 'parpane', 'parpane', true, onscroll));
bcfg_bind(r, 'htree', 'hovertree', false, reload_tree);
bcfg_bind(r, 'ask', 'bd_ask', false);
bcfg_bind(r, 'ask', 'bd_ask', MOBILE);
ebi('bd_lim').value = r.lim = icfg_get('bd_lim');
ebi('bd_lim').oninput = function (e) {
var n = parseInt(this.value);