| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_server_properties.h" | 5 #include "net/http/http_server_properties.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "net/socket/ssl_client_socket.h" | 10 #include "net/socket/ssl_client_socket.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 std::string AlternativeService::ToString() const { | 92 std::string AlternativeService::ToString() const { |
| 93 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol), | 93 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol), |
| 94 host.c_str(), port); | 94 host.c_str(), port); |
| 95 } | 95 } |
| 96 | 96 |
| 97 std::string AlternativeServiceInfo::ToString() const { | 97 std::string AlternativeServiceInfo::ToString() const { |
| 98 base::Time::Exploded exploded; | 98 base::Time::Exploded exploded; |
| 99 expiration.LocalExplode(&exploded); | 99 expiration.LocalExplode(&exploded); |
| 100 return base::StringPrintf( | 100 return base::StringPrintf("%s, p=%f, expires %04d-%02d-%02d %02d:%02d:%02d", |
| 101 "%s, expires %04d-%02d-%02d %02d:%02d:%02d", | 101 alternative_service.ToString().c_str(), probability, |
| 102 alternative_service.ToString().c_str(), exploded.year, exploded.month, | 102 exploded.year, exploded.month, |
| 103 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second); | 103 exploded.day_of_month, exploded.hour, |
| 104 exploded.minute, exploded.second); |
| 104 } | 105 } |
| 105 | 106 |
| 106 // static | 107 // static |
| 107 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { | 108 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
| 108 ssl_config->alpn_protos.clear(); | 109 ssl_config->alpn_protos.clear(); |
| 109 ssl_config->alpn_protos.push_back(kProtoHTTP11); | 110 ssl_config->alpn_protos.push_back(kProtoHTTP11); |
| 110 ssl_config->npn_protos.clear(); | 111 ssl_config->npn_protos.clear(); |
| 111 ssl_config->npn_protos.push_back(kProtoHTTP11); | 112 ssl_config->npn_protos.push_back(kProtoHTTP11); |
| 112 } | 113 } |
| 113 | 114 |
| 114 } // namespace net | 115 } // namespace net |
| OLD | NEW |