From 2663c248d3d5070a769788baaa00a024a702ecb5 Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Sat, 3 Oct 2009 13:07:49 +0000 Subject: * Make the master server require hostname in infoResponses --- src/master/messages.c | 8 ++++++++ src/master/stats.c | 1 + 2 files changed, 9 insertions(+) (limited to 'src/master') diff --git a/src/master/messages.c b/src/master/messages.c index 563023ef..a86e7957 100644 --- a/src/master/messages.c +++ b/src/master/messages.c @@ -364,6 +364,14 @@ static void HandleInfoResponse (server_t* server, const char* msg) peer_address, value); return; } + // some people enjoy making it hard to find them + value = SearchInfostring (msg, "hostname"); + if (!value || !value[0]) + { + MsgPrint (MSG_ERROR, "ERROR: no hostname from %s\n", + peer_address, value); + return; + } // Check and save the values of "protocol" and "maxclients" value = SearchInfostring (msg, "protocol"); diff --git a/src/master/stats.c b/src/master/stats.c index 98ebb32e..61d8c140 100644 --- a/src/master/stats.c +++ b/src/master/stats.c @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include +#include #include #include #include -- cgit