Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
hpack_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
HPACK_P_H
6
#
define
HPACK_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists for the convenience
13
// of other Qt classes. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
"hpacktable_p.h"
20
21
#
include
<
QtCore
/
qurl
.
h
>
22
23
#
include
<
vector
>
24
#
include
<
optional
>
25
26
QT_BEGIN_NAMESPACE
27
28
class
QByteArray;
29
30
namespace
HPack
31
{
32
33
using
HttpHeader
=
std
::
vector
<
HeaderField
>;
34
HeaderSize
header_size
(
const
HttpHeader &header);
35
struct
BitPattern
;
36
class
Q_AUTOTEST_EXPORT
Encoder
37
{
38
public
:
39
Encoder
(
quint32
maxTableSize
,
bool
compressStrings
);
40
41
quint32
dynamicTableSize
()
const
;
42
quint32
dynamicTableCapacity
()
const
;
43
quint32
maxDynamicTableCapacity
()
const
;
44
45
bool
encodeRequest
(
class
BitOStream
&
outputStream
,
46
const
HttpHeader
&
header
);
47
bool
encodeResponse
(
BitOStream
&
outputStream
,
48
const
HttpHeader
&
header
);
49
50
bool
encodeSizeUpdate
(
BitOStream
&
outputStream
,
51
quint32
newSize
);
52
53
void
setMaxDynamicTableSize
(
quint32
size
);
54
void
setCompressStrings
(
bool
compress
);
55
56
private
:
57
bool
encodeRequestPseudoHeaders
(
BitOStream
&
outputStream
,
58
const
HttpHeader
&
header
);
59
bool
encodeHeaderField
(
BitOStream
&
outputStream
,
60
const
HeaderField
&
field
);
61
bool
encodeMethod
(
BitOStream
&
outputStream
,
62
const
HeaderField
&
field
);
63
64
bool
encodeResponsePseudoHeaders
(
BitOStream
&
outputStream
,
65
const
HttpHeader
&
header
);
66
67
bool
encodeIndexedField
(
BitOStream
&
outputStream
,
quint32
index
)
const
;
68
69
70
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
71
BitPattern
fieldType
,
72
quint32
nameIndex
,
73
const
QByteArray
&
value
,
74
bool
withCompression
);
75
76
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
77
BitPattern
fieldType
,
78
const
QByteArray
&
name
,
79
const
QByteArray
&
value
,
80
bool
withCompression
);
81
82
FieldLookupTable
lookupTable
;
83
bool
compressStrings
;
84
};
85
86
class
Q_AUTOTEST_EXPORT
Decoder
87
{
88
public
:
89
Decoder
(
quint32
maxTableSize
);
90
91
bool
decodeHeaderFields
(
class
BitIStream
&
inputStream
);
92
93
const
HttpHeader
&
decodedHeader
()
const
94
{
95
return
header
;
96
}
97
98
quint32
dynamicTableSize
()
const
;
99
quint32
dynamicTableCapacity
()
const
;
100
quint32
maxDynamicTableCapacity
()
const
;
101
102
void
setMaxDynamicTableSize
(
quint32
size
);
103
104
private
:
105
106
bool
decodeIndexedField
(
BitIStream
&
inputStream
);
107
bool
decodeSizeUpdate
(
BitIStream
&
inputStream
);
108
bool
decodeLiteralField
(
BitPattern
fieldType
,
109
BitIStream
&
inputStream
);
110
111
bool
processDecodedField
(
BitPattern
fieldType
,
112
const
QByteArray
&
name
,
113
const
QByteArray
&
value
);
114
115
void
handleStreamError
(
BitIStream
&
inputStream
);
116
117
HttpHeader
header
;
118
FieldLookupTable
lookupTable
;
119
};
120
121
std
::
optional
<
QUrl
>
makePromiseKeyUrl
(
const
HttpHeader &requestHeader);
122
}
123
124
QT_END_NAMESPACE
125
126
#
endif
HPack::Decoder
Definition
hpack_p.h:87
HPack::Encoder
Definition
hpack_p.h:37
HPack
Definition
bitstreams.cpp:17
HPack::header_size
HeaderSize header_size(const HttpHeader &header)
Definition
hpack.cpp:18
HPack::operator==
bool operator==(BitPattern lhs, BitPattern rhs)
Definition
hpack.cpp:39
HPack::makePromiseKeyUrl
std::optional< QUrl > makePromiseKeyUrl(const HttpHeader &requestHeader)
Definition
hpack.cpp:533
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
HPack::BitPattern
Definition
hpack.cpp:34
HPack::BitPattern::bitLength
uchar bitLength
Definition
hpack.cpp:36
HPack::BitPattern::value
uchar value
Definition
hpack.cpp:35
qtbase
src
network
access
http2
hpack_p.h
Generated on
for Qt by
1.14.0