inline bool inProgress()

in src/filtration/filtratorimpl.h [74:116]


    inline bool inProgress(PacketInfo& info)
    {
        Filtrator*       filtrator     = static_cast<Filtrator*>(this);
        constexpr size_t callHeaderLen = Filtrator::lengthOfBaseHeader();
        if(msg_len || to_be_copied)
        {
            return true;
        }

        if(!collection) // collection isn't allocated
        {
            collection.allocate(); // allocate new collection from writer
        }
        const size_t data_size = collection.data_size();

        if(data_size + info.dlen > callHeaderLen)
        {
            static uint8_t buffer[callHeaderLen];
            const uint8_t* header = info.data;

            if(data_size > 0)
            {
                // Coping happends only once per TCP-session
                memcpy(buffer, collection.data(), data_size);
                memcpy(buffer + data_size, info.data, callHeaderLen - data_size);
                header = buffer;
            }

            // It is right header
            if(filtrator->isRightHeader(header))
            {
                return true;
            }

            filtrator->reset();
        }
        else
        {
            collection.push(info, info.dlen);
        }

        return false;
    }