![]() |
Bitcoin Core 32.1.0
P2P Digital Currency
|
#include <httpserver.h>
Public Member Functions | |
| std::optional< std::string > | FindFirst (std::string_view key) const |
| std::vector< std::string_view > | FindAll (std::string_view key) const |
| void | Write (std::string &&key, std::string &&value) |
| void | RemoveAll (std::string_view key) |
| bool | Read (util::LineReader &reader, bool write=true) |
| std::string | Stringify () const |
Private Attributes | |
| std::vector< std::pair< std::string, std::string > > | m_headers |
| Headers can have duplicate field names, so we use a vector of key-value pairs instead of a map. | |
| size_t | m_consumed {0} |
| Track total bytes consumed in Read() for limit checks. | |
Definition at line 91 of file httpserver.h.
| std::vector< std::string_view > HTTPHeaders::FindAll | ( | std::string_view | key | ) | const |
| [in] | key | The field-name of the header to search for |
Definition at line 275 of file httpserver.cpp.
| std::optional< std::string > HTTPHeaders::FindFirst | ( | std::string_view | key | ) | const |
| [in] | key | The field-name of the header to search for |
Definition at line 265 of file httpserver.cpp.
| bool HTTPHeaders::Read | ( | util::LineReader & | reader, |
| bool | write = true ) |
| [in] | reader | A LineReader instance initialized with the client's receive buffer. |
| [in] | write | Whether or not to write the parsed data to the object after validation. |
| on | exceeded read limit and on bad headers syntax (e.g. no ":" in a line) |
Definition at line 299 of file httpserver.cpp.
| void HTTPHeaders::RemoveAll | ( | std::string_view | key | ) |
| [in] | key | The field-name of the header to search for and delete |
Definition at line 291 of file httpserver.cpp.
| std::string HTTPHeaders::Stringify | ( | ) | const |
| void HTTPHeaders::Write | ( | std::string && | key, |
| std::string && | value ) |
|
private |
Track total bytes consumed in Read() for limit checks.
Definition at line 130 of file httpserver.h.
|
private |
Headers can have duplicate field names, so we use a vector of key-value pairs instead of a map.
https://httpwg.org/specs/rfc9110.html#rfc.section.5.2
Definition at line 127 of file httpserver.h.