You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "JosiahWI (via GitHub)" <gi...@apache.org> on 2026/07/23 13:53:00 UTC
[PR] Document HTTP methods for #13420 review [trafficserver]
JosiahWI opened a new pull request, #13422:
URL: https://github.com/apache/trafficserver/pull/13422
This adds doxygen comments for `HTTPHdr::length_get` and `HttpHDR::parse_req`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3638682860
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +630,72 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /**
+ * Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param parser Parser state. Must be the same object on each call for a given message.
+ * @param start [in,out] On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param end One past the last available byte of input.
+ * @param eof @c true if no more data will follow @p end.
+ * @param strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
+ *
Review Comment:
Doxygen in this header typically references parameters in prose with `@a <name>` (e.g., the existing `url_string_get` comment uses `@a length`), but this new comment uses `@p parser`/`@p r`. Also, the parameter direction markers are currently embedded in the description (`@param start [in,out] ...`) rather than using Doxygen’s `@param[in,out]` form, which is used elsewhere under `include/proxy/hdrs/` (e.g., `URL.h`, `XPACK.h`). Updating these improves consistency and Doxygen rendering.
This issue also appears on line 670 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3639569047
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -496,6 +496,20 @@ class HTTPHdr : public MIMEHdr
int print(char *buf, int bufsize, int *bufindex, int *dumpoffset) const;
+ /**
+ * Returns the serialized byte length of the HTTP header.
+ *
Review Comment:
I think we're supposed to keep the first line with the `/**` line. See line 456 in this file, for example. At least this is what Allen taught me. :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#issuecomment-5061661004
[approve ci autest 1]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3639577569
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +630,72 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /**
+ * Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param parser Parser state. Must be the same object on each call for a given message.
+ * @param start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param end One past the last available byte of input.
+ * @param eof @c true if no more data will follow @p end.
+ * @param strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param max_hdr_field_size Maximum byte length of a single header field; exceeding it
Review Comment:
We should include `[in]`, `[out]`, `[in,out]` in with these `@param` specifications. I believe AGENTS.md is updated to give that instruction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3640057658
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +633,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in,out] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in,out] start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param[in] end One past the last available byte of input.
+ * @param[in] eof @c true if no more data will follow @p end.
+ * @param[in] strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param[in] max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param[in] max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
Review Comment:
The documentation for `max_hdr_field_size` implies it limits the serialized size of a header field, but the parser actually checks `field-name.size() + field-value.size()` (excluding the `: ` separator and CRLF). Clarifying this avoids misleading callers about what the limit means.
This issue also appears on line 686 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3639794514
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +629,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
Review Comment:
in,out
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -496,6 +496,19 @@ class HTTPHdr : public MIMEHdr
int print(char *buf, int bufsize, int *bufindex, int *dumpoffset) const;
+ /** Returns the serialized byte length of the HTTP header.
+ *
+ * The count includes the request-line (for requests) or status-line (for
+ * responses), all header fields, and the terminating blank line. The message
+ * body is not included.
Review Comment:
Does this also include `@` headers? I think so. It's probably good to explicitly call those out since those aren't actually serialized, at least not to the wire.
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +629,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in,out] start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param[in] end One past the last available byte of input.
+ * @param[in] eof @c true if no more data will follow @p end.
+ * @param[in] strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param[in] max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param[in] max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
+ *
+ * @return @c ParseResult::DONE if a complete valid request header has been parsed;
+ * @c ParseResult::CONT if more data is required;
+ * @c ParseResult::ERROR on a protocol error or exceeded limit.
+ *
+ * @pre The header must be initialized with @c HTTPType::REQUEST polarity.
+ *
+ * @par Thread Safety
+ * Not thread-safe.
+ */
ParseResult parse_req(HTTPParser *parser, const char **start, const char *end, bool eof, int strict_uri_parsing = 0,
size_t max_request_line_size = UINT16_MAX, size_t max_hdr_field_size = 131070);
ParseResult parse_resp(HTTPParser *parser, const char **start, const char *end, bool eof);
+ /** Parse an HTTP/1.x request header incrementally from an @c IOBufferReader.
+ *
+ * Reads and consumes data from @p r, parsing it into the header's request fields. Call
+ * repeatedly with the same @p parser until a result other than @c ParseResult::CONT is
+ * returned. When @c ParseResult::DONE is returned, the request method, URL, version, and
+ * header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in] r Source of input data; bytes consumed by the parser are removed from
+ * the reader.
+ * @param[in,out] bytes_used Must be non-null; set to the number of bytes consumed from @p r.
Review Comment:
`[out]`
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +629,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in,out] start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param[in] end One past the last available byte of input.
+ * @param[in] eof @c true if no more data will follow @p end.
+ * @param[in] strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param[in] max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param[in] max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
+ *
+ * @return @c ParseResult::DONE if a complete valid request header has been parsed;
+ * @c ParseResult::CONT if more data is required;
+ * @c ParseResult::ERROR on a protocol error or exceeded limit.
+ *
+ * @pre The header must be initialized with @c HTTPType::REQUEST polarity.
+ *
+ * @par Thread Safety
+ * Not thread-safe.
+ */
ParseResult parse_req(HTTPParser *parser, const char **start, const char *end, bool eof, int strict_uri_parsing = 0,
size_t max_request_line_size = UINT16_MAX, size_t max_hdr_field_size = 131070);
ParseResult parse_resp(HTTPParser *parser, const char **start, const char *end, bool eof);
+ /** Parse an HTTP/1.x request header incrementally from an @c IOBufferReader.
+ *
+ * Reads and consumes data from @p r, parsing it into the header's request fields. Call
+ * repeatedly with the same @p parser until a result other than @c ParseResult::CONT is
+ * returned. When @c ParseResult::DONE is returned, the request method, URL, version, and
+ * header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
Review Comment:
in,out
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3640262375
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +633,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in,out] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in,out] start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param[in] end One past the last available byte of input.
+ * @param[in] eof @c true if no more data will follow @p end.
+ * @param[in] strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param[in] max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param[in] max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
Review Comment:
This would be an improvement, but I don't think it's enough of one to run CI again. Also, you can't just delete the doc for `max_request_line_size` out of nowhere.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3639713707
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +629,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param parser[in] Parser state. Must be the same object on each call for a given message.
+ * @param start[in,out] On entry, points to the first unparsed byte; on return,
Review Comment:
`[in]`, etc. goes with `@param`:
`@param[in]`, `@param[in,out]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI merged PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3638956612
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +630,72 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /**
+ * Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param parser Parser state. Must be the same object on each call for a given message.
+ * @param start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param end One past the last available byte of input.
+ * @param eof @c true if no more data will follow @p end.
+ * @param strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
+ *
+ * @return @c ParseResult::DONE if a complete valid request header has been parsed;
+ * @c ParseResult::CONT if more data is required;
+ * @c ParseResult::ERROR on a protocol error or exceeded limit.
+ *
+ * @pre The header must be initialized with @c HTTPType::REQUEST polarity.
+ *
+ * @par Thread Safety
+ * Not thread-safe.
+ */
ParseResult parse_req(HTTPParser *parser, const char **start, const char *end, bool eof, int strict_uri_parsing = 0,
size_t max_request_line_size = UINT16_MAX, size_t max_hdr_field_size = 131070);
ParseResult parse_resp(HTTPParser *parser, const char **start, const char *end, bool eof);
+ /**
+ * Parse an HTTP/1.x request header incrementally from an @c IOBufferReader.
+ *
+ * Reads and consumes data from @p r, parsing it into the header's request fields. Call
+ * repeatedly with the same @p parser until a result other than @c ParseResult::CONT is
+ * returned. When @c ParseResult::DONE is returned, the request method, URL, version, and
+ * header fields are set on this header.
+ *
+ * @param parser Parser state. Must be the same object on each call for a given message.
+ * @param r Source of input data; bytes consumed by the parser are removed from
+ * the reader.
+ * @param bytes_used Set to the number of bytes consumed from @p r.
+ * @param eof @c true if no more data will be provided after what is currently
Review Comment:
`parse_req(HTTPParser*, IOBufferReader*, int*, ...)` dereferences `bytes_used` unconditionally (`*bytes_used = 0;`), so the Doxygen should state that `bytes_used` must be non-null. As written, callers may assume they can pass `nullptr` to ignore this output, which would crash.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Document `HTTPHdr` methods for #13420 review [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #13422:
URL: https://github.com/apache/trafficserver/pull/13422#discussion_r3639917565
##########
include/proxy/hdrs/HTTP.h:
##########
@@ -616,10 +629,70 @@ class HTTPHdr : public MIMEHdr
void mark_early_data(bool flag = true) const;
bool is_early_data() const;
+ /** Parse an HTTP/1.x request header incrementally from a raw buffer.
+ *
+ * Parses input data into the header's request fields. Call repeatedly with the same @p parser
+ * until a result other than @c ParseResult::CONT is returned. When @c ParseResult::DONE is
+ * returned, the request method, URL, version, and header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in,out] start On entry, points to the first unparsed byte; on return,
+ * advanced past all consumed bytes.
+ * @param[in] end One past the last available byte of input.
+ * @param[in] eof @c true if no more data will follow @p end.
+ * @param[in] strict_uri_parsing URI compliance level: @c 0 performs no compliance check; @c 1 rejects
+ * the URI unless every character is a valid RFC 3986 URI character; @c 2
+ * is more permissive, rejecting the URI only if it contains whitespace or
+ * non-printable characters. Other values behave like @c 0.
+ * @param[in] max_request_line_size Maximum byte length of the request line; exceeding it returns
+ * @c ParseResult::ERROR.
+ * @param[in] max_hdr_field_size Maximum byte length of a single header field; exceeding it
+ * returns @c ParseResult::ERROR.
+ *
+ * @return @c ParseResult::DONE if a complete valid request header has been parsed;
+ * @c ParseResult::CONT if more data is required;
+ * @c ParseResult::ERROR on a protocol error or exceeded limit.
+ *
+ * @pre The header must be initialized with @c HTTPType::REQUEST polarity.
+ *
+ * @par Thread Safety
+ * Not thread-safe.
+ */
ParseResult parse_req(HTTPParser *parser, const char **start, const char *end, bool eof, int strict_uri_parsing = 0,
size_t max_request_line_size = UINT16_MAX, size_t max_hdr_field_size = 131070);
ParseResult parse_resp(HTTPParser *parser, const char **start, const char *end, bool eof);
+ /** Parse an HTTP/1.x request header incrementally from an @c IOBufferReader.
+ *
+ * Reads and consumes data from @p r, parsing it into the header's request fields. Call
+ * repeatedly with the same @p parser until a result other than @c ParseResult::CONT is
+ * returned. When @c ParseResult::DONE is returned, the request method, URL, version, and
+ * header fields are set on this header.
+ *
+ * @param[in] parser Parser state. Must be the same object on each call for a given message.
+ * @param[in] r Source of input data; bytes consumed by the parser are removed from
+ * the reader.
+ * @param[in,out] bytes_used Must be non-null; set to the number of bytes consumed from @p r.
Review Comment:
The review tool shows the four previous lines it looks like in the view - this just refers to the `bytes_used` param.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org