From c54c8739f0e9929b36758d49965c64109019d56e Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 25 Aug 2011 19:24:51 +0000
Subject: [PATCH] Remove stupid "Type '!HELP' for a list of commands." thinger.

---
 exec/load/geoip.js           | 29 +++++------------------------
 exec/load/http.js            |  2 +-
 exec/load/ircbot_commands.js |  1 -
 3 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/exec/load/geoip.js b/exec/load/geoip.js
index 9a7db815d8..d2876f754b 100644
--- a/exec/load/geoip.js
+++ b/exec/load/geoip.js
@@ -14,47 +14,28 @@ function get_geoip(host, countryonly)
 {
 	var GeoIP;
 	var m,i,j;
-	var ishost=false;
 	var geoip_url;
 	var result;
 	var tmpobj={};
 	var isarray=(typeof(host)=='object' && host instanceof Array);
 
-	/*
-	 * Check if this is an IP address or a hostname...
-	 * (We'll ignore weird encodings though like 12345.12345)
-	 */
-	if(!isarray) {
-		m=host.match(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/);
-		if(m!=null) {
-			if(m.length==5) {
-				for(i=1; i<5; i++) {
-					j=parseInt(m[i]);
-					if(j < 0 || j > 255) {
-						ishost=true;
-						break;
-					}
-				}	
-			}
-		}
-		else
-			ishost=true;
+	if(isarray) {
+		for(i in host)
+			host[i]=resolve_ip(host[i]);
 	}
+	else
+		host=resolve_ip(host);
 
 	// Get the best URL
 	if(countryonly) {
 		if(isarray)
 			geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(','));
-		else if(ishost)
-			geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
 		else
 			geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
 	}
 	else {
 		if(isarray)
 			geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(','));
-		else if(ishost)
-			geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
 		else
 			geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
 	}
diff --git a/exec/load/http.js b/exec/load/http.js
index c819275851..fa3b2885e1 100644
--- a/exec/load/http.js
+++ b/exec/load/http.js
@@ -94,7 +94,7 @@ function HTTPRequest()
 		this.response_headers=[];
 
 		for(;;) {
-			header=this.sock.recvline(4096);
+			header=this.sock.recvline(4096, 120);
 			if(header==null)
 				throw("Unable to receive headers");
 			if(header=='')
diff --git a/exec/load/ircbot_commands.js b/exec/load/ircbot_commands.js
index 24c6fbcd92..da644729a5 100644
--- a/exec/load/ircbot_commands.js
+++ b/exec/load/ircbot_commands.js
@@ -621,7 +621,6 @@ Server_Commands["PRIVMSG"] = function (srv,cmd,onick,ouh)	{
 		if(!cmd) return false;
 		
 		if(cmd[0].length == 0) {
-			srv.o(chan.name,"Type '" + get_cmd_prefix() + "HELP' for a list of commands.");
 			return false;
 		}
 		
-- 
GitLab