leaf-potato commented on code in PR #2102:
URL: https://github.com/apache/brpc/pull/2102#discussion_r1096709051
##########
src/brpc/details/ssl_helper.cpp:
##########
@@ -833,6 +874,23 @@ void Print(std::ostream& os, X509* cert, const char* sep) {
os << butil::StringPiece(bufp, len);
}
+std::string ALPNProtocolToString(const AdaptiveProtocolType& protocol) {
+ std::string name = protocol.name();
+ // Default use http 1.1 version
+ if (name.compare(0, 4, "http") == 0) {
+ name = "http/1.1";
+ }
+
+ // ALPN extension uses 1 byte to record the protocol length
+ // and it's maximum length is 255.
+ if (name.size() > CHAR_MAX) {
+ name = name.substr(0, CHAR_MAX);
+ }
+
+ char lenght = static_cast<char>(name.size());
Review Comment:
done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]