X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=5a7f3ae02323d1a12dfcad08a839669112f1102b;hb=ac7e37c8542159fa0efa48b43c9ab346762f1638;hp=584a330bada2d16300bdb10a06c49614d0fb7b2e;hpb=1cf85908164d97dfa385c75b9f817905a8a75e78;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index 584a330ba..5a7f3ae02 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -90,6 +90,7 @@ struct fakederef #include "inspstring.h" #include "protocol.h" #include "bancache.h" +#include "isupportmanager.h" /** Template function to convert any input type to std::string */ @@ -241,27 +242,6 @@ class serverstats } }; -/** This class manages the generation and transmission of ISUPPORT. */ -class CoreExport ISupportManager -{ -private: - /** The generated lines which are sent to clients. */ - std::vector Lines; - -public: - /** (Re)build the ISUPPORT vector. */ - void Build(); - - /** Returns the std::vector of ISUPPORT lines. */ - const std::vector& GetLines() - { - return this->Lines; - } - - /** Send the 005 numerics (ISUPPORT) to a user. */ - void SendTo(LocalUser* user); -}; - DEFINE_HANDLER1(IsNickHandler, bool, const std::string&); DEFINE_HANDLER2(GenRandomHandler, void, char*, size_t); DEFINE_HANDLER1(IsIdentHandler, bool, const std::string&); @@ -669,6 +649,15 @@ class CoreExport InspIRCd */ static std::string TimeString(time_t curtime, const char* format = NULL, bool utc = false); + /** Compare two strings in a timing-safe way. If the lengths of the strings differ, the function + * returns false immediately (leaking information about the length), otherwise it compares each + * character and only returns after all characters have been compared. + * @param one First string + * @param two Second string + * @return True if the strings match, false if they don't + */ + static bool TimingSafeCompare(const std::string& one, const std::string& two); + /** Begin execution of the server. * NOTE: this function NEVER returns. Internally, * it will repeatedly loop.