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
#
include
<
limits
>
26
27
QT_BEGIN_NAMESPACE
28
29
class
QByteArray;
30
31
namespace
HPack
32
{
33
34
using
HttpHeader
=
std
::
vector
<
HeaderField
>;
35
HeaderSize
header_size
(
const
HttpHeader &header);
36
struct
BitPattern
;
37
class
Q_AUTOTEST_EXPORT
Encoder
38
{
39
public
:
40
Encoder
(
quint32
maxTableSize
,
bool
compressStrings
);
41
42
quint32
dynamicTableSize
()
const
;
43
quint32
dynamicTableCapacity
()
const
;
44
quint32
maxDynamicTableCapacity
()
const
;
45
46
bool
encodeRequest
(
class
BitOStream
&
outputStream
,
47
const
HttpHeader
&
header
);
48
bool
encodeResponse
(
BitOStream
&
outputStream
,
49
const
HttpHeader
&
header
);
50
51
bool
encodeSizeUpdate
(
BitOStream
&
outputStream
,
52
quint32
newSize
);
53
54
void
setMaxDynamicTableSize
(
quint32
size
);
55
void
setCompressStrings
(
bool
compress
);
56
57
private
:
58
bool
encodeRequestPseudoHeaders
(
BitOStream
&
outputStream
,
59
const
HttpHeader
&
header
);
60
bool
encodeHeaderField
(
BitOStream
&
outputStream
,
61
const
HeaderField
&
field
);
62
bool
encodeMethod
(
BitOStream
&
outputStream
,
63
const
HeaderField
&
field
);
64
65
bool
encodeResponsePseudoHeaders
(
BitOStream
&
outputStream
,
66
const
HttpHeader
&
header
);
67
68
bool
encodeIndexedField
(
BitOStream
&
outputStream
,
quint32
index
)
const
;
69
70
71
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
72
BitPattern
fieldType
,
73
quint32
nameIndex
,
74
const
QByteArray
&
value
,
75
bool
withCompression
);
76
77
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
78
BitPattern
fieldType
,
79
const
QByteArray
&
name
,
80
const
QByteArray
&
value
,
81
bool
withCompression
);
82
83
FieldLookupTable
lookupTable
;
84
bool
compressStrings
;
85
};
86
87
class
Q_AUTOTEST_EXPORT
Decoder
88
{
89
public
:
90
Decoder
(
quint32
maxTableSize
);
91
92
bool
decodeHeaderFields
(
class
BitIStream
&
inputStream
);
93
94
const
HttpHeader
&
decodedHeader
()
const
95
{
96
return
header
;
97
}
98
99
quint32
dynamicTableSize
()
const
;
100
quint32
dynamicTableCapacity
()
const
;
101
quint32
maxDynamicTableCapacity
()
const
;
102
103
void
setMaxDynamicTableSize
(
quint32
size
);
104
void
setMaxHeaderListSize
(
quint32
size
);
105
106
private
:
107
108
bool
decodeIndexedField
(
BitIStream
&
inputStream
);
109
bool
decodeSizeUpdate
(
BitIStream
&
inputStream
);
110
bool
decodeLiteralField
(
BitPattern
fieldType
,
111
BitIStream
&
inputStream
);
112
113
bool
processDecodedField
(
BitPattern
fieldType
,
114
const
QByteArray
&
name
,
115
const
QByteArray
&
value
);
116
117
void
handleStreamError
(
BitIStream
&
inputStream
);
118
119
HttpHeader
header
;
120
FieldLookupTable
lookupTable
;
121
122
quint64
headerListSize
= 0;
123
quint32
maxHeaderListSize
= (
std
::
numeric_limits
<
quint32
>::
max
)();
124
};
125
126
std
::
optional
<
QUrl
>
makePromiseKeyUrl
(
const
HttpHeader &requestHeader);
127
}
128
129
QT_END_NAMESPACE
130
131
#
endif
HPack::Decoder
Definition
hpack_p.h:88
HPack::Encoder
Definition
hpack_p.h:38
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:544
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
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.16.1