diff options
| author | 2006-07-14 11:17:42 +0000 | |
|---|---|---|
| committer | 2006-07-14 11:17:42 +0000 | |
| commit | 44a631e265c968594b101e324f74a6dbcb787f07 (patch) | |
| tree | 9b0234cb9f5c744ef61e515b5793a1bd6621b35d /src/users.cpp | |
| parent | Might as well make this message match, for completeness (diff) | |
Fix sometimes-leaking dns sockets when user quits between the two lookups (forward and reverse)
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4382 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp index 264aea270..4cb6185bd 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -121,6 +121,9 @@ userrec::userrec() chans.clear(); invites.clear(); chans.resize(MAXCHANS); +#ifndef THREADED_DNS + dns_fd = -1; +#endif for (unsigned int n = 0; n < MAXCHANS; n++) { ucrec* x = new ucrec(); @@ -137,6 +140,11 @@ userrec::~userrec() ucrec* x = (ucrec*)*n; delete x; } + if (dns_fd > -1) + { + shutdown(dns_fd, 2); + close(dns_fd); + } } void userrec::MakeHost(char* nhost) |
