From 9ba719688161499f01c168b1aed84a563bcb5953 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 15 Sep 2012 10:11:31 -0400 Subject: Make CommandSource use references, sometimes we hold them for awhile --- modules/extra/m_ldap_authentication.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'modules/extra/m_ldap_authentication.cpp') diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index 0f0593c34..7fcd67e5d 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -10,7 +10,6 @@ static Anope::string username_attribute; struct IdentifyInfo { - dynamic_reference user; dynamic_reference command; CommandSource source; std::vector params; @@ -20,8 +19,8 @@ struct IdentifyInfo service_reference lprov; bool admin_bind; - IdentifyInfo(User *u, Command *c, CommandSource &s, const std::vector &pa, const Anope::string &a, const Anope::string &p, service_reference &lp) : - user(u), command(c), source(s), params(pa), account(a), pass(p), lprov(lp), admin_bind(true) { } + IdentifyInfo(Command *c, CommandSource &s, const std::vector &pa, const Anope::string &a, const Anope::string &p, service_reference &lp) : + command(c), source(s), params(pa), account(a), pass(p), lprov(lp), admin_bind(true) { } }; class IdentifyInterface : public LDAPInterface @@ -47,7 +46,7 @@ class IdentifyInterface : public LDAPInterface IdentifyInfo *ii = it->second; this->requests.erase(it); - if (!ii->user || !ii->command || !ii->lprov) + if (!ii->source.GetUser() || !ii->command || !ii->lprov) { delete this; return; @@ -75,7 +74,7 @@ class IdentifyInterface : public LDAPInterface } else { - User *u = ii->user; + User *u = ii->source.GetUser(); Command *c = ii->command; u->Extend("m_ldap_authentication_error", NULL); @@ -98,7 +97,7 @@ class IdentifyInterface : public LDAPInterface } else { - User *u = ii->user; + User *u = ii->source.GetUser(); Command *c = ii->command; u->Extend("m_ldap_authentication_authenticated", NULL); @@ -137,13 +136,13 @@ class IdentifyInterface : public LDAPInterface IdentifyInfo *ii = it->second; this->requests.erase(it); - if (!ii->user || !ii->command) + if (!ii->source.GetUser() || !ii->command) { delete ii; return; } - User *u = ii->user; + User *u = ii->source.GetUser(); Command *c = ii->command; u->Extend("m_ldap_authentication_error", NULL); @@ -289,7 +288,7 @@ class NSIdentifyLDAP : public Module return EVENT_CONTINUE; } - IdentifyInfo *ii = new IdentifyInfo(u, c, *source, params, account, password, this->ldap); + IdentifyInfo *ii = new IdentifyInfo(c, *source, params, account, password, this->ldap); try { LDAPQuery id = this->ldap->BindAsAdmin(&this->iinterface); -- cgit