X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=36b3d712cfbcacd14cd09e2efa311cebff9251f5;hb=683055a13b0cb5c41556eaafef99af27edf1e868;hp=1b91a86ef32e9864da7c03bb30c071dae7917da3;hpb=9994478a85358bfa48bd5b764ebc1e74e928d57a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 1b91a86ef..36b3d712c 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -30,11 +30,21 @@ int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::st { int MOD_RESULT = 0; FOREACH_RESULT_I(this,I_OnPassCompare,OnPassCompare(ex, data, input, hashtype)) + + /* Module matched */ if (MOD_RESULT == 1) return 0; + + /* Module explicitly didnt match */ if (MOD_RESULT == -1) return 1; - return data != input; // this seems back to front, but returns 0 if they *match*, 1 else + + /* We dont handle any hash types except for plaintext - Thanks tra26 */ + if (hashtype != "" && hashtype != "plaintext") + /* See below. 1 because they dont match */ + return 1; + + return (data != input); // this seems back to front, but returns 0 if they *match*, 1 else } /* LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list. @@ -218,32 +228,8 @@ CmdResult CommandParser::CallHandler(const std::string &commandname, const std:: void CommandParser::DoLines(User* current, bool one_only) { - // while there are complete lines to process... - unsigned int floodlines = 0; - while (current->BufferIsReady()) { - if (current->MyClass) - { - if (ServerInstance->Time() > current->reset_due) - { - current->reset_due = ServerInstance->Time() + current->MyClass->GetThreshold(); - current->lines_in = 0; - } - - if (++current->lines_in > current->MyClass->GetFlood() && current->MyClass->GetFlood()) - { - ServerInstance->FloodQuitUser(current); - return; - } - - if ((++floodlines > current->MyClass->GetFlood()) && (current->MyClass->GetFlood() != 0)) - { - ServerInstance->FloodQuitUser(current); - return; - } - } - // use GetBuffer to copy single lines into the sanitized string std::string single_line = current->GetBuffer(); current->bytes_in += single_line.length(); @@ -602,7 +588,7 @@ void CommandParser::SetupCommandTable() dirent* entry = NULL; while (0 != (entry = readdir(library))) { - if (InspIRCd::Match(entry->d_name, "cmd_*.so")) + if (InspIRCd::Match(entry->d_name, "cmd_*.so", ascii_case_insensitive_map)) { printf("."); fflush(stdout);