Commits (1)
...@@ -487,6 +487,9 @@ function ircout(str) { ...@@ -487,6 +487,9 @@ function ircout(str) {
/* this = socket object passed from sock.on() */ /* this = socket object passed from sock.on() */
function Socket_Recv() { function Socket_Recv() {
if (!this.is_connected) { 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."); this.irc.quit("Connection reset by peer.");
return 1; return 1;
} }
......
...@@ -1496,8 +1496,7 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) { ...@@ -1496,8 +1496,7 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
var ww_serverdesc = ServerDesc; var ww_serverdesc = ServerDesc;
var tmp = "QUIT :" + str; this.bcast_to_uchans_unique(format("QUIT :%s", str));
this.bcast_to_uchans_unique(tmp);
for (i in this.channels) { for (i in this.channels) {
this.rmchan(this.channels[i]); this.rmchan(this.channels[i]);
} }
...@@ -1510,8 +1509,14 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) { ...@@ -1510,8 +1509,14 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
WhoWas[nick_uc] = new Array; WhoWas[nick_uc] = new Array;
var ww = WhoWas[nick_uc]; var ww = WhoWas[nick_uc];
var ptr = ww.unshift(new WhoWasObj(this.nick, this.uprefix, this.hostname, var ptr = ww.unshift(new WhoWasObj(
this.realname, this.servername, ww_serverdesc)) - 1; this.nick,
this.uprefix,
this.hostname,
this.realname,
this.servername,
ww_serverdesc
)) - 1;
WhoWasMap.unshift(ww[ptr]); WhoWasMap.unshift(ww[ptr]);
if (WhoWasMap.length > MAX_WHOWAS) { if (WhoWasMap.length > MAX_WHOWAS) {
...@@ -1523,12 +1528,9 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) { ...@@ -1523,12 +1528,9 @@ function User_Quit(str,suppress_bcast,is_netsplit,origin) {
} }
if (!suppress_bcast) if (!suppress_bcast)
this.bcast_to_servers(tmp); this.bcast_to_servers(format("QUIT :%s", str));
if (this.local) { if (this.local) {
/* We purge the queue and send immediately */
this.recvq.purge();
this.sendq.purge();
if (this.socket.is_connected) { if (this.socket.is_connected) {
this.socket.send(format("ERROR :Closing Link: [%s@%s] (%s)\r\n", this.socket.send(format("ERROR :Closing Link: [%s@%s] (%s)\r\n",
this.uprefix, this.uprefix,
......