From 1e4d37149c3c44a479dc3440a650e433c7f1b9c2 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 20 Apr 2005 02:48:12 +0000 Subject: Added OnUserDisconnect method to modules.* to fix fd leak in m_ident.cpp git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1134 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/commands.cpp') diff --git a/src/commands.cpp b/src/commands.cpp index 088dabe68..e69ad41f6 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -93,7 +93,6 @@ extern bool nofork; extern time_t TIME; -extern std::vector fd_reap; extern std::vector module_names; extern char MyExecutable[1024]; @@ -927,8 +926,14 @@ void handle_quit(char **parameters, int pcnt, userrec *user) AddWhoWas(user); } + FOREACH_MOD OnUserDisconnect(user); + /* push the socket on a stack of sockets due to be closed at the next opportunity */ - fd_reap.push_back(user->fd); + if (user->fd > -1) + { + shutdown(user->fd,2); + close(user->fd); + } if (iter != clientlist.end()) { -- cgit v1.3.1-10-gc9f91