userrec* u; // user record that the lookup is associated with
int ufd;
- RFC1413(InspIRCd* SI, userrec* user, int maxtime) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), u(user), ufd(user->fd)
+ RFC1413(InspIRCd* SI, userrec* user, int maxtime) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), u(user)
{
+ ufd = user->GetFd();
}
virtual void OnTimeout()
{
// When we timeout, the connection failed within the allowed timeframe,
// so we just display a notice, and tidy off the ident_data.
- if (u && (Instance->fd_ref_table[ufd] == u))
+ if (u && (Instance->SE->GetRef(ufd) == u))
{
u->Shrink("ident_data");
u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead.");
*j = '\0'; // truncate at invalid chars
if (*section)
{
- if (u && (Instance->fd_ref_table[ufd] == u))
+ if (u && (Instance->SE->GetRef(ufd) == u))
{
if (this->Instance->IsIdent(section))
{
// descriptor that they were when the lookup began.
//
// Fixes issue reported by webs, 7 Jun 2006
- if (u && (Instance->fd_ref_table[ufd] == u))
+ if (u && (Instance->SE->GetRef(ufd) == u))
{
u->Shrink("ident_data");
}
virtual void OnError(InspSocketError e)
{
- if (u && (Instance->fd_ref_table[ufd] == u))
+ if (u && (Instance->SE->GetRef(ufd) == u))
{
u->Shrink("ident_data");
}
virtual bool OnConnected()
{
- if (u && (Instance->fd_ref_table[ufd] == u))
+ Instance->Log(DEBUG,"Ident: connected");
+ if (u && (Instance->SE->GetRef(ufd) == u))
{
uslen = sizeof(sock_us);
themlen = sizeof(sock_them);
- if ((getsockname(this->u->fd,(sockaddr*)&sock_us,&uslen) || getpeername(this->u->fd, (sockaddr*)&sock_them, &themlen)))
+ if ((getsockname(this->u->GetFd(),(sockaddr*)&sock_us,&uslen) || getpeername(this->u->GetFd(), (sockaddr*)&sock_them, &themlen)))
{
Instance->Log(DEBUG,"Ident: failed to get socket names, bailing");
return false;
*/
user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident...");
RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout);
- if (ident->GetState() != I_ERROR)
- {
- user->Extend("ident_data", (char*)ident);
- ServerInstance->AddSocket(ident);
- }
- else
- {
- user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using "+std::string(user->ident)+" instead.");
- DELETE(ident);
- }
+ user->Extend("ident_data", (char*)ident);
}
virtual bool OnCheckReady(userrec* user)
// a user which has now vanished! To prevent this, set ident::u
// to NULL and check it so that we dont write users who have gone away.
ident->u = NULL;
- ServerInstance->RemoveSocket(ident);
}
}
}
if (user->GetExt("ident_data", ident))
{
ident->u = NULL;
- ServerInstance->RemoveSocket(ident);
}
}