}
else
{
- current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over 512chars) Please shorten it.", current->nick);
+ current->WriteServ("NOTICE %s :Your previous line was too long and was not delivered (Over %d chars) Please shorten it.", current->nick, MAXBUF-2);
current->recvq = "";
}
}
std::string single_line = current->GetBuffer();
current->bytes_in += single_line.length();
current->cmds_in++;
- if (single_line.length() > 512)
- single_line.resize(512);
+ if (single_line.length() > MAXBUF - 2) /* MAXBUF is 514 to allow for neccessary line terminators */
+ single_line.resize(MAXBUF - 2); /* So to trim to 512 here, we use MAXBUF - 2 */
EventHandler* old_comp = this->SE->GetRef(currfd);
*/
if ((TIME > curr->timeout) && (curr->registered != REG_ALL))
{
+ curr->muted = true;
GlobalCulls.AddItem(curr,"Registration timeout");
continue;
}
bool ready = AllModulesReportReady(curr);
if ((TIME > curr->signon) && (curr->registered == REG_NICKUSER) && (ready))
{
- curr->dns_done = true;
+ if (!curr->dns_done)
+ {
+ curr->WriteServ("NOTICE Auth :*** Could not resolve your hostname: Request timed out; using your IP address (%s) instead.", curr->GetIPString());
+ curr->dns_done = true;
+ }
this->stats->statsDnsBad++;
curr->FullConnect();
continue;
/* Everybody loves boobies. */
time_t time = this->Time(false) - (curr->nping - curr->pingmax);
std::string boobies = "Ping timeout: " + ConvToStr(time) + " second" + (time > 1 ? "s" : "");
+ curr->muted = true;
GlobalCulls.AddItem(curr, boobies);
curr->lastping = 1;
curr->nping = TIME+curr->pingmax;