From 2f07f35dfdfa6f9c5432d37a21c6b53c6468ace2 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Mar 2005 21:19:18 +0000 Subject: Fixed 005 numeric to only output 13 tokens per line (thanks anfl) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@923 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 9d3addf1b..6fd3ab500 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2407,7 +2407,24 @@ void ConnectUser(userrec *user) v << std::string(Network); std::string data005 = v.str(); FOREACH_MOD On005Numeric(data005); - WriteServ(user->fd,"005 %s %s :are supported by this server",user->nick,data005.c_str()); + // anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line... + // so i'd better split it :) + std::stringstream out(data005); + std::string token = ""; + std::string line5 = ""; + int token_counter = 0; + while (!out.eof()) + { + out >> token; + line5 = line5 + token + " "; + token_counter++; + if ((token_counter >= 13) || (out.eof() == true)) + { + WriteServ(user->fd,"005 %s %s:are supported by this server",user->nick,line5.c_str()); + line5 = ""; + token_counter = 0; + } + } ShowMOTD(user); FOREACH_MOD OnUserConnect(user); WriteOpers("*** Client connecting on port %d: %s!%s@%s [%s]",user->port,user->nick,user->ident,user->host,user->ip); -- cgit v1.2.3