diff options
| author | 2022-01-07 17:12:42 +0000 | |
|---|---|---|
| committer | 2022-01-07 17:16:50 +0000 | |
| commit | 52cc8a418307ae7a551d23e6bd2d367b544e7bf9 (patch) | |
| tree | 9fff020964190f33174e78ff6201381be577d0b3 /src/modules/m_ident.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
| download | inspircd++-52cc8a418307ae7a551d23e6bd2d367b544e7bf9.tar.gz inspircd++-52cc8a418307ae7a551d23e6bd2d367b544e7bf9.tar.bz2 inspircd++-52cc8a418307ae7a551d23e6bd2d367b544e7bf9.zip | |
Refactor CoreException and ModuleException.
Diffstat (limited to 'src/modules/m_ident.cpp')
| -rw-r--r-- | src/modules/m_ident.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index b40546fec..caaa8f116 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -109,13 +109,14 @@ class IdentRequestSocket final time_t age; bool done; /* True if lookup is finished */ - IdentRequestSocket(LocalUser* u) : user(u) + IdentRequestSocket(const Module* mod, LocalUser* luser) + : user(luser) { age = ServerInstance->Time(); SetFd(socket(user->server_sa.family(), SOCK_STREAM, 0)); if (!HasFd()) - throw ModuleException("Could not create socket"); + throw ModuleException(mod, "Could not create socket"); done = false; @@ -140,7 +141,7 @@ class IdentRequestSocket final if (SocketEngine::Bind(GetFd(), bindaddr) < 0) { this->Close(); - throw ModuleException("failed to bind()"); + throw ModuleException(mod, "failed to bind()"); } SocketEngine::NonBlocking(GetFd()); @@ -149,14 +150,14 @@ class IdentRequestSocket final if (SocketEngine::Connect(this, connaddr) == -1 && errno != EINPROGRESS) { this->Close(); - throw ModuleException("connect() failed"); + throw ModuleException(mod, "connect() failed"); } /* Add fd to socket engine */ if (!SocketEngine::AddFd(this, FD_WANT_NO_READ | FD_WANT_POLL_WRITE)) { this->Close(); - throw ModuleException("out of fds"); + throw ModuleException(mod, "out of fds"); } } @@ -343,7 +344,7 @@ class ModuleIdent final try { - isock = new IdentRequestSocket(user); + isock = new IdentRequestSocket(this, user); socket.Set(user, isock); } catch (ModuleException &e) |
