From f7932166b202b4c5ec93573be2241340dd60f110 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Mon, 20 Jan 2014 11:59:53 -0600 Subject: [PATCH] A few small fixes --- lib/api.js | 3 +++ lib/channel.js | 6 ++++++ lib/get-info.js | 3 +++ 3 files changed, 12 insertions(+) diff --git a/lib/api.js b/lib/api.js index 39fc5708..8d01fd03 100644 --- a/lib/api.js +++ b/lib/api.js @@ -22,6 +22,9 @@ module.exports = function (Server) { if((Server.cfg["trust-x-forward"] || raw === "127.0.0.1") && forward) { var ip = forward.split(",")[0]; Logger.syslog.log("REVPROXY " + raw + " => " + ip); + if (ip === undefined) { + Logger.errlog.log("WTF: ip is undefined from getIP, forward=" + forward); + } return ip; } return raw; diff --git a/lib/channel.js b/lib/channel.js index 5143db50..4d490387 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -891,6 +891,12 @@ Channel.prototype.userJoin = function(user, password) { self.kick(u, "Duplicate login"); } }); + + // It's possible that by kicking the user above, the channel usercount became + // 0 and it unloaded from memory + if (this.dead) { + return; + } } this.users.push(user); diff --git a/lib/get-info.js b/lib/get-info.js index 40d85ba2..f280dd97 100644 --- a/lib/get-info.js +++ b/lib/get-info.js @@ -758,6 +758,9 @@ function VimeoIsADoucheCopter(id, cb) { }); } return; + } else if (data.indexOf("This video does not exist.") !== -1) { + cb({}); + return; } Logger.errlog.log("Vimeo workaround error: "); Logger.errlog.log(e);