aboutsummaryrefslogtreecommitdiffstats
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-02-17 17:22:23 -0600
committerGravatar Daniel De Graaf2010-08-03 17:32:36 -0400
commit0584675861f05321b89fff44fda38ebd49006e54 (patch)
treea8cd3ac16fc68d78aeacfb9d1c745cf8311f0bdb /src/usermanager.cpp
parentRemove useless return value from OnUserRegister (diff)
New I/O hook API
This removes some pointless Module:: entries, uses the ServiceProvider lookup API for bind tags, and allows GnuTLS to use custom certificates per bind or link block using: <bind ssl="gnutls" ssl_cert="signed" ...> <ssl_cert name="signed" certfile="my.cert.pem" keyfile="my.key.pem">
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index 588af9510..af8e9e6d4 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -16,40 +16,11 @@
#include "bancache.h"
/* add a client connection to the sockets list */
-void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
+void UserManager::AddUser(LocalUser* New, ListenSocket* via)
{
- /* NOTE: Calling this one parameter constructor for User automatically
- * allocates a new UUID and places it in the hash_map.
- */
- LocalUser* New = NULL;
- try
- {
- New = new LocalUser(socket, client, server);
- }
- catch (...)
- {
- ServerInstance->Logs->Log("USERS", DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
- ServerInstance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!");
- return;
- }
UserIOHandler* eh = &New->eh;
- /* Give each of the modules an attempt to hook the user for I/O */
- FOREACH_MOD(I_OnHookIO, OnHookIO(eh, via));
-
- if (eh->GetIOHook())
- {
- try
- {
- eh->GetIOHook()->OnStreamSocketAccept(eh, client, server);
- }
- catch (CoreException& modexcept)
- {
- ServerInstance->Logs->Log("SOCKET", DEBUG,"%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
- }
- }
-
- ServerInstance->Logs->Log("USERS", DEBUG,"New user fd: %d", socket);
+ ServerInstance->Logs->Log("USERS", DEBUG,"New user %s on FD %d", New->uuid.c_str(), eh->GetFd());
this->unregistered_count++;
@@ -195,22 +166,7 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
{
LocalUser* lu = IS_LOCAL(user);
FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(lu));
- UserIOHandler* eh = &lu->eh;
- eh->DoWrite();
- if (eh->GetIOHook())
- {
- try
- {
- eh->GetIOHook()->OnStreamSocketClose(eh);
- }
- catch (CoreException& modexcept)
- {
- ServerInstance->Logs->Log("USERS",DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
- }
- }
-
- ServerInstance->SE->DelFd(eh);
- eh->Close();
+ lu->eh.Close();
}
/*