OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/ssl.h> | 10 #include <openssl/ssl.h> |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1087 } | 1087 } |
1088 | 1088 |
1089 bool SSLClientSocketOpenSSL::UsingTCPFastOpen() const { | 1089 bool SSLClientSocketOpenSSL::UsingTCPFastOpen() const { |
1090 if (transport_.get() && transport_->socket()) | 1090 if (transport_.get() && transport_->socket()) |
1091 return transport_->socket()->UsingTCPFastOpen(); | 1091 return transport_->socket()->UsingTCPFastOpen(); |
1092 | 1092 |
1093 NOTREACHED(); | 1093 NOTREACHED(); |
1094 return false; | 1094 return false; |
1095 } | 1095 } |
1096 | 1096 |
1097 int64 SSLClientSocketOpenSSL::NumBytesRead() const { | |
1098 if (transport_.get() && transport_->socket()) | |
1099 return transport_->socket()->NumBytesRead(); | |
1100 | |
1101 NOTREACHED(); | |
1102 return -1; | |
wtc
2011/07/01 16:41:17
I think returning 0 here and in GetConnectTimeMicr
bulach
2011/07/05 10:06:55
I'll keep this as is now for consistency.
joth poi
| |
1103 } | |
1104 | |
1105 base::TimeDelta SSLClientSocketOpenSSL::GetConnectTimeMicros() const { | |
1106 if (transport_.get() && transport_->socket()) | |
1107 return transport_->socket()->GetConnectTimeMicros(); | |
1108 | |
1109 NOTREACHED(); | |
1110 return base::TimeDelta::FromMicroseconds(-1); | |
1111 } | |
1112 | |
1097 // Socket methods | 1113 // Socket methods |
1098 | 1114 |
1099 int SSLClientSocketOpenSSL::Read(IOBuffer* buf, | 1115 int SSLClientSocketOpenSSL::Read(IOBuffer* buf, |
1100 int buf_len, | 1116 int buf_len, |
1101 CompletionCallback* callback) { | 1117 CompletionCallback* callback) { |
1102 user_read_buf_ = buf; | 1118 user_read_buf_ = buf; |
1103 user_read_buf_len_ = buf_len; | 1119 user_read_buf_len_ = buf_len; |
1104 | 1120 |
1105 int rv = DoReadLoop(OK); | 1121 int rv = DoReadLoop(OK); |
1106 | 1122 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1210 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
1195 user_write_buf_->data()); | 1211 user_write_buf_->data()); |
1196 return rv; | 1212 return rv; |
1197 } | 1213 } |
1198 | 1214 |
1199 int err = SSL_get_error(ssl_, rv); | 1215 int err = SSL_get_error(ssl_, rv); |
1200 return MapOpenSSLError(err, err_tracer); | 1216 return MapOpenSSLError(err, err_tracer); |
1201 } | 1217 } |
1202 | 1218 |
1203 } // namespace net | 1219 } // namespace net |
OLD | NEW |