From 7ac816f78c8ae39776e100df74b253dac70bf760 Mon Sep 17 00:00:00 2001
From: Attila Molnar <attilamolnar@hush.com>
Date: Mon, 3 Nov 2014 15:34:20 +0100
Subject: m_httpd Always timeout connections, set default timeout to 10 seconds

---
 src/modules/m_httpd.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index bf372f34f..98dfcc387 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -366,7 +366,7 @@ class ModuleHttpServer : public Module
 	void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
 	{
 		ConfigTag* tag = ServerInstance->Config->ConfValue("httpd");
-		timeoutsec = tag->getInt("timeout");
+		timeoutsec = tag->getInt("timeout", 10, 1);
 	}
 
 	ModResult OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) CXX11_OVERRIDE
@@ -382,9 +382,6 @@ class ModuleHttpServer : public Module
 
 	void OnBackgroundTimer(time_t curtime) CXX11_OVERRIDE
 	{
-		if (!timeoutsec)
-			return;
-
 		time_t oldest_allowed = curtime - timeoutsec;
 		for (std::set<HttpServerSocket*>::const_iterator i = sockets.begin(); i != sockets.end(); )
 		{
-- 
cgit v1.2.3