masaori335 commented on a change in pull request #7629:
URL: https://github.com/apache/trafficserver/pull/7629#discussion_r647030736



##########
File path: iocore/cache/CacheWrite.cc
##########
@@ -98,6 +98,30 @@ CacheVC::updateVector(int /* event ATS_UNUSED */, Event * /* 
e ATS_UNUSED */)
       if (od->move_resident_alt && get_alternate_index(write_vector, 
od->single_doc_key) == 0) {
         od->move_resident_alt = false;
       }
+      if (cache_config_log_alternate_eviction) {
+        CacheHTTPInfo *info = write_vector->get(0);
+        HTTPHdr *request    = info->request_get();
+        if (request->valid()) {
+          // In contrast to url_string_get, this url_print interface doesn't
+          // use HTTPHdr's m_heap which is not valid at this point because the
+          // HttpSM is most likely gone.
+          int url_length = request->url_printed_length();
+          ats_scoped_mem<char> url_text;
+          url_text   = static_cast<char *>(ats_malloc(url_length + 1));

Review comment:
       FWIW, `ts::LocalBuffer` is faster when url length is small by avoiding 
using heap.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to