mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
HttpParser: Change Execute() to return StringRef (#1209)
This is more user-friendly than returning the number of parsed bytes.
This commit is contained in:
@@ -48,10 +48,11 @@ class HttpParser {
|
||||
/**
|
||||
* Executes the parser. An empty input is treated as EOF.
|
||||
* @param in input data
|
||||
* @return Number of parsed bytes.
|
||||
* @return Trailing input data after the parse.
|
||||
*/
|
||||
size_t Execute(StringRef in) {
|
||||
return http_parser_execute(&m_parser, &m_settings, in.data(), in.size());
|
||||
StringRef Execute(StringRef in) {
|
||||
return in.drop_front(
|
||||
http_parser_execute(&m_parser, &m_settings, in.data(), in.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user