Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
Http2 Namespace Reference

Classes

struct  Frame
 
class  FrameReader
 
class  FrameWriter
 
struct  PushPromise
 
struct  Stream
 

Enumerations

enum class  Settings : quint16 {
  HEADER_TABLE_SIZE_ID = 0x1 , ENABLE_PUSH_ID = 0x2 , MAX_CONCURRENT_STREAMS_ID = 0x3 , INITIAL_WINDOW_SIZE_ID = 0x4 ,
  MAX_FRAME_SIZE_ID = 0x5 , MAX_HEADER_LIST_SIZE_ID = 0x6
}
 
enum class  FrameType : uchar {
  DATA = 0x0 , HEADERS = 0x1 , PRIORITY = 0x2 , RST_STREAM = 0x3 ,
  SETTINGS = 0x4 , PUSH_PROMISE = 0x5 , PING = 0x6 , GOAWAY = 0x7 ,
  WINDOW_UPDATE = 0x8 , CONTINUATION = 0x9 , LAST_FRAME_TYPE
}
 
enum class  FrameFlag : uchar {
  EMPTY = 0x0 , ACK = 0x1 , END_STREAM = 0x1 , END_HEADERS = 0x4 ,
  PADDED = 0x8 , PRIORITY = 0x20
}
 
enum  Http2PredefinedParameters {
  clientPrefaceLength = 24 , connectionStreamID = 0 , frameHeaderSize = 9 , minPayloadLimit = 16384 ,
  maxPayloadSize = (1 << 24) - 1 , defaultSessionWindowSize = 65535 , maxConcurrentStreams = 100
}
 
enum class  FrameStatus { protocolError , sizeError , incompleteFrame , goodFrame }
 
enum  Http2Error {
  HTTP2_NO_ERROR = 0x0 , PROTOCOL_ERROR = 0x1 , INTERNAL_ERROR = 0x2 , FLOW_CONTROL_ERROR = 0x3 ,
  SETTINGS_TIMEOUT = 0x4 , STREAM_CLOSED = 0x5 , FRAME_SIZE_ERROR = 0x6 , REFUSE_STREAM = 0x7 ,
  CANCEL = 0x8 , COMPRESSION_ERROR = 0x9 , CONNECT_ERROR = 0xa , ENHANCE_YOUR_CALM = 0xb ,
  INADEQUATE_SECURITY = 0xc , HTTP_1_1_REQUIRED = 0xd
}
 

Functions

Frame configurationToSettingsFrame (const QHttp2Configuration &config)
 
QByteArray settingsFrameToBase64 (const Frame &frame)
 
void appendProtocolUpgradeHeaders (const QHttp2Configuration &config, QHttpNetworkRequest *request)
 
void qt_error (quint32 errorCode, QNetworkReply::NetworkError &error, QString &errorMessage)
 
QString qt_error_string (quint32 errorCode)
 
QNetworkReply::NetworkError qt_error (quint32 errorCode)
 
bool is_protocol_upgraded (const QHttpNetworkReply &reply)
 
std::vector< ucharassemble_hpack_block (const std::vector< Frame > &frames)
 
const quint32 lastValidStreamID ((quint32(1)<< 31) - 1)
 
const qint32 maxSessionReceiveWindowSize ((quint32(1)<< 31) - 1)
 

Variables

const char Http2clientPreface [clientPrefaceLength]
 
const qint32 qtDefaultStreamReceiveWindowSize = maxSessionReceiveWindowSize / 10
 

Enumeration Type Documentation

◆ FrameFlag

enum class Http2::FrameFlag : uchar
strong
Enumerator
EMPTY 
ACK 
END_STREAM 
END_HEADERS 
PADDED 
PRIORITY 

Definition at line 68 of file http2protocol_p.h.

◆ FrameStatus

enum class Http2::FrameStatus
strong
Enumerator
protocolError 
sizeError 
incompleteFrame 
goodFrame 

Definition at line 127 of file http2protocol_p.h.

◆ FrameType

enum class Http2::FrameType : uchar
strong
Enumerator
DATA 
HEADERS 
PRIORITY 
RST_STREAM 
SETTINGS 
PUSH_PROMISE 
PING 
GOAWAY 
WINDOW_UPDATE 
CONTINUATION 
LAST_FRAME_TYPE 

Definition at line 49 of file http2protocol_p.h.

◆ Http2Error

Enumerator
HTTP2_NO_ERROR 
PROTOCOL_ERROR 
INTERNAL_ERROR 
FLOW_CONTROL_ERROR 
SETTINGS_TIMEOUT 
STREAM_CLOSED 
FRAME_SIZE_ERROR 
REFUSE_STREAM 
CANCEL 
COMPRESSION_ERROR 
CONNECT_ERROR 
ENHANCE_YOUR_CALM 
INADEQUATE_SECURITY 
HTTP_1_1_REQUIRED 

Definition at line 135 of file http2protocol_p.h.

◆ Http2PredefinedParameters

Enumerator
clientPrefaceLength 
connectionStreamID 
frameHeaderSize 
minPayloadLimit 
maxPayloadSize 
defaultSessionWindowSize 
maxConcurrentStreams 

Definition at line 81 of file http2protocol_p.h.

◆ Settings

