oknet commented on PR #10965:
URL: https://github.com/apache/trafficserver/pull/10965#issuecomment-1879583678

   There are 2 types of transforms: `Post Transform` and `Response Transform`.
   
   The `Transform` read data from upstream and write data to downstream.
   
   As the writer of plugin, you can do it by InkAPI `TSVConnRead and 
`TSVConnWrite`.
   
   There is a parameter "nbytes" indicating the bytes to be read or written.
   
   The downstream of the last `Transform Plugin` is handled by the 
`TransformTerminus`.
   
   When the last `Transform Plugin` calling the InkAPI `TSVConnWrite` on the 
downsteam VC, 
   
   - the `TransformTerminus` will call back `TRANSFORM_READ_READY` with 
`nbytes` as `data` to the HttpSM, 
   - and the event handled by `HttpSM::state_request_wait_for_transform_read` 
or `HttpSM::state_response_wait_for_transform_read` per the type of transforms.
   
   For the `Response Transform`, if the 
`HttpSM::state_response_wait_for_transform_read` received 
`TRANSFORM_READ_READY` event with `INT64_MAX`, it tries to re-chunk the data 
from `TransformVC`.
   
   Please refer these 2 options `proxy.config.http.chunking_enabled` and 
`proxy.config.http.chunking.size` to enable the re-chunk feature.
   
   But the `HttpSM::state_request_wait_for_transform_read` does not accept 
`INT64_MAX`, because it directly fill the `nbytes` to the `Content-Length` 
header. 
   
   The `HttpTunnel` decode the chunked data If the POST payload is chunked, and 
then write de-chunked data into `TransformVC`. But the `HttpSM` does not 
re-chunk the data received from `TransformVC`, even `HttpTunnel` can do it. 
   
   This pull request is intended to serve `multiplexer plugin`, as `multiplexer 
plugin` does not change the length of the payload.
   
   In order to support widely scene, it is better to enable / implement the 
re-chunk feature for `Post Transform`.
   
   


-- 
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