bneradt commented on PR #13363:
URL: https://github.com/apache/trafficserver/pull/13363#issuecomment-5123595210

   > > when a buffer reader has more bytes available than should be sent on the 
stream
   > 
   > I wonder how that happens. Isn't that the root cause that needs to be 
fixed? The change on this PR look fine as a bandaid fix though. I'm not going 
to push this back, but want to confirm if I understand the issue correctly.
   
   Thanks for asking. The original wording made this sound like an unexpected 
buffer state, so I updated the commit message and PR description to clarify it.
   IOBufferReader::read_avail() is not the boundary of a write operation. 
do_io_write() receives both a reader and a byte count, and VIO::ntodo() is the 
authoritative number of bytes the VConnection may consume. The reader can 
legitimately expose more buffered data than remains in that finite VIO. The 
ordinary network VConnection already caps writes this way.
   The H2 DATA sender was missing that contract enforcement. In the regression 
case, ATS sent 327,675 bytes for a 300,000-byte PUT, causing the H2 origin to 
return GOAWAY with PROTOCOL_ERROR. Therefore, limiting the DATA payload by 
ntodo() is the root fix rather than a band-aid.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to