Skip to content

Conversation

@bryancall
Copy link
Contributor

0 byte values. Allowing do_io_read and do_io_write to not warn on closed
connection when we are only trying to disable the reads and writes for it.
Removed some macros that were used in a few places (not all the time) and
a couple that were not used at all.

0 byte values.  Allowing do_io_read and do_io_write to not warn on closed
connection when we are only trying to disable the reads and writes for it.
Removed some macros that were used in a few places (not all the time) and
a couple that were not used at all.
@SolidWallOfCode
Copy link
Member

I've been thinking about this and wonder if we should avoid this and have an explicit disable_io_read and disable_io_write instead.

@atsci
Copy link

atsci commented Aug 12, 2016

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/523/ for details.

@atsci
Copy link

atsci commented Aug 12, 2016

Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/420/ for details.

@zwoop zwoop added the Core label Aug 12, 2016
@zwoop zwoop added this to the 7.0.0 milestone Aug 12, 2016
VIO *
UnixNetVConnection::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf)
{
ink_assert(c || 0 == nbytes);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this assert after the new check and add an equivalent one to do_io_write?

@shinrich
Copy link
Member

Looks good. Having an explicit disable_io_read/write might be nice. But using NULL's to clear out the current io's does't seem too surprising.

@bryancall
Copy link
Contributor Author

bryancall commented Aug 12, 2016

Yeah, I started down the path of disable_read() and disable_write(), then ran into having to implement the methods in multiple locations (pluginvc) when declaring them pure virtual.

I might switch back to disable_read() and disable_write()...

@bryancall
Copy link
Contributor Author

I am going to go with this right now and open a bug for disable_read() and disable_write()

@bryancall bryancall merged commit 30bac3c into apache:master Sep 12, 2016
bneradt added a commit to bneradt/trafficserver that referenced this pull request Jul 12, 2024
Revert "Give a chance to send a response before receiving next request on H2 (apache#9997)"

This reverts commit 62abe06.

I'm reverting this commit because it seems to introduce the crash seen in YTSATS-4273.
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request May 29, 2025
* Fix pipelined request for chunked bodies

This addresses a variety of bugs concerning pipelined requests. In
particular, the HttpTunnel logic had fundamentally assumed that it could
consume all bytes available in the producer's reader. If a request was
pipelined after a previous request that had a chunked body, this would
result in the second request being unparsed and either sent along to the
origin or dropped on the floor, depening on configuration. This adds an
explicit autest for pipelined requests and addresses these issues.

This patch largely does the following:

1. Updates the copy_partial_post_data data to take the number of bytes
   it consumes rather than consuming all bytes in the reader. It also
   now returns the number of bytes it consumes, which the tunnel needs
   to keep track of the number of bytes it processes.
2. Previous to this patch, the HttpTunnel assumed that it could consume
   all bytes in the reader originally passed to it (all bytes in
   init_bytes_done). This simply will not work for pipelined requests.
   This addresses this issue by adding a new variable to the tunnel:
   bytes_consumed. This way the tunnel can keep track of how many bytes
   it consumed while processing the request body, which allows the
   HttpSM to later process just the right number of bytes from its
   reader rather than eating into any pipelined requests that follow it.
3. The HttpSM must not consume bytes from its client reader that are
   pipelined requests. It now uses the tunnel's processing
   bytes_consumed to process bytes from its reader rather than simply
   consuming all read_available() bytes from it.

* Fix bytes consumed chunk computation

Fix a possible miscalculation of bytes consumed while parsing chunked
content.

* Test verification updates.

---------

Co-authored-by: Brian Neradt <brian.neradt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants