This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.1.x by this push:
     new c06ef87  Fix the final consumer write size from unchunked to chunked 
tunnel (#7577)
c06ef87 is described below

commit c06ef871e7a23cf6877416690a164c17ab5a0909
Author: Susan Hinrichs <[email protected]>
AuthorDate: Mon Mar 8 22:28:12 2021 -0600

    Fix the final consumer write size from unchunked to chunked tunnel (#7577)
    
    (cherry picked from commit 8977a45054302b37bcc0d0a1cca3ad2dae98df6a)
---
 proxy/http/HttpTunnel.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index b08a25e..49a2530 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1001,16 +1001,18 @@ HttpTunnel::producer_handler_dechunked(int event, 
HttpTunnelProducer *p)
 
   // We only interested in translating certain events
   switch (event) {
-  case VC_EVENT_READ_READY:
   case VC_EVENT_READ_COMPLETE:
   case HTTP_TUNNEL_EVENT_PRECOMPLETE:
   case VC_EVENT_EOS:
+    p->alive = false; // Update the producer state for 
final_consumer_bytes_to_write
+    /* fallthrough */
+  case VC_EVENT_READ_READY:
     p->last_event = p->chunked_handler.last_server_event = event;
     if (p->chunked_handler.generate_chunked_content()) { // We are done, make 
sure the consumer is activated
       HttpTunnelConsumer *c;
       for (c = p->consumer_list.head; c; c = c->link.next) {
         if (c->alive) {
-          c->write_vio->nbytes = p->chunked_handler.chunked_size;
+          c->write_vio->nbytes = final_consumer_bytes_to_write(p, c);
           // consumer_handler(VC_EVENT_WRITE_COMPLETE, c);
         }
       }

Reply via email to