Fix various bugs uncovered by the LIST system

* Work around Twisted's broken handling of spaces
* Work around Twisted's broken line decoding
* Don't run signedOn twice for relays
* Improved detection of whether the endpoint is connected to ZNC
* Delay a LIST until all configured relays are online
* Discard a LIST if there are no callbacks for it
* Get rid of some double-negative ternary blocks
This commit is contained in:
2019-10-31 15:44:59 +00:00
parent b4fa747853
commit 7ffb6125aa
2 changed files with 123 additions and 47 deletions

View File

@@ -12,7 +12,7 @@ def allRelaysActive(net):
for i in main.network[net].relays.keys():
name = net+str(i)
if name in main.IRCPool.keys():
if main.IRCPool[name].connected:
if main.IRCPool[name].isconnected:
existNum += 1
if existNum == relayNum:
return True
@@ -28,7 +28,8 @@ def getChanFree(net, new):
chanfree[i] = main.IRCPool[name].chanlimit-len(main.IRCPool[name].channels)
chanlimits.add(main.IRCPool[name].chanlimit)
if not len(chanlimits) == 1:
error("Network %s has servers with different CHANMAX values" % net)
error("Network %s has servers with different CHANLIMIT values" % net)
print(chanlimits)
return False
return (chanfree, chanlimits.pop())
@@ -72,7 +73,7 @@ def notifyJoin(net):
def minifyChans(net, listinfo):
if not allRelaysActive(net):
error("All relays for %s are not active, cannot minify list")
error("All relays for %s are not active, cannot minify list" % net)
return False
for i in main.network[net].relays.keys():
name = net+str(i)