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
4
#
ifndef
HPACK_P_H
5
#
define
HPACK_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists for the convenience
12
// of other Qt classes. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
"hpacktable_p.h"
19
20
#
include
<
QtCore
/
qglobal
.
h
>
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
43
bool
encodeRequest
(
class
BitOStream
&
outputStream
,
44
const
HttpHeader
&
header
);
45
bool
encodeResponse
(
BitOStream
&
outputStream
,
46
const
HttpHeader
&
header
);
47
48
bool
encodeSizeUpdate
(
BitOStream
&
outputStream
,
49
quint32
newSize
);
50
51
void
setMaxDynamicTableSize
(
quint32
size
);
52
void
setCompressStrings
(
bool
compress
);
53
54
private
:
55
bool
encodeRequestPseudoHeaders
(
BitOStream
&
outputStream
,
56
const
HttpHeader
&
header
);
57
bool
encodeHeaderField
(
BitOStream
&
outputStream
,
58
const
HeaderField
&
field
);
59
bool
encodeMethod
(
BitOStream
&
outputStream
,
60
const
HeaderField
&
field
);
61
62
bool
encodeResponsePseudoHeaders
(
BitOStream
&
outputStream
,
63
const
HttpHeader
&
header
);
64
65
bool
encodeIndexedField
(
BitOStream
&
outputStream
,
quint32
index
)
const
;
66
67
68
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
69
BitPattern
fieldType
,
70
quint32
nameIndex
,
71
const
QByteArray
&
value
,
72
bool
withCompression
);
73
74
bool
encodeLiteralField
(
BitOStream
&
outputStream
,
75
BitPattern
fieldType
,
76
const
QByteArray
&
name
,
77
const
QByteArray
&
value
,
78
bool
withCompression
);
79
80
FieldLookupTable
lookupTable
;
81
bool
compressStrings
;
82
};
83
84
class
Q_AUTOTEST_EXPORT
Decoder
85
{
86
public
:
87
Decoder
(
quint32
maxTableSize
);
88
89
bool
decodeHeaderFields
(
class
BitIStream
&
inputStream
);
90
91
const
HttpHeader
&
decodedHeader
()
const
92
{
93
return
header
;
94
}
95
96
quint32
dynamicTableSize
()
const
;
97
98
void
setMaxDynamicTableSize
(
quint32
size
);
99
100
private
:
101
102
bool
decodeIndexedField
(
BitIStream
&
inputStream
);
103
bool
decodeSizeUpdate
(
BitIStream
&
inputStream
);
104
bool
decodeLiteralField
(
BitPattern
fieldType
,
105
BitIStream
&
inputStream
);
106
107
bool
processDecodedField
(
BitPattern
fieldType
,
108
const
QByteArray
&
name
,
109
const
QByteArray
&
value
);
110
111
void
handleStreamError
(
BitIStream
&
inputStream
);
112
113
HttpHeader
header
;
114
FieldLookupTable
lookupTable
;
115
};
116
117
std
::
optional
<
QUrl
>
makePromiseKeyUrl
(
const
HttpHeader &requestHeader);
118
}
119
120
QT_END_NAMESPACE
121
122
#
endif
HPack::Decoder
Definition
hpack_p.h:85
HPack::Encoder
Definition
hpack_p.h:37
HPack
Definition
bitstreams.cpp:16
HPack::header_size
HeaderSize header_size(const HttpHeader &header)
Definition
hpack.cpp:17
HPack::operator==
bool operator==(BitPattern lhs, BitPattern rhs)
Definition
hpack.cpp:38
HPack::makePromiseKeyUrl
std::optional< QUrl > makePromiseKeyUrl(const HttpHeader &requestHeader)
Definition
hpack.cpp:507
std
Definition
qfloat16.h:492
HPack::BitPattern
Definition
hpack.cpp:33
HPack::BitPattern::bitLength
uchar bitLength
Definition
hpack.cpp:35
HPack::BitPattern::value
uchar value
Definition
hpack.cpp:34
qtbase
src
network
access
http2
hpack_p.h
Generated on Sat Sep 28 2024 00:40:42 for Qt by
1.12.0