Bug 126224 - Respect "MODES=" in RPL_ISUPPORT
Summary: Respect "MODES=" in RPL_ISUPPORT
Status: CONFIRMED
Alias: None
Product: konversation
Classification: Applications
Component: protocol (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 16:46 UTC by Sebastian Wiedenroth
Modified: 2010-06-11 02:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
respect RPL_ISUPPORT "MODES" (6.15 KB, patch)
2009-05-15 16:27 UTC, Sebastian Wiedenroth
Details
patch for respecting line length properly (2.81 KB, patch)
2010-06-11 02:47 UTC, Jonas Thiem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Wiedenroth 2006-04-25 16:46:23 UTC
Version:           0.19+ Build 3102 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc version 3.4.4 
OS:                Linux

When selecting multiply users in the nicklist and changing modes on them for every nick one mode-line gets sent. It would be better to look how many modes the server can handle in one line and send them together. This would save some bandwidth and not block the queue. For example giving voice to 12 users now takes 12 lines (and you'll wait very looong) but could be sent in just two lines on ircu.

RPL_ISUPPORT is documented here: http://www.faqs.org/ftp/pub/pub/internet-drafts/draft-brocklesby-irc-isupport-03.txt

Thanks! ;-)
Comment 1 Eike Hein 2006-04-25 18:05:09 UTC
Sounds good.
Comment 2 Sebastian Wiedenroth 2009-05-15 16:27:51 UTC
Created attachment 33683 [details]
respect RPL_ISUPPORT "MODES"

just created a patch for it against trunk, revision 967885.
Comment 3 Eike Hein 2009-05-15 17:05:09 UTC
This look good. I'm going to remove the support for an unlimited MODES (i.e. setModesCount(100)), however: A message operating on so many nicks would likely go beyond the 512 byte buffer limit imposed on a single IRC message, and thus get cut off and lose self-consistency.

Granted, this is a far-fetched scenario because there's probably no ircd out there that sends MODES without a value, and people are unlikely to set a mode on 100 people at once, but let's not be content with creating bugs we know about.

IOW, a proper implementation of unlimited MODES would need to be aware of the buffer limit and send only that much at once as can fit into a single IRC message. However, this patch is useful without support for that, so I'm going to merge a 3-or-what-the-server-tells-us version of it (shifting the blame to the server if it's too high a value).
Comment 4 Eike Hein 2009-05-15 17:17:51 UTC
SVN commit 968389 by hein:

Add partial support for MODES in RPL_ISUPPORT. Patch by
Sebastian Wiedenroth (thanks!) with some mangling by me.
CCBUG:126224


 M  +8 -0      ChangeLog  
 M  +26 -12    src/irc/channel.cpp  
 M  +10 -0     src/irc/inputfilter.cpp  
 M  +12 -0     src/irc/server.cpp  
 M  +4 -0      src/irc/server.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=968389
Comment 5 Jonas Thiem 2010-06-02 02:18:10 UTC
> so I'm going
> to merge a 3-or-what-the-server-tells-us version of it (shifting the blame to
> the server if it's too high a value).

Is that behaviour changed yet (not checking the buffer length)? If not you really should, because blaming it on the server is pretty useless here (as it makes no sense for the server to know how long your submitted names are).

The server only OFFERS you to submit up to e.g. 10 nicks if they fit into your line - it doesn't tell you that you MUST do it in all cases without taking the maximum message length into consideration anymore. It only tells you that it'd be able to handle as much as those 10 nicks if, and ONLY if that results in a valid, complete mode event command in your very specific case.
Comment 6 Eike Hein 2010-06-02 07:44:19 UTC
> Is that behaviour changed yet

Nope.
Comment 7 Jonas Thiem 2010-06-11 02:47:37 UTC
Created attachment 47884 [details]
patch for respecting line length properly

I implemented that behaviour now. I attached a patch file that will alter channel.cpp accordingly.

Konversation should then only use as many mode parameters as can be possibly sent without exceeding the line length or risking the resulting MODE event getting truncated (taking the prepended host mask for the event message into account).