10 #include <Cutelyst/Server/cutelyst_server_export.h> 13 #include <QLoggingCategory> 14 #include <QTemporaryFile> 16 Q_LOGGING_CATEGORY(CUTELYST_SERVER_PROTO,
"cutelyst.server.proto", QtWarningMsg)
17 Q_LOGGING_CATEGORY(CUTELYST_SERVER_STATS,
"cutelyst.server.stats", QtWarningMsg)
24 , buffer(new char[bufferSize])
28 ProtocolData::~ProtocolData()
34 : m_postBufferSize{qMax(static_cast<qint64>(32), server->postBufferingBufsize())}
35 , m_postBuffering{server->postBuffering()}
36 , m_postBuffer{
new char[server->postBufferingBufsize()]}
37 , m_bufferSize{server->bufferSize()}
38 , useStats{CUTELYST_SERVER_STATS().isDebugEnabled()}
42 Cutelyst::Protocol::~Protocol()
44 delete[] m_postBuffer;
47 Cutelyst::Protocol::Type Cutelyst::Protocol::type()
const 49 return Protocol::Type::Unknown;
52 QIODevice *Cutelyst::Protocol::createBody(qint64 contentLength)
const 55 if (m_postBuffering && contentLength > m_postBuffering) {
58 qCWarning(CUTELYST_SERVER_PROTO)
59 <<
"Failed to open temporary file to store post" << temp->
errorString();
64 }
else if (m_postBuffering && contentLength <= m_postBuffering) {
67 buffer->buffer().reserve(
int(contentLength));
73 buffer->buffer().reserve(
int(contentLength));
79 #include "moc_protocol.cpp"
QString errorString() const const
virtual bool open(OpenMode flags) override
The Cutelyst namespace holds all public Cutelyst API.