SolidWallOfCode commented on a change in pull request #7476:
URL: https://github.com/apache/trafficserver/pull/7476#discussion_r569547848
##########
File path: proxy/http/HttpTransact.cc
##########
@@ -5005,31 +5002,20 @@
HttpTransact::merge_response_header_with_cached_header(HTTPHdr *cached_header, H
// the remaining fields one by one from the
// response header
//
- if (field->m_next_dup) {
+ if (field.m_next_dup) {
if (dups_seen == false) {
- MIMEField *dfield;
// use a second iterator to delete the
// remaining response headers in the cached response,
// so that they will be added in the next iterations.
- MIMEFieldIter fiter2 = fiter;
- const char *dname = name;
- int dlen = name_len;
-
- while (dname) {
- cached_header->field_delete(dname, dlen);
- dfield = response_header->iter_get_next(&fiter2);
- if (dfield) {
- dname = dfield->name_get(&dlen);
- } else {
- dname = nullptr;
- }
+ for (auto spot2 = spot; spot2 != limit; ++spot2) {
+ cached_header->field_delete(&*spot2, true);
Review comment:
Not completely sure about this change - is it faster to delete via the
dup chain, or continue on the iteration over all of the remaining headers?
----------------------------------------------------------------
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]