Skip to content
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

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

persiaAziz-zz
Copy link
Contributor

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.

@zwoop zwoop requested a review from vmamidi January 4, 2017 00:23
@zwoop zwoop added the HTTP label Jan 4, 2017
@zwoop zwoop added this to the 7.1.0 milestone Jan 4, 2017
@zwoop
Copy link
Contributor

zwoop commented Jan 4, 2017

[add to whitelist]

@atsci
Copy link

atsci commented Jan 4, 2017

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1291/ for details.

@atsci
Copy link

atsci commented Jan 4, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1184/ for details.

@zwoop zwoop modified the milestones: 7.1.0, 7.2.0 Jan 8, 2017
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);
Copy link
Member

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?

@SolidWallOfCode
Copy link
Member

After talking to @persiaAziz about this I think the best approach is to remove the file char const* argument and the varargs but check for internal_msg_buffer in build_response so it doesn't have to be passed around.

@atsci
Copy link

atsci commented Feb 9, 2017

FreeBSD build failed! See https://ci.trafficserver.apache.org/job/freebsd-github/1492/ for details.

@atsci
Copy link

atsci commented Feb 9, 2017

Linux build failed! See https://ci.trafficserver.apache.org/job/linux-github/1385/ for details.

@atsci
Copy link

atsci commented Feb 9, 2017

clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/56/ for details.

@persiaAziz-zz
Copy link
Contributor Author

persiaAziz-zz commented Feb 9, 2017

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

@SolidWallOfCode
Copy link
Member

You shouldn't need to change further methods. At worse, you could pass "%s", internal_msg_buffer as the arguments.

@persiaAziz-zz
Copy link
Contributor Author

@SolidWallOfCode please review

@atsci
Copy link

atsci commented Feb 28, 2017

FreeBSD build failed! See https://ci.trafficserver.apache.org/job/freebsd-github/1651/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1547/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/83/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

Intel CC build failed! See https://ci.trafficserver.apache.org/job/icc-github/84/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1652/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1548/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/215/ for details.

@atsci
Copy link

atsci commented Feb 28, 2017

clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/216/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1554/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/90/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/222/ for details.

if (s->txn_conf->parent_failures_update_hostdb) {
s->state_machine->do_hostdb_update_if_necessary();
}
s->state_machine->do_hostdb_update_if_necessary();
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

"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.",
Copy link
Member

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.

@atsci
Copy link

atsci commented Mar 1, 2017

FreeBSD build successful! See https://ci.trafficserver.apache.org/job/freebsd-github/1662/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

Linux build successful! See https://ci.trafficserver.apache.org/job/linux-github/1558/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

Intel CC build successful! See https://ci.trafficserver.apache.org/job/icc-github/94/ for details.

@atsci
Copy link

atsci commented Mar 1, 2017

clang-analyzer build successful! See https://ci.trafficserver.apache.org/job/clang-analyzer-github/226/ for details.

@atsci
Copy link

atsci commented Mar 14, 2017

@atsci
Copy link

atsci commented Mar 14, 2017

RAT check successful! https://ci.trafficserver.apache.org/job/RAT-github/74/

@atsci
Copy link

atsci commented Mar 14, 2017

@atsci
Copy link

atsci commented Mar 14, 2017

Intel CC build successful! https://ci.trafficserver.apache.org/job/icc-github/187/

@atsci
Copy link

atsci commented Mar 14, 2017

FreeBSD11 build successful! https://ci.trafficserver.apache.org/job/freebsd-github/1756/

@atsci
Copy link

atsci commented Mar 14, 2017

Linux build successful! https://ci.trafficserver.apache.org/job/linux-github/1650/

@atsci
Copy link

atsci commented Mar 14, 2017

clang-analyzer build successful! https://ci.trafficserver.apache.org/job/clang-analyzer-github/319/

@SolidWallOfCode SolidWallOfCode merged commit d6c2a82 into apache:master Mar 15, 2017
@zwoop zwoop modified the milestones: 7.2.0, 8.0.0 Apr 25, 2017
zwoop pushed a commit to zwoop/trafficserver that referenced this pull request Jul 17, 2018
This was introduced in

     apache#1299

But, the good news is that this has not been part of a release.
zwoop pushed a commit to zwoop/trafficserver that referenced this pull request Jul 18, 2018
This was introduced in

     apache#1299

But, the good news is that this has not been part of a release.
zwoop pushed a commit that referenced this pull request Jul 18, 2018
This was introduced in

     #1299

But, the good news is that this has not been part of a release.
zwoop pushed a commit that referenced this pull request Jul 31, 2018
This was introduced in

     #1299

But, the good news is that this has not been part of a release.

(cherry picked from commit 7acfcfb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants