25 enum class HeaderConnection {
31 Q_ENUM(HeaderConnection)
41 inline virtual void resetData()
43 connState = MethodLine;
45 headerConnection = HeaderConnection::NotSet;
47 X_Forwarded_For =
false;
48 X_Forwarded_Host =
false;
49 X_Forwarded_Proto =
false;
52 virtual void socketDisconnected() {}
53 virtual void setupNewConnection(
Socket *sock) = 0;
55 qint64 contentLength = 0;
60 ParserState connState = MethodLine;
61 HeaderConnection headerConnection = HeaderConnection::NotSet;
63 bool headerHost =
false;
64 bool X_Forwarded_For =
false;
65 bool X_Forwarded_Host =
false;
66 bool X_Forwarded_Proto =
false;
73 enum class Type { Unknown, Http11, Http11Websocket, Http2, FastCGI1 };
79 virtual Type type()
const;
85 QIODevice *createBody(qint64 contentLength)
const;
87 qint64 m_postBufferSize;
88 qint64 m_postBuffering;
94 inline quint64 net_be64(
const char *buf)
97 auto src =
reinterpret_cast<const quint64 *
>(buf);
98 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
99 ptr[0] =
static_cast<quint8
>((*src >> 56) & 0xff);
100 ptr[1] =
static_cast<quint8
>((*src >> 48) & 0xff);
101 ptr[2] =
static_cast<quint8
>((*src >> 40) & 0xff);
102 ptr[3] =
static_cast<quint8
>((*src >> 32) & 0xff);
103 ptr[4] =
static_cast<quint8
>((*src >> 24) & 0xff);
104 ptr[5] =
static_cast<quint8
>((*src >> 16) & 0xff);
105 ptr[6] =
static_cast<quint8
>((*src >> 8) & 0xff);
106 ptr[7] =
static_cast<quint8
>(*src & 0xff);
110 inline quint32 net_be32(
const char *buf)
113 auto src =
reinterpret_cast<const quint32 *
>(buf);
114 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
115 ptr[0] =
static_cast<quint8
>((*src >> 24) & 0xff);
116 ptr[1] =
static_cast<quint8
>((*src >> 16) & 0xff);
117 ptr[2] =
static_cast<quint8
>((*src >> 8) & 0xff);
118 ptr[3] =
static_cast<quint8
>(*src & 0xff);
122 inline quint32 net_be24(
const char *buf)
125 auto src =
reinterpret_cast<const quint32 *
>(buf);
126 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
127 ptr[0] =
static_cast<quint8
>((*src >> 16) & 0xff);
128 ptr[1] =
static_cast<quint8
>((*src >> 8) & 0xff);
129 ptr[2] =
static_cast<quint8
>(*src & 0xff);
133 inline quint16 net_be16(
const char *buf)
136 auto src =
reinterpret_cast<const quint16 *
>(buf);
137 auto ptr =
reinterpret_cast<quint8 *
>(&ret);
138 ptr[0] =
static_cast<quint8
>((*src >> 8) & 0xff);
139 ptr[1] =
static_cast<quint8
>(*src & 0xff);
The Cutelyst namespace holds all public Cutelyst API.