Skip to content
Snippets Groups Projects
Commit 7ed58c5f authored by Randy Sommerfeld's avatar Randy Sommerfeld
Browse files

Only purge queue on connection reset. Clean up user QUIT a bit.

parent fd884b8d
No related branches found
No related tags found
No related merge requests found
......@@ -487,6 +487,9 @@ function ircout(str) {
/* this = socket object passed from sock.on() */
function Socket_Recv() {
if (!this.is_connected) {
/* We purge the queue and send immediately */
this.irc.recvq.purge();
this.irc.sendq.purge();
this.irc.quit("Connection reset by peer.");
return 1;
}
......
......@@ -1496,8 +1496,7 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
var ww_serverdesc = ServerDesc;
var tmp = "QUIT :" + str;
this.bcast_to_uchans_unique(tmp);
this.bcast_to_uchans_unique(format("QUIT :%s", str));
for (i in this.channels) {
this.rmchan(this.channels[i]);
}
......@@ -1510,8 +1509,14 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
WhoWas[nick_uc] = new Array;
var ww = WhoWas[nick_uc];
var ptr = ww.unshift(new WhoWasObj(this.nick, this.uprefix, this.hostname,
this.realname, this.servername, ww_serverdesc)) - 1;
var ptr = ww.unshift(new WhoWasObj(
this.nick,
this.uprefix,
this.hostname,
this.realname,
this.servername,
ww_serverdesc
)) - 1;
WhoWasMap.unshift(ww[ptr]);
if (WhoWasMap.length > MAX_WHOWAS) {
......@@ -1523,12 +1528,9 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
}
if (!suppress_bcast)
this.bcast_to_servers(tmp);
this.bcast_to_servers(format("QUIT :%s", str));
if (this.local) {
/* We purge the queue and send immediately */
this.recvq.purge();
this.sendq.purge();
if (this.socket.is_connected) {
this.socket.send(format("ERROR :Closing Link: [%s@%s] (%s)\r\n",
this.uprefix,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment