OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/socket/ssl_client_socket_win.h" | 5 #include "net/socket/ssl_client_socket_win.h" |
6 | 6 |
7 #include <schnlsp.h> | 7 #include <schnlsp.h> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lock.h" | 10 #include "base/lock.h" |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 // Unlike IsConnected, this method doesn't return a false positive. | 559 // Unlike IsConnected, this method doesn't return a false positive. |
560 // | 560 // |
561 // Strictly speaking, we should check if we have received the close_notify | 561 // Strictly speaking, we should check if we have received the close_notify |
562 // alert message from the server, and return false in that case. Although | 562 // alert message from the server, and return false in that case. Although |
563 // the close_notify alert message means EOF in the SSL layer, it is just | 563 // the close_notify alert message means EOF in the SSL layer, it is just |
564 // bytes to the transport layer below, so transport_->IsConnectedAndIdle() | 564 // bytes to the transport layer below, so transport_->IsConnectedAndIdle() |
565 // returns the desired false when we receive close_notify. | 565 // returns the desired false when we receive close_notify. |
566 return completed_handshake() && transport_->IsConnectedAndIdle(); | 566 return completed_handshake() && transport_->IsConnectedAndIdle(); |
567 } | 567 } |
568 | 568 |
569 int SSLClientSocketWin::GetPeerName(struct sockaddr* name, socklen_t* namelen) { | 569 int SSLClientSocketWin::GetPeerAddress(AddressList* address) const { |
570 return transport_->GetPeerName(name, namelen); | 570 return transport_->GetPeerAddress(address); |
571 } | 571 } |
572 | 572 |
573 int SSLClientSocketWin::Read(IOBuffer* buf, int buf_len, | 573 int SSLClientSocketWin::Read(IOBuffer* buf, int buf_len, |
574 CompletionCallback* callback) { | 574 CompletionCallback* callback) { |
575 DCHECK(completed_handshake()); | 575 DCHECK(completed_handshake()); |
576 DCHECK(!user_read_callback_); | 576 DCHECK(!user_read_callback_); |
577 | 577 |
578 // If we have surplus decrypted plaintext, satisfy the Read with it without | 578 // If we have surplus decrypted plaintext, satisfy the Read with it without |
579 // reading more ciphertext from the transport socket. | 579 // reading more ciphertext from the transport socket. |
580 if (bytes_decrypted_ != 0) { | 580 if (bytes_decrypted_ != 0) { |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA, success); | 1331 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA, success); |
1332 } | 1332 } |
1333 | 1333 |
1334 void SSLClientSocketWin::FreeSendBuffer() { | 1334 void SSLClientSocketWin::FreeSendBuffer() { |
1335 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1335 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
1336 DCHECK(status == SEC_E_OK); | 1336 DCHECK(status == SEC_E_OK); |
1337 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1337 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
1338 } | 1338 } |
1339 | 1339 |
1340 } // namespace net | 1340 } // namespace net |
OLD | NEW |