10#include <Cutelyst/Server/cutelyst_server_export.h>
13#include <QLoggingCategory>
14#include <QTemporaryFile>
16Q_LOGGING_CATEGORY(CUTELYST_SERVER_PROTO,
"cutelyst.server.proto", QtWarningMsg)
17Q_LOGGING_CATEGORY(CUTELYST_SERVER_STATS,
"cutelyst.server.stats", QtWarningMsg)
24 , buffer(new char[bufferSize])
28ProtocolData::~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()}
42Cutelyst::Protocol::~Protocol()
44 delete[] m_postBuffer;
47Cutelyst::Protocol::Type Cutelyst::Protocol::type()
const
49 return Protocol::Type::Unknown;
52QIODevice *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"
The Cutelyst namespace holds all public Cutelyst API.
virtual bool open(QIODeviceBase::OpenMode flags) override
QString errorString() const const