This commit is contained in:
J. Nick Koston
2025-12-27 17:49:25 -10:00
parent f9659fc693
commit d404e37449
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -187,9 +187,9 @@ class APIFrameHelper {
std::vector<struct iovec> reusable_iovs_;
std::vector<uint8_t> rx_buf_;
// Pointer to client info (4 bytes on 32-bit)
// Note: The pointed-to ClientInfo object must outlive this APIFrameHelper instance.
const ClientInfo *client_info_{nullptr};
// Pointer to client name buffer (4 bytes on 32-bit)
// Note: The pointed-to buffer must outlive this APIFrameHelper instance.
const char *client_name_{nullptr};
// Group smaller types together
uint16_t rx_buf_len_ = 0;
@@ -7,8 +7,8 @@ namespace esphome::api {
class APIPlaintextFrameHelper final : public APIFrameHelper {
public:
APIPlaintextFrameHelper(std::unique_ptr<socket::Socket> socket, const ClientInfo *client_info)
: APIFrameHelper(std::move(socket), client_info) {
APIPlaintextFrameHelper(std::unique_ptr<socket::Socket> socket, const char *client_name)
: APIFrameHelper(std::move(socket), client_name) {
// Plaintext header structure (worst case):
// Pos 0: indicator (0x00)
// Pos 1-3: payload size varint (up to 3 bytes)