bryancall commented on code in PR #11975:
URL: https://github.com/apache/trafficserver/pull/11975#discussion_r1968456992


##########
plugins/compress/compress.cc:
##########
@@ -76,6 +77,57 @@ static TSMutex compress_config_mutex = nullptr;
 Configuration *cur_config  = nullptr;
 Configuration *prev_config = nullptr;
 
+namespace
+{
+/**
+  If client request has both of Range and Accept-Encoding header, follow 
range-request config.
+ */
+void
+handle_range_request(TSMBuffer req_buf, TSMLoc req_loc, HostConfiguration *hc)
+{
+  TSMLoc accept_encoding_hdr_field =
+    TSMimeHdrFieldFind(req_buf, req_loc, TS_MIME_FIELD_ACCEPT_ENCODING, 
TS_MIME_LEN_ACCEPT_ENCODING);
+  if (accept_encoding_hdr_field == TS_NULL_MLOC) {
+    return;
+  }
+
+  TSMLoc range_hdr_field = TSMimeHdrFieldFind(req_buf, req_loc, 
TS_MIME_FIELD_RANGE, TS_MIME_LEN_RANGE);
+  if (range_hdr_field == TS_NULL_MLOC) {
+    return;

Review Comment:
   don't you need to release the accept_encoding_hdr_field before returning?



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