![]() |
cutelyst
4.9.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
|

Public Types | |
| enum | OpCode { OpCodeContinue, OpCodeText, OpCodeBinary, OpCodeReserved3, OpCodeReserved4, OpCodeReserved5, OpCodeReserved6, OpCodeReserved7, OpCodeClose, OpCodePing, OpCodePong, OpCodeReservedB, OpCodeReservedC, OpCodeReservedD, OpCodeReservedE, OpCodeReservedF } |
| enum | WebSocketPhase { WebSocketPhaseHeaders, WebSocketPhaseSize, WebSocketPhaseMask, WebSocketPhasePayload } |
Public Types inherited from Cutelyst::ProtocolData | |
| enum | HeaderConnection { NotSet, Keep, Close, Upgrade } |
| enum | ParserState { MethodLine, HeaderLine, ContentBody, H2Frames } |
Public Types inherited from Cutelyst::EngineRequest | |
| enum | StatusFlag : quint8 { InitialState, FinalizedHeaders, IOWrite, Chunked, ChunkedDone, Async, Finalized } |
Public Member Functions | |
| ProtoRequestHttp (Socket *sock, int bufferSize) | |
| qint64 | doWrite (const char *data, qint64 len) override final |
| qint64 | doWrite (const QByteArray &data) |
| void | processingFinished () override final |
| void | resetData () override final |
| void | setupNewConnection (Socket *sock) override final |
| virtual void | socketDisconnected () override final |
| bool | webSocketClose (quint16 code, const QString &reason) override final |
| bool | webSocketSendBinaryMessage (const QByteArray &message) override final |
| bool | webSocketSendPing (const QByteArray &payload) override final |
| bool | webSocketSendTextMessage (const QString &message) override final |
| bool | writeHeaders (quint16 status, const Cutelyst::Headers &headers) override final |
Public Member Functions inherited from Cutelyst::ProtocolData | |
| ProtocolData (Socket *sock, int bufferSize) | |
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) |
| bool | webSocketHandshake (const QByteArray &key, const QByteArray &origin, const QByteArray &protocol) |
| qint64 | write (const char *data, qint64 len) |
Public Attributes | |
| int | beginLine |
| int | last |
| quint8 | websocket_continue_opcode |
| quint8 | websocket_finn_opcode |
| quint32 | websocket_mask |
| QByteArray | websocket_message |
| quint32 | websocket_need |
| QByteArray | websocket_payload |
| quint64 | websocket_payload_size |
| int | websocket_phase |
| int | websocket_start_of_frame |
| bool | websocketUpgraded |
Public Attributes inherited from Cutelyst::ProtocolData | |
| int | buf_size |
| char * | buffer |
| ParserState | connState |
| qint64 | contentLength |
| HeaderConnection | headerConnection |
| bool | headerHost |
| QIODevice * | io |
| Socket * | sock |
| ProtocolData * | upgradedFrom |
| bool | X_Forwarded_For |
| bool | X_Forwarded_Host |
| bool | X_Forwarded_Proto |
Public Attributes inherited from Cutelyst::EngineRequest | |
| QIODevice * | body |
| Context * | context |
| Headers | headers |
| bool | isSecure |
| QByteArray | method |
| QString | path |
| QByteArray | protocol |
| QByteArray | query |
| QHostAddress | remoteAddress |
| quint16 | remotePort |
| QString | remoteUser |
| QByteArray | serverAddress |
| TimePointSteady | startOfRequest |
| Status | status |
Protected Member Functions | |
| bool | webSocketHandshakeDo (const QByteArray &key, const QByteArray &origin, const QByteArray &protocol) override final |
Definition at line 18 of file protocolhttp.h.
|
finaloverridevirtual |
Reimplement this to do the RAW writing to the client
Implements Cutelyst::EngineRequest.
Definition at line 398 of file protocolhttp.cpp.
References QIODevice::write().
|
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 403 of file protocolhttp.cpp.
References Cutelyst::EngineRequest::status.
|
finaloverridevirtual |
Reimplement this to write the headers back to the client
Implements Cutelyst::EngineRequest.
Definition at line 341 of file protocolhttp.cpp.
References QByteArray::append(), Qt::CaseInsensitive, QByteArray::compare(), Cutelyst::Headers::data(), Cutelyst::EngineRequest::headers, Cutelyst::EngineRequest::protocol, QByteArray::size(), Cutelyst::EngineRequest::status, and QIODevice::write().