-
Notifications
You must be signed in to change notification settings - Fork 849
TS-4624: use the server UUID in the Via header #804
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
Conversation
|
Almost, but not quite. :) All APIs that are prefixed TS are the public APIs, and we don't use those in the internal code. Look at the log tags in logging that uses the internal APIs for the UUID. E.g. Makes sense? |
|
Don't quite understand why public API can't be used in internal code, but ok, changed code to |
|
It's an inefficiency for starters (you go through a C-> C++ wrapper layer, for no good reason (remember, the public APIs are all C, whereas in the core, you can use all the C++ objects and methods directly). In this case, it's marginal, but there are other places where it would be inefficient. And, it would add dependencies to the C-APIs in the C++ core which are undesirable in some cases. |
proxy/http/HttpTransactHeaders.cc
Outdated
| */ | ||
| memcpy(via_string, Machine::instance()->ip_hex_string, Machine::instance()->ip_hex_string_len); | ||
| via_string += Machine::instance()->ip_hex_string_len; | ||
| if (uuid != NULL) { |
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 don't think the machine uuid can ever be NULL, but harmless to check I guess :).
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.
Reinsurance :) Shoul I delete this check?
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 nuke it IMO. The Machine UUID is guaranteed to be initiated on startup.
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.
done :)
|
[approve ci] |
|
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/439/ for details. |
|
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/333/ for details. |
|
Thanks for explaining about API usage |
|
[approve ci] |
|
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/441/ for details. |
|
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/335/ for details. |
|
I suspect this failed for other reasons, trying again [approve ci]. |
|
I checked the core on this FreeBSD build, and it seems completely unrelated to pretty much anything :). |
|
@yatsukhnenko What do you think of a future feature (config) to disable this Via checking completely? If I know there's not chance of a loop, why bother checking the Via header? I guess one could just nuke the Via header on the incoming request, but there might be other reasons to keep it? This is completely unrelated to this PR though, just thinking out loud. |
|
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/443/ for details. |
|
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/337/ for details. |
|
Did a quick test of this, and it looks good: |
@zwoop, makes sense. Should I create new jira for this? |
|
Yeah, file a Jira probably. I could have sworn we've had issues before where loop detection kicked in when it shouldn't (e.g. you legitimately proxy to yourself). But I can find an issue on it, maybe you can take a look too. |
|
This one? |
…t variable (apache#9594) (apache#804) Conflicts: doc/admin-guide/files/sni.yaml.en.rst iocore/net/P_SNIActionPerformer.h tests/gold_tests/tls/tls_tunnel.test.py Co-authored-by: Zhengxi Li <zli11@yahooinc.com>
If I correctly understood the task 😃