masaori335 commented on code in PR #12906:
URL: https://github.com/apache/trafficserver/pull/12906#discussion_r2870071986


##########
src/proxy/http/HttpSM.cc:
##########
@@ -6608,8 +6591,16 @@ HttpSM::perform_cache_write_action()
     if (transform_info.entry == nullptr || 
t_state.api_info.cache_untransformed == true) {
       cache_sm.close_read();
       t_state.cache_info.write_status = 
HttpTransact::CacheWriteStatus_t::IN_PROGRESS;
-      setup_cache_write_transfer(&cache_sm, server_entry->vc, 
&t_state.cache_info.object_store, client_response_hdr_bytes,
-                                 "cache write");
+
+      // Decide how many header bytes the cache-write consumer should skip.
+      // When a transform is present, setup_server_transfer_to_transform()
+      // creates the tunnel buffer with hdr_size=0, so the buffer contains
+      // only body data - no response headers to skip.  When no transform is
+      // present, setup_server_transfer() writes the response header into the
+      // buffer, so skip_bytes must equal client_response_hdr_bytes.
+      int64_t cache_write_skip = (transform_info.entry == nullptr) ? 
client_response_hdr_bytes : 0;

Review Comment:
   Review note: `transform_info.entry` is set by 
`HttpSM::do_post_transform_open()` or `HttpSM::do_transform_open()`.



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