Skip to content

Commit

Permalink
Tweak QUIC protocol stack support to include TLS. (apache#7967)
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode authored Jul 12, 2021
1 parent eb793c6 commit 1b2b7b7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions iocore/net/QUICNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,10 @@ QUICNetVConnection::populate_protocol(std::string_view *results, int n) const
if (n > retval) {
results[retval++] = IP_PROTO_TAG_QUIC;
if (n > retval) {
retval += super::populate_protocol(results + retval, n - retval);
results[retval++] = IP_PROTO_TAG_TLS_1_3;
if (n > retval) {
retval += super::populate_protocol(results + retval, n - retval);
}
}
}
return retval;
Expand All @@ -1052,10 +1055,12 @@ QUICNetVConnection::populate_protocol(std::string_view *results, int n) const
const char *
QUICNetVConnection::protocol_contains(std::string_view prefix) const
{
const char *retval = nullptr;
std::string_view tag = IP_PROTO_TAG_QUIC;
if (prefix.size() <= tag.size() && strncmp(tag.data(), prefix.data(), prefix.size()) == 0) {
retval = tag.data();
const char *retval = nullptr;
if (prefix.size() <= IP_PROTO_TAG_QUIC.size() && strncmp(IP_PROTO_TAG_QUIC.data(), prefix.data(), prefix.size()) == 0) {
retval = IP_PROTO_TAG_QUIC.data();
} else if (prefix.size() <= IP_PROTO_TAG_TLS_1_3.size() &&
strncmp(IP_PROTO_TAG_TLS_1_3.data(), prefix.data(), prefix.size()) == 0) {
retval = IP_PROTO_TAG_TLS_1_3.data();
} else {
retval = super::protocol_contains(prefix);
}
Expand Down

0 comments on commit 1b2b7b7

Please sign in to comment.