#include <icy/http/packetizers.h>Inherits:
PacketProcessor
HTTP multipart encoding adapter for multipart/x-mixed-replace streaming.
| Return | Name | Description |
|---|---|---|
Connection::Ptr | connection | HTTP connection for sending the initial response header. |
std::string | contentType | Content-Type of each part (e.g. "image/jpeg"). |
bool | isBase64 | If true, adds "Content-Transfer-Encoding: base64" to each part. |
bool | initial | True until the first chunk is processed and the boundary header emitted. |
PacketSignal | emitter |
Connection::Ptr connectionHTTP connection for sending the initial response header.
std::string contentTypeContent-Type of each part (e.g. "image/jpeg").
bool isBase64If true, adds "Content-Transfer-Encoding: base64" to each part.
bool initialTrue until the first chunk is processed and the boundary header emitted.
PacketSignal emitter| Return | Name | Description |
|---|---|---|
MultipartAdapter inline | Creates a MultipartAdapter that sends headers through the given connection. The per-part content type is read from the connection's outgoing header. | |
MultipartAdapter inline | Creates a MultipartAdapter that emits its own raw HTTP/1.1 200 response header. Use this when no Connection object is available. | |
void | emitHeader virtual inline | Emits the initial HTTP/1.1 200 OK response with Content-Type multipart/x-mixed-replace. If a connection is set, headers are written through it; otherwise a raw response string is emitted. |
void | emitChunkHeader virtual inline | Emits the MIME boundary and per-part headers (Content-Type, optionally Content-Transfer-Encoding) for the next multipart chunk. |
void | process virtual inline | Wraps the incoming packet as a multipart chunk and emits it downstream. Emits the multipart HTTP response headers on the first call. |
inline
inline MultipartAdapter(Connection::Ptr connection, bool base64)Creates a MultipartAdapter that sends headers through the given connection. The per-part content type is read from the connection's outgoing header.
connection HTTP connection to use for sending the initial multipart header.
[base64](icy-base64.html#base64) If true, indicates parts are base64-encoded.
inline
inline MultipartAdapter(const std::string & contentType, bool base64)Creates a MultipartAdapter that emits its own raw HTTP/1.1 200 response header. Use this when no Connection object is available.
contentType Content-Type for each multipart part.
[base64](icy-base64.html#base64) If true, indicates parts are base64-encoded.
virtual inline
virtual inline void emitHeader()Emits the initial HTTP/1.1 200 OK response with Content-Type multipart/x-mixed-replace. If a connection is set, headers are written through it; otherwise a raw response string is emitted.
virtual inline
virtual inline void emitChunkHeader()Emits the MIME boundary and per-part headers (Content-Type, optionally Content-Transfer-Encoding) for the next multipart chunk.
virtual inline
virtual inline void process(IPacket & packet)Wraps the incoming packet as a multipart chunk and emits it downstream. Emits the multipart HTTP response headers on the first call.
packet Packet containing the raw payload data.