mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 18:37:47 +00:00
fixes
This commit is contained in:
parent
f57e26c54e
commit
15a995b2e7
@ -13,7 +13,6 @@ static const char *const TAG = "multipart_parser";
|
||||
static constexpr size_t CRLF_LENGTH = 2;
|
||||
static constexpr size_t MIN_BOUNDARY_BUFFER = 4; // Extra bytes to keep for split boundary detection
|
||||
static constexpr const char *CRLF_STR = "\r\n";
|
||||
static constexpr const char *DOUBLE_DASH = "--";
|
||||
|
||||
bool MultipartParser::parse(const uint8_t *data, size_t len) {
|
||||
// Append new data to buffer
|
||||
|
@ -12,6 +12,8 @@ namespace web_server_idf {
|
||||
// Multipart form data parser for ESP-IDF
|
||||
class MultipartParser {
|
||||
public:
|
||||
static constexpr const char *MULTIPART_BOUNDARY_PREFIX = "--";
|
||||
|
||||
enum State : uint8_t { BOUNDARY_SEARCH, HEADERS, CONTENT, DONE, ERROR };
|
||||
|
||||
struct Part {
|
||||
@ -23,7 +25,7 @@ class MultipartParser {
|
||||
};
|
||||
|
||||
explicit MultipartParser(const std::string &boundary)
|
||||
: boundary_("--" + boundary),
|
||||
: boundary_(MULTIPART_BOUNDARY_PREFIX + boundary),
|
||||
state_(BOUNDARY_SEARCH),
|
||||
content_start_(0),
|
||||
content_length_(0),
|
||||
|
Loading…
x
Reference in New Issue
Block a user