taskWeeChat - Tasks: task #6583, handle netsplits in some better...

 
 

task #6583: handle netsplits in some better way.

Submitted by:  None
Submitted on:  Sun 04 Mar 2007 05:10:12 PM UTC  
Votes:  108  
 
Category: irc pluginShould Start On: Sun 04 Mar 2007 12:00:00 AM UTC
Should be Finished on: Fri 01 Jan 2038 12:00:00 AM UTCPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Originator Name: darkkOriginator Email: -unavailable-
Open/Closed: OpenPlanned Release: None
IRC nick: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 24 Jan 2014 03:54:27 PM UTC, comment #2:

This is how irssi detects netsplit quits.

(Some checks might no longer be necessary, as almost all servers prefix user-provided quit messages with "Quit: " or similar. Still...)


/* check if quit message is a netsplit message */
int quitmsg_is_split(const char *msg)
{
const char *host2, *p;
int prev, len, host1_dot, host2_dot;

g_return_val_if_fail(msg != NULL, FALSE);

/* NOTE: there used to be some paranoia checks (some older IRC
clients have even more), but they're pretty useless nowadays,
since IRC server prefixes the quit message with a space if it
looks like a netsplit message.

So, the check is currently just:
- host1.domain1 host2.domain2
- top-level domains have to be 2+ characters long,
containing only alphabets
- only 1 space
- no double-dots (".." - probably useless check)
- hosts/domains can't start or end with a dot
- the two hosts can't be identical (probably useless check)
- can't contain ':' or '/' chars (some servers allow URLs)
*/
host2 = NULL;
prev = '\0'; len = 0; host1_dot = host2_dot = 0;
while (*msg != '\0') {
if (*msg == ' ') {
if (prev == '.' || prev == '\0') {
/* domains can't end with '.', space can't
be the first character in msg. */
return FALSE;
}
if (host2 != NULL)
return FALSE; /* only one space allowed */
if (!host1_dot)
return FALSE; /* host1 didn't have domain */
host2 = msg+1; len = -1;
} else if (*msg == '.') {
if (prev == '\0' || prev == ' ' || prev == '.') {
/* domains can't start with '.'
and can't have ".." */
return FALSE;
}

if (host2 != NULL)
host2_dot = TRUE;
else
host1_dot = TRUE;
} else if (*msg == ':' || *msg == '/')
return FALSE;

prev = *msg;
msg++; len++;
}

if (!host2_dot || prev == '.')
return FALSE;

/* top-domain1 must be 2+ chars long and contain only alphabets */
p = host2-1;
while (p[-1] != '.') {
if (!i_isalpha(p[-1]))
return FALSE;
p--;
}
if (host2-p-1 < 2) return FALSE;

/* top-domain2 must be 2+ chars long and contain only alphabets */
p = host2+strlen(host2);
while (p[-1] != '.') {
if (!i_isalpha(p[-1]))
return FALSE;
p--;
}
if (strlen(p) < 2) return FALSE;

return TRUE;
}

Mantas Mikul─Śnas <grawity>
Tue 30 Sep 2008 03:20:32 PM UTC, comment #1:

+1 to this. It would be nicer to get nicks grouped in a single message, with a command to show more, than 100 separate messages.

tigrmesh <tigrmesh>
Sun 04 Mar 2007 05:10:12 PM UTC, original submission:

Will be nice if we see something better than 100 lines of nicks with same quit message, something like
<-- netsplit (irc.foo.bar irc.42.baz): Nick, Name, Nickname
--> netsplit over.... (nicklist)

quote from rfc2813

When "netsplit" (See Section 4.1.6) occur, the "Quit Message" is
composed of the names of two servers involved, separated by a space.
The first name is that of the server which is still connected and the
second name is either that of the server which has become
disconnected or that of the server to which the leaving client was
connected:

<Quit Message> = ":" servername SPACE servername

Because the "Quit Message" has a special meaning for "netsplits",
servers SHOULD NOT allow a client to use a <Quit Message> in the
format described above.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by grawity (Posted a comment)
  • -unavailable- added by arza (Voted in favor of this item)
  • -unavailable- added by flashcode (Updated the item)
  • -unavailable- added by tigrmesh (Posted a comment)
  • -unavailable- added by yannickp (Voted in favor of this item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 108 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 Apr 2011 06:27:59 PM UTCarzaCarbon-Copy-=>Added arza
    Sun 11 Jan 2009 09:43:06 AM UTCflashcodeCategoryNone=>irc plugin
    Thu 15 Nov 2007 11:23:02 PM UTCyannickpCarbon-Copy-=>Added yannickp

    Back to the top


    Powered by Savane 3.1-cleanup1