Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3252

Don't chunk response body if transform_response_cl is valid

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • 7.1.0
    • Core, HTTP

    Description

      The way as I see, the client will get chunked response from ATS if the origin server issues a chunked response to ATS.

      I am wondering whether this can be changed if there is a transfrom plugin exists and the transform can insure transform_response_cl is valid. This can be done by TSVConnWrite(...) with a valid nbytes(not INT64_MAX) in transform handler.

      Here is an example, I want to response "abcdefg" in transform handler, no matter what is received from upstream, and I can write code like this in plugin:

      static int transform_handler(...)
      {
      	...
      	output.buffer = TSIOBufferCreate();
      	output.reader = TSIOBufferReaderAlloc(output.buffer);
      	output.vio = TSVConnWrite(output_conn, contp, output.reader, sizeof("abcdefg")-1);
      
      	TSIOBufferWrite(output.buffer, "abcdefg", sizeof("abcdefg")-1);
      
      	TSVIOReenable(output.vio);
      
      	...
      }
      

      However, the response body to the client will be chunked if ATS got chunked response from origin server. Maybe we can change this by refining the function HttpTransact::handle_response_keep_alive_headers(...)

      Attachments

        Issue Links

          Activity

            People

              amc Alan M. Carroll
              portl4t portl4t
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: