summaryrefslogtreecommitdiff
path: root/miniircd
diff options
context:
space:
mode:
authorFilipe Pina <fopina@gmail.com>2016-09-16 13:27:39 +0100
committerJoel Rosdahl <joel@rosdahl.net>2016-09-20 22:45:26 +0200
commit505cdd6ba74eb609d80d1ac00332bec9f5495f91 (patch)
tree47f32d529a1866ea6fee1b7bdc8b5cba3b6266cb /miniircd
parentf301f19efdb6f3157e51d09a1cbfe8047059aac8 (diff)
downloadminiircd-505cdd6ba74eb609d80d1ac00332bec9f5495f91.tar.gz
miniircd-505cdd6ba74eb609d80d1ac00332bec9f5495f91.zip
server_name was not being considered for 512 max length
Diffstat (limited to 'miniircd')
-rwxr-xr-xminiircd6
1 files changed, 4 insertions, 2 deletions
diff --git a/miniircd b/miniircd
index 9a7b059..7ae4d37 100755
--- a/miniircd
+++ b/miniircd
@@ -271,9 +271,11 @@ class Client(object):
% (self.nickname, channel.name))
names_prefix = "353 %s = %s :" % (self.nickname, channelname)
names = names_prefix
+ # max length: reply prefix ":server_name(space)" plus CRLF in the end
+ names_max_len = 512 - (len(self.server.name) + 2 + 2)
for name in sorted(x.nickname for x in channel.members):
- # 510 + space + CRLF = 512 as per RFC
- if len(names) + len(name) > 509:
+ # using >= to include the space between "names" and "name"
+ if len(names) + len(name) >= names_max_len:
self.reply(names)
names = names_prefix + name
else: