diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-09 18:51:07 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-03-09 18:51:07 +0000 |
commit | 349b6b91931f3e5ab03bf5ea085d1928c306afe2 (patch) | |
tree | 2415a1f747348953e35efde2f101642a654a4225 /include | |
parent | 63bdb9171f19deb8483de0a521ed7a712543382d (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/inspsocket.h | 4 |
1 files changed, 4 insertions, 0 deletions
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. |