ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
stream_head.h File Reference

Go to the source code of this file.

Data Structures

struct  esphome::web_server_base::HttpHeader
 
class  esphome::web_server_base::StallClock
 How long sends have made no progress. More...
 

Namespaces

namespace  esphome
 
namespace  esphome::web_server_base
 

Functions

void esphome::web_server_base::stream_memcpy (void *dst, const void *src, size_t len)
 
template<typename Iovec >
size_t esphome::web_server_base::iovecs_total (const Iovec *iov, int count)
 Bytes in a gather list.
 
template<typename Iovec >
void esphome::web_server_base::advance_iovecs (Iovec *&iov, int &count, size_t sent)
 Drops the first sent bytes from a gather list after a write; a short write resumes inside the element it stopped in.
 
constexpr size_t esphome::web_server_base::stream_head_iov_count (size_t header_count)
 Pieces in a head: 4 for the status line and Content-Type, 4 per header, the blank line and the body.
 
bool esphome::web_server_base::has_header (std::span< const HttpHeader > headers, const char *name)
 True if headers holds a header named name, compared case insensitively.
 
template<typename Iovec , typename Send >
bool esphome::web_server_base::write_stream_head (Send &&send, const char *status, const char *content_type, std::span< const HttpHeader > headers, std::span< const HttpHeader > default_headers, const char *body)
 Gathers the head of a stream response: "HTTP/1.1 <status>", Content-Type, headers, the default_headers that headers does not replace, the blank line and body (may be null).
 
template<typename Client , typename Iovec >
size_t esphome::web_server_base::add_iovecs (Client &client, const Iovec *iov, int count, char *scratch, size_t scratch_size)
 Queues a gather list on an AsyncClient-like client through scratch, so each add() carries up to scratch_size bytes (on LibreTiny every add() is a round trip into the tcpip thread).