cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
Cutelyst::H2Stream Class Referencefinal
Inheritance diagram for Cutelyst::H2Stream:

Public Types

enum  State { Idle , Open , HalfClosed , Closed }
 
- Public Types inherited from Cutelyst::EngineRequest
enum  StatusFlag : quint8 {
  InitialState , FinalizedHeaders , IOWrite , Chunked ,
  ChunkedDone , Async , Finalized
}
 

Public Member Functions

 H2Stream (quint32 streamId, qint32 initialWindowSize, ProtoRequestHttp2 *protoRequestH2)
 
qint64 doWrite (const char *data, qint64 len) override final
 
void processingFinished () override final
 
void windowUpdated ()
 
bool writeHeaders (quint16 status, const Cutelyst::Headers &headers) override final
 
- Public Member Functions inherited from Cutelyst::EngineRequest
void finalize ()
 
virtual void finalizeBody ()
 
virtual void finalizeCookies ()
 
virtual void finalizeError ()
 
virtual bool finalizeHeaders ()
 
void setPath (char *rawPath, const int len)
 
void setPath (QByteArray &path)
 
virtual bool webSocketClose (quint16 code, const QString &reason)
 
bool webSocketHandshake (const QByteArray &key, const QByteArray &origin, const QByteArray &protocol)
 
virtual bool webSocketSendBinaryMessage (const QByteArray &message)
 
virtual bool webSocketSendPing (const QByteArray &payload)
 
virtual bool webSocketSendTextMessage (const QString &message)
 
qint64 write (const char *data, qint64 len)
 

Public Attributes

qint64 consumedData
 
qint64 contentLength
 
qint32 dataSent
 
bool gotPath
 
QEventLooploop
 
ProtoRequestHttp2protoRequest
 
QByteArray scheme
 
quint8 state
 
quint32 streamId
 
qint32 windowSize
 
- Public Attributes inherited from Cutelyst::EngineRequest
QIODevicebody
 
Contextcontext
 
Headers headers
 
bool isSecure
 
QByteArray method
 
QString path
 
QByteArray protocol
 
QByteArray query
 
QHostAddress remoteAddress
 
quint16 remotePort
 
QString remoteUser
 
QByteArray serverAddress
 
TimePointSteady startOfRequest
 
Status status
 

Additional Inherited Members

- Protected Member Functions inherited from Cutelyst::EngineRequest
virtual bool webSocketHandshakeDo (const QByteArray &key, const QByteArray &origin, const QByteArray &protocol)
 

Detailed Description

Definition at line 34 of file protocolhttp2.h.

Member Enumeration Documentation

◆ State

enum Cutelyst::H2Stream::State

Definition at line 37 of file protocolhttp2.h.

Constructor & Destructor Documentation

◆ H2Stream()

H2Stream::H2Stream ( quint32  streamId,
qint32  initialWindowSize,
ProtoRequestHttp2 protoRequestH2 
)

Definition at line 847 of file protocolhttp2.cpp.

◆ ~H2Stream()

H2Stream::~H2Stream ( )
override

Definition at line 859 of file protocolhttp2.cpp.

Member Function Documentation

◆ doWrite()

qint64 H2Stream::doWrite ( const char *  data,
qint64  len 
)
finaloverridevirtual

Reimplement this to do the RAW writing to the client

Implements Cutelyst::EngineRequest.

Definition at line 867 of file protocolhttp2.cpp.

References QEventLoop::exec().

◆ processingFinished()

void H2Stream::processingFinished ( )
finaloverridevirtual

This is called when the Application chain is finished processing this request, here the request can send final bytes to the client or do a clean up.

Default implementation deletes both body and context.

If a WebSocket upgrade was made then you will want to keep the context object around.

Reimplemented from Cutelyst::EngineRequest.

Definition at line 944 of file protocolhttp2.cpp.

◆ windowUpdated()

void H2Stream::windowUpdated ( )

Definition at line 952 of file protocolhttp2.cpp.

◆ writeHeaders()

bool H2Stream::writeHeaders ( quint16  status,
const Cutelyst::Headers headers 
)
finaloverridevirtual

Reimplement this to write the headers back to the client

Implements Cutelyst::EngineRequest.

Definition at line 926 of file protocolhttp2.cpp.

References QByteArray::constData(), Cutelyst::EngineRequest::headers, QByteArray::size(), and Cutelyst::EngineRequest::status.

Member Data Documentation

◆ consumedData

qint64 Cutelyst::H2Stream::consumedData

Definition at line 56 of file protocolhttp2.h.

◆ contentLength

qint64 Cutelyst::H2Stream::contentLength

Definition at line 54 of file protocolhttp2.h.

◆ dataSent

qint32 Cutelyst::H2Stream::dataSent

Definition at line 55 of file protocolhttp2.h.

◆ gotPath

bool Cutelyst::H2Stream::gotPath

Definition at line 58 of file protocolhttp2.h.

◆ loop

QEventLoop* Cutelyst::H2Stream::loop

Definition at line 49 of file protocolhttp2.h.

◆ protoRequest

ProtoRequestHttp2* Cutelyst::H2Stream::protoRequest

Definition at line 51 of file protocolhttp2.h.

◆ scheme

QByteArray Cutelyst::H2Stream::scheme

Definition at line 50 of file protocolhttp2.h.

◆ state

quint8 Cutelyst::H2Stream::state

Definition at line 57 of file protocolhttp2.h.

◆ streamId

quint32 Cutelyst::H2Stream::streamId

Definition at line 52 of file protocolhttp2.h.

◆ windowSize

qint32 Cutelyst::H2Stream::windowSize

Definition at line 53 of file protocolhttp2.h.