28 enum class HeaderConnection {
34 Q_ENUM(HeaderConnection)
44 virtual void resetData()
46 connState = MethodLine;
48 headerConnection = HeaderConnection::NotSet;
50 X_Forwarded_For =
false;
51 X_Forwarded_Host =
false;
52 X_Forwarded_Proto =
false;
55 virtual void socketDisconnected() {}
56 virtual void setupNewConnection(
Socket *sock) = 0;
58 qint64 contentLength = 0;
63 ParserState connState = MethodLine;
64 HeaderConnection headerConnection = HeaderConnection::NotSet;
66 bool headerHost =
false;
67 bool X_Forwarded_For =
false;
68 bool X_Forwarded_Host =
false;
69 bool X_Forwarded_Proto =
false;
76 enum class Type { Unknown, Http11, Http11Websocket, Http2, FastCGI1 };
82 virtual Type type()
const;
88 QIODevice *createBody(qint64 contentLength)
const;
90 qint64 m_postBufferSize;
91 qint64 m_postBuffering;
97 inline quint64 net_be64(
const char *buf)
100 auto src =
reinterpret_cast<const quint64 *
>(buf);
101 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
102 ptr[0] =
static_cast<quint8
>((*src >> 56) & 0xff);
103 ptr[1] =
static_cast<quint8
>((*src >> 48) & 0xff);
104 ptr[2] =
static_cast<quint8
>((*src >> 40) & 0xff);
105 ptr[3] =
static_cast<quint8
>((*src >> 32) & 0xff);
106 ptr[4] =
static_cast<quint8
>((*src >> 24) & 0xff);
107 ptr[5] =
static_cast<quint8
>((*src >> 16) & 0xff);
108 ptr[6] =
static_cast<quint8
>((*src >> 8) & 0xff);
109 ptr[7] =
static_cast<quint8
>(*src & 0xff);
113 inline quint32 net_be32(
const char *buf)
116 auto src =
reinterpret_cast<const quint32 *
>(buf);
117 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
118 ptr[0] =
static_cast<quint8
>((*src >> 24) & 0xff);
119 ptr[1] =
static_cast<quint8
>((*src >> 16) & 0xff);
120 ptr[2] =
static_cast<quint8
>((*src >> 8) & 0xff);
121 ptr[3] =
static_cast<quint8
>(*src & 0xff);
125 inline quint32 net_be24(
const char *buf)
128 auto src =
reinterpret_cast<const quint32 *
>(buf);
129 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
130 ptr[0] =
static_cast<quint8
>((*src >> 16) & 0xff);
131 ptr[1] =
static_cast<quint8
>((*src >> 8) & 0xff);
132 ptr[2] =
static_cast<quint8
>(*src & 0xff);
136 inline quint16 net_be16(
const char *buf)
139 auto src =
reinterpret_cast<const quint16 *
>(buf);
140 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
141 ptr[0] =
static_cast<quint8
>((*src >> 8) & 0xff);
142 ptr[1] =
static_cast<quint8
>(*src & 0xff);
The Cutelyst namespace holds all public Cutelyst API.