X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcoremods%2Fcore_serialize_rfc.cpp;h=dcd67d49e041c1061d05dd25913022a87739c8ed;hb=a30a0074edac353cb60e134b43fa8ff0ffb67f8b;hp=23a4c205276ce61c188304e00bbd9ed06fda4ec3;hpb=cbef0241a04eafe5250b75ebb3f7ef8c32ecb260;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_serialize_rfc.cpp b/src/coremods/core_serialize_rfc.cpp index 23a4c2052..dcd67d49e 100644 --- a/src/coremods/core_serialize_rfc.cpp +++ b/src/coremods/core_serialize_rfc.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2016 Attila Molnar + * Copyright (C) 2018-2019 Sadie Powell + * Copyright (C) 2018 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -32,7 +33,7 @@ class RFCSerializer : public ClientProtocol::Serializer static const std::string::size_type MAX_CLIENT_MESSAGE_TAG_LENGTH = 4095; /** The maximum size of server-originated message tags in an outgoing message including the `@`. */ - static const std::string::size_type MAX_SERVER_MESSAGE_TAG_LENGTH = 511; + static const std::string::size_type MAX_SERVER_MESSAGE_TAG_LENGTH = 4095; static void SerializeTags(const ClientProtocol::TagMap& tags, const ClientProtocol::TagSelection& tagwl, std::string& line); @@ -59,7 +60,7 @@ bool RFCSerializer::Parse(LocalUser* user, const std::string& line, ClientProtoc // Work out how long the message can actually be. size_t maxline = ServerInstance->Config->Limits.MaxLine - start - 2; if (line[start] == '@') - maxline += MAX_CLIENT_MESSAGE_TAG_LENGTH + 1; + maxline += MAX_CLIENT_MESSAGE_TAG_LENGTH + 1; irc::tokenstream tokens(line, start, maxline); ServerInstance->Logs->Log("USERINPUT", LOG_RAWIO, "C[%s] I %s", user->uuid.c_str(), tokens.GetMessage().c_str()); @@ -88,7 +89,7 @@ bool RFCSerializer::Parse(LocalUser* user, const std::string& line, ClientProtoc while (ss.GetToken(token)) { // Two or more tags with the same key must not be sent, but if a client violates that we accept - // the first occurence of duplicate tags and ignore all later occurences. + // the first occurrence of duplicate tags and ignore all later occurrences. // // Another option is to reject the message entirely but there is no standard way of doing that. const std::string::size_type p = token.find('=');