Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: net/socket/ssl_client_socket.cc

Issue 8787011: Log server advertised protos and the selected (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket.cc
===================================================================
--- net/socket/ssl_client_socket.cc (revision 112817)
+++ net/socket/ssl_client_socket.cc (working copy)
@@ -1,9 +1,11 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/socket/ssl_client_socket.h"
+#include "base/string_util.h"
+
namespace net {
SSLClientSocket::SSLClientSocket()
@@ -24,6 +26,35 @@
}
}
+// static
+const char* SSLClientSocket::NextProtoStatusToString(
+ const SSLClientSocket::NextProtoStatus status) {
+ switch (status) {
+ case kNextProtoUnsupported:
+ return "unsupported";
+ case kNextProtoNegotiated:
+ return "negotiated";
+ case kNextProtoNoOverlap:
+ return "no-overlap";
+ }
+ return NULL;
+}
+
+// static
+std::string SSLClientSocket::ServerProtosToString(
+ const std::string& server_protos) {
+ const char* protos = server_protos.c_str();
+ size_t protos_len = server_protos.length();
+ std::vector<std::string> server_protos_with_commas;
+ for (size_t i = 0; i < protos_len; ) {
+ const size_t len = protos[i];
+ std::string proto_str(&protos[i + 1], len);
+ server_protos_with_commas.push_back(proto_str);
+ i += len + 1;
+ }
+ return JoinString(server_protos_with_commas, ',');
+}
+
bool SSLClientSocket::IgnoreCertError(int error, int load_flags) {
if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS)
return true;
« no previous file with comments | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698