Outgoing message from the perspective of the participants of an HTTP transaction.
More...
#include <HttpConnection.h>
|
| enum class | KnownHeader : uint8_t {
Connection
,
Host
,
UserAgent
,
ContentLength
,
ContentType
,
TransferEncoding
} |
| |
|
|
void | setHeaderMemory (Span< char > memory) |
| |
|
void | setWritableStream (AsyncWritableStream &stream) |
| |
|
bool | hasHeader (KnownHeader header) const |
| |
|
bool | hasSentHeaders () const |
| |
|
bool | hasEnded () const |
| |
|
bool | isChunkedTransferEncodingEnabled () const |
| |
|
|
HttpFixedBufferWriter | responseHeaders |
| |
|
Span< char > | headerMemory |
| |
|
bool | headersSent = false |
| |
|
bool | endCalled = false |
| |
| bool | forceDisableKeepAlive = false |
| | Whether keep alive has been force disabled permanently.
|
| |
| bool | keepAlive = true |
| | Whether to keep connection alive (HTTP/1.1 default)
|
| |
| bool | connectionHeaderAdded = false |
| | Whether Connection header was manually added.
|
| |
|
bool | hostHeaderAdded = false |
| |
|
bool | userAgentHeaderAdded = false |
| |
|
bool | contentLengthAdded = false |
| |
|
bool | contentTypeAdded = false |
| |
|
bool | transferEncodingAdded = false |
| |
|
bool | chunkedTransferEncodingEnabled = false |
| |
|
AsyncWritableStream * | destinationStream = nullptr |
| |
|
AsyncWritableStream * | writableStream = nullptr |
| |
|
ChunkedWritableStream | chunkedWritableStream |
| |
Outgoing message from the perspective of the participants of an HTTP transaction.
◆ addHeader()
Writes an http header to this response.
- Returns
- Valid Result if header was added successfully.
- Warning
- Adding a "Connection" header can fail if keep-alive has been force disabled
◆ end()
| Result SC::HttpOutgoingMessage::end |
( |
| ) |
|
Finalizes the writable stream after sending all in progress writes.
◆ getKeepAlive()
| bool SC::HttpOutgoingMessage::getKeepAlive |
( |
| ) |
const |
|
inlinenodiscard |
Gets whether the connection should be kept alive after this response.
- Returns
- true if connection should be kept alive
◆ getWritableStream()
Obtain writable stream for sending content back to connected client.
◆ reset()
| void SC::HttpOutgoingMessage::reset |
( |
| ) |
|
Resets this object for it to be re-usable.
◆ sendHeaders()
Start sending response headers, before sending any data.
◆ setChunkedTransferEncoding()
| Result SC::HttpOutgoingMessage::setChunkedTransferEncoding |
( |
| ) |
|
Enables chunked transfer-encoding for subsequent body writes.
◆ setKeepAlive()
| void SC::HttpOutgoingMessage::setKeepAlive |
( |
bool | keepAlive | ) |
|
Sets whether to keep the connection alive after this response.
- Parameters
-
| keepAlive | true to keep connection open for more requests, false to close after response |
- Warning
- HttpConnection can force disable keep-alive when running out of connections to prevent server deadlock
◆ connectionHeaderAdded
| bool SC::HttpOutgoingMessage::connectionHeaderAdded = false |
|
protected |
Whether Connection header was manually added.
◆ forceDisableKeepAlive
| bool SC::HttpOutgoingMessage::forceDisableKeepAlive = false |
|
protected |
Whether keep alive has been force disabled permanently.
◆ keepAlive
| bool SC::HttpOutgoingMessage::keepAlive = true |
|
protected |
Whether to keep connection alive (HTTP/1.1 default)
The documentation for this struct was generated from the following file: