mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-18 05:42:03 +01:00
major bugfix: fix sock readyState handler
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
d0b040fbb9
commit
7a71bcd779
@ -208,7 +208,7 @@ function direct_bc(msg, id) {
|
||||
for (const sock of socks) {
|
||||
if (cache_relays?.includes(sock.url)) continue;
|
||||
if (sock.id !== id) continue;
|
||||
if (sock.readyState !== 2) continue;
|
||||
if (sock.readyState !== 1) continue;
|
||||
|
||||
// skip the ratelimit after <config.upstream_ratelimit_expiration>
|
||||
if ((upstream_ratelimit_expiration) > (Date.now() - sock.ratelimit)) continue;
|
||||
@ -220,7 +220,7 @@ function cache_bc(msg, id) {
|
||||
for (const sock of socks) {
|
||||
if (!cache_relays?.includes(sock.url)) continue;
|
||||
if (sock.id !== id) continue;
|
||||
if (sock.readyState !== 2) continue;
|
||||
if (sock.readyState !== 1) continue;
|
||||
sock.send(JSON.stringify(msg));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user