mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 20:22:45 +01:00
irclib: Make NestedCommandsIrcProxy._replyOverhead count in bytes instead of chars
It was, once again, a bug to count characters, because they might contain multi-byte characters, and truncation happens after the 512th byte.
This commit is contained in:
parent
8a3efe4379
commit
de29218bdb
@ -956,9 +956,9 @@ class NestedCommandsIrcProxy(ReplyIrcProxy):
|
|||||||
Ignores tag bytes, as they are accounted for separatly."""
|
Ignores tag bytes, as they are accounted for separatly."""
|
||||||
overhead = (
|
overhead = (
|
||||||
len(':')
|
len(':')
|
||||||
+ len(self.irc.prefix)
|
+ len(self.irc.prefix.encode())
|
||||||
+ len(' PRIVMSG ')
|
+ len(' PRIVMSG ')
|
||||||
+ len(target)
|
+ len(target.encode())
|
||||||
+ len(' :')
|
+ len(' :')
|
||||||
+ len('\r\n')
|
+ len('\r\n')
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user