X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=9fef906d16d83de783acfe89e93de293563443bf;hb=08f6f056667df63d1673bea959c73b75393113c6;hp=a84e12b4aa348e24460df77a223c4c29b9461370;hpb=97b5e92c3d1195c4e3b3dc8dea3183c06399414e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index a84e12b4a..9fef906d1 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -494,7 +494,7 @@ void LocalUser::CheckClass(bool clone_count) } } - this->nping = ServerInstance->Time() + a->GetPingTime() + ServerInstance->Config->dns_timeout; + this->nping = ServerInstance->Time() + a->GetPingTime(); } bool LocalUser::CheckLines(bool doZline) @@ -541,8 +541,8 @@ void LocalUser::FullConnect() this->WriteNumeric(RPL_YOURHOSTIS, InspIRCd::Format("Your host is %s, running version %s", ServerInstance->Config->ServerName.c_str(), INSPIRCD_BRANCH)); this->WriteNumeric(RPL_SERVERCREATED, InspIRCd::TimeString(ServerInstance->startup_time, "This server was created %H:%M:%S %b %d %Y")); - const std::string& modelist = ServerInstance->Modes->GetModeListFor004Numeric(); - this->WriteNumeric(RPL_SERVERVERSION, ServerInstance->Config->ServerName, INSPIRCD_BRANCH, modelist); + const TR1NS::array& modelist = ServerInstance->Modes->GetModeListFor004Numeric(); + this->WriteNumeric(RPL_SERVERVERSION, ServerInstance->Config->ServerName, INSPIRCD_BRANCH, modelist[0], modelist[1], modelist[2]); ServerInstance->ISupport.SendTo(this); @@ -681,10 +681,9 @@ int LocalUser::GetServerPort() const std::string& User::GetIPString() { - int port; if (cachedip.empty()) { - irc::sockets::satoap(client_sa, cachedip, port); + cachedip = client_sa.addr(); /* IP addresses starting with a : on irc are a Bad Thing (tm) */ if (cachedip[0] == ':') cachedip.insert(cachedip.begin(),1,'0'); @@ -708,10 +707,10 @@ irc::sockets::cidr_mask User::GetCIDRMask() return irc::sockets::cidr_mask(client_sa, range); } -bool User::SetClientIP(const char* sip, bool recheck_eline) +bool User::SetClientIP(const std::string& address, bool recheck_eline) { this->InvalidateCache(); - return irc::sockets::aptosa(sip, 0, client_sa); + return irc::sockets::aptosa(address, 0, client_sa); } void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline) @@ -721,10 +720,10 @@ void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline) memcpy(&client_sa, &sa, sizeof(irc::sockets::sockaddrs)); } -bool LocalUser::SetClientIP(const char* sip, bool recheck_eline) +bool LocalUser::SetClientIP(const std::string& address, bool recheck_eline) { irc::sockets::sockaddrs sa; - if (!irc::sockets::aptosa(sip, 0, sa)) + if (!irc::sockets::aptosa(address, 0, sa)) // Invalid return false; @@ -1173,13 +1172,11 @@ ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask) } ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask, const ConnectClass& parent) - : config(tag), type(t), fakelag(parent.fakelag), name("unnamed"), - registration_timeout(parent.registration_timeout), host(mask), pingtime(parent.pingtime), - softsendqmax(parent.softsendqmax), hardsendqmax(parent.hardsendqmax), recvqmax(parent.recvqmax), - penaltythreshold(parent.penaltythreshold), commandrate(parent.commandrate), - maxlocal(parent.maxlocal), maxglobal(parent.maxglobal), maxconnwarn(parent.maxconnwarn), maxchans(parent.maxchans), - limit(parent.limit), resolvehostnames(parent.resolvehostnames), ports(parent.ports) { + Update(&parent); + name = "unnamed"; + type = t; + config = tag; } void ConnectClass::Update(const ConnectClass* src)