From 349b6b91931f3e5ab03bf5ea085d1928c306afe2 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 9 Mar 2009 18:51:07 +0000 Subject: Rewrite BufferedSocket::BindAddr to actually make sense, and not infinite loop under some conditions, etc. This also splits a lot of it into DoBindMagic(), for readability. Seems to work okay on an invalid bind and nonexistant bind.. Fixes bug #754, reported by HiroP and Indoril. Fix FD leak in some circumstances: if bind fails hard (requested address couldn't be bound), Close() the socket. Also fixes a deficiency of the previous commit in that if one address failed to bind, the FD would be invalidated. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11189 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspsocket.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/inspsocket.h b/include/inspsocket.h index 43903ae97..13381a15d 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -171,6 +171,10 @@ class CoreExport BufferedSocket : public EventHandler */ bool BindAddr(const std::string &ip); + /** (really) Try bind to a given IP setup. For internal use only. + */ + bool DoBindMagic(const std::string ¤t_ip, bool v6); + /** * The default constructor does nothing * and should not be used. -- cgit v1.2.3