-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS-2888: remove vararg and format parameters from build_error_resoponse #1299
Conversation
[add to whitelist] |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1291/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1184/ for details. |
s->reverse_proxy = false; | ||
goto done; | ||
} | ||
///////////////////////////////////////////////////////////////// | ||
// Check if remap plugin set HTTP return code and return body // | ||
///////////////////////////////////////////////////////////////// | ||
if (s->http_return_code != HTTP_STATUS_NONE) { | ||
build_error_response(s, s->http_return_code, nullptr, nullptr, s->internal_msg_buffer_size ? s->internal_msg_buffer : nullptr); | ||
build_error_response(s, s->http_return_code, nullptr, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to internal_msg_buffer
? Can that no longer be set?
After talking to @persiaAziz about this I think the best approach is to remove the file |
94e4a7b
to
6563ea8
Compare
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/freebsd-github/1492/ for details. |
Linux build failed! See https://ci.trafficserver.apache.org/job/linux-github/1385/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/56/ for details. |
hmm, we need to remove the usage of varargs from all subsequent methods if we pass the internal message buffer. Looking at the code and the fail output of regression test, we can not pass a valid buffer with va_list pointing to nullptr. The regression test above is failing because of that. We need to fix ink_bvsprintf first @SolidWallOfCode |
You shouldn't need to change further methods. At worse, you could pass |
6563ea8
to
0807f32
Compare
@SolidWallOfCode please review |
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/freebsd-github/1651/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1547/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/83/ for details. |
Intel CC build failed! See https://ci.trafficserver.apache.org/job/icc-github/84/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1652/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1548/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/215/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/216/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1554/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/90/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/222/ for details. |
proxy/http/HttpTransact.cc
Outdated
if (s->txn_conf->parent_failures_update_hostdb) { | ||
s->state_machine->do_hostdb_update_if_necessary(); | ||
} | ||
s->state_machine->do_hostdb_update_if_necessary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a bad merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it is, see #1464 merged about a week ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix that. Thanks for noticing
proxy/http/HttpTransact.cc
Outdated
"redirect#moved_temporarily", s, 8192, &s->internal_msg_buffer_size, body_language, sizeof(body_language), body_type, | ||
sizeof(body_type), "%s <a href=\"%s\">%s</a>. %s.", "The document you requested is now", new_url, new_url, | ||
"Please update your documents and bookmarks accordingly", NULL); | ||
s->internal_msg_buffer = body_factory->getFormat(8192, &s->internal_msg_buffer_size, "%s <a href=\"%s\">%s</a>. %s.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here that this is necessary because the template format doesn't have access to this computed URL and there is no current way to provide that.
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1662/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1558/ for details. |
Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/94/ for details. |
clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/226/ for details. |
clang format successful! https://ci.trafficserver.apache.org/job/clang-format-github/61/ |
RAT check successful! https://ci.trafficserver.apache.org/job/RAT-github/74/ |
AU check successful! https://ci.trafficserver.apache.org/job/autest-github/58/ |
Intel CC build successful! https://ci.trafficserver.apache.org/job/icc-github/187/ |
FreeBSD11 build successful! https://ci.trafficserver.apache.org/job/freebsd-github/1756/ |
Linux build successful! https://ci.trafficserver.apache.org/job/linux-github/1650/ |
clang-analyzer build successful! https://ci.trafficserver.apache.org/job/clang-analyzer-github/319/ |
This was introduced in apache#1299 But, the good news is that this has not been part of a release.
This was introduced in apache#1299 But, the good news is that this has not been part of a release.
This was introduced in #1299 But, the good news is that this has not been part of a release.
This removes vararg and the formatting parameter from build_error_response. However the underlying fabricate_with_old_api still needs to be cleaned up. Not sure if someone is already working on the cleaning.