10#include <Cutelyst/cutelyst_global.h>
13#include <QLoggingCategory>
14#include <QTemporaryFile>
16Q_LOGGING_CATEGORY(C_SERVER_PROTO,
"cutelyst.server.proto", QtWarningMsg)
17#if defined(CUTELYST_SERVER_EXPORT_STATS)
18Q_LOGGING_CATEGORY(CUTELYST_STATS,
"cutelyst.stats", QtWarningMsg)
20Q_DECLARE_LOGGING_CATEGORY(CUTELYST_STATS)
28 , buffer(new char[bufferSize])
32ProtocolData::~ProtocolData()
38 : m_postBufferSize{qMax(static_cast<qint64>(32), server->postBufferingBufsize())}
39 , m_postBuffering{server->postBuffering()}
40 , m_postBuffer{new char[server->postBufferingBufsize()]}
41 , m_bufferSize{server->bufferSize()}
42 , useStats{CUTELYST_STATS().isDebugEnabled()}
46Cutelyst::Protocol::~Protocol()
48 delete[] m_postBuffer;
51Cutelyst::Protocol::Type Cutelyst::Protocol::type()
const
53 return Protocol::Type::Unknown;
56QIODevice *Cutelyst::Protocol::createBody(qint64 contentLength)
const
59 if (m_postBuffering && contentLength > m_postBuffering) {
62 qCWarning(C_SERVER_PROTO)
63 <<
"Failed to open temporary file to store post" << temp->
errorString();
68 }
else if (m_postBuffering && contentLength <= m_postBuffering) {
71 buffer->buffer().reserve(
int(contentLength));
77 buffer->buffer().reserve(
int(contentLength));
83#include "moc_protocol.cpp"
The Cutelyst namespace holds all public Cutelyst API.
virtual bool open(QIODeviceBase::OpenMode flags) override
QString errorString() const const