enum class Http2::Settings : quint16
strong
Enumerator
HEADER_TABLE_SIZE_ID 
ENABLE_PUSH_ID 
MAX_CONCURRENT_STREAMS_ID 
INITIAL_WINDOW_SIZE_ID 
MAX_FRAME_SIZE_ID 
MAX_HEADER_LIST_SIZE_ID 

Definition at line 39 of file http2protocol_p.h.

Function Documentation

◆ appendProtocolUpgradeHeaders()

void Http2::appendProtocolUpgradeHeaders ( const QHttp2Configuration & config,
QHttpNetworkRequest * request )

Definition at line 74 of file http2protocol.cpp.

References appendProtocolUpgradeHeaders(), configurationToSettingsFrame(), frame, Q_ASSERT, request, and settingsFrameToBase64().

Referenced by QHttpNetworkConnectionChannel::_q_connected(), and appendProtocolUpgradeHeaders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assemble_hpack_block()

std::vector< uchar > Http2::assemble_hpack_block ( const std::vector< Frame > & frames)

Definition at line 199 of file http2protocol.cpp.

References assemble_hpack_block(), frame, and qAddOverflow().

Referenced by assemble_hpack_block().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configurationToSettingsFrame()

struct Frame Http2::configurationToSettingsFrame ( const QHttp2Configuration & config)

Definition at line 35 of file http2protocol.cpp.

References Http2::FrameWriter::append(), configurationToSettingsFrame(), connectionStreamID, defaultSessionWindowSize, minPayloadLimit, and Http2::FrameWriter::outboundFrame().

Referenced by appendProtocolUpgradeHeaders(), and configurationToSettingsFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_protocol_upgraded()

bool Http2::is_protocol_upgraded ( const QHttpNetworkReply & reply)

Definition at line 185 of file http2protocol.cpp.

References Qt::CaseInsensitive, QNetworkReply::header(), is_protocol_upgraded(), reply, and QHttpHeaders::Upgrade.

Referenced by QHttpNetworkConnectionChannel::allDone(), and is_protocol_upgraded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lastValidStreamID()

const quint32 Http2::lastValidStreamID ( (quint32(1)<< 31) - 1)

Referenced by QHttp2Connection::createStream().

+ Here is the caller graph for this function:

◆ maxSessionReceiveWindowSize()

const qint32 Http2::maxSessionReceiveWindowSize ( (quint32(1)<< 31) - 1)

Referenced by QNetworkRequest::QNetworkRequest(), QHttp2Configuration::setSessionReceiveWindowSize(), and QHttp2Configuration::setStreamReceiveWindowSize().

+ Here is the caller graph for this function:

◆ qt_error() [1/2]

QNetworkReply::NetworkError Http2::qt_error ( quint32 errorCode)

Definition at line 177 of file http2protocol.cpp.

References error, QNetworkReply::NoError, and qt_error().

+ Here is the call graph for this function:

◆ qt_error() [2/2]

void Http2::qt_error ( quint32 errorCode,
QNetworkReply::NetworkError & error,
QString & errorMessage )

Definition at line 92 of file http2protocol.cpp.

References CANCEL, COMPRESSION_ERROR, CONNECT_ERROR, QNetworkReply::ContentAccessDenied, ENHANCE_YOUR_CALM, error, errorMessage(), FLOW_CONTROL_ERROR, FRAME_SIZE_ERROR, HTTP2_NO_ERROR, HTTP_1_1_REQUIRED, INADEQUATE_SECURITY, INTERNAL_ERROR, QNetworkReply::InternalServerError, QNetworkReply::NoError, PROTOCOL_ERROR, QNetworkReply::ProtocolFailure, qt_error(), REFUSE_STREAM, SETTINGS_TIMEOUT, STREAM_CLOSED, QNetworkReply::TimeoutError, QNetworkReply::UnknownNetworkError, and QNetworkReply::UnknownServerError.

Referenced by qt_error(), qt_error(), and qt_error_string().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_error_string()

QString Http2::qt_error_string ( quint32 errorCode)

Definition at line 169 of file http2protocol.cpp.

References error, QNetworkReply::NoError, and qt_error().

+ Here is the call graph for this function:

◆ settingsFrameToBase64()

QByteArray Http2::settingsFrameToBase64 ( const Frame & frame)

Definition at line 59 of file http2protocol.cpp.

References QByteArray::Base64UrlEncoding, frame, QByteArray::fromRawData(), QByteArray::OmitTrailingEquals, Q_ASSERT, settingsFrameToBase64(), and wrapper().

Referenced by appendProtocolUpgradeHeaders(), and settingsFrameToBase64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ Http2clientPreface

const Q_AUTOTEST_EXPORT char Http2::Http2clientPreface
Initial value:
=
{0x50, 0x52, 0x49, 0x20, 0x2a, 0x20,
0x48, 0x54, 0x54, 0x50, 0x2f, 0x32,
0x2e, 0x30, 0x0d, 0x0a, 0x0d, 0x0a,
0x53, 0x4d, 0x0d, 0x0a, 0x0d, 0x0a}

Definition at line 29 of file http2protocol.cpp.

◆ qtDefaultStreamReceiveWindowSize

const qint32 Http2::qtDefaultStreamReceiveWindowSize = maxSessionReceiveWindowSize / 10

Definition at line 118 of file http2protocol_p.h.

Referenced by QNetworkRequest::QNetworkRequest().