You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "masaori335 (via GitHub)" <gi...@apache.org> on 2024/07/05 00:33:04 UTC
Re: [PR] multiplexer: fix consume of too many bytes [trafficserver]
masaori335 commented on code in PR #11499:
URL: https://github.com/apache/trafficserver/pull/11499#discussion_r1666123935
##########
src/iocore/eventsystem/P_IOBuffer.h:
##########
@@ -551,6 +551,7 @@ IOBufferReader::is_read_avail_more_than(int64_t size)
TS_INLINE void
IOBufferReader::consume(int64_t n)
{
+ ink_assert(read_avail() >= n);
Review Comment:
It looks like this function should handle this case, a). handle it as error case or b). consume only `read_avail()`. This assertion is a good start 👍
--
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