OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * A high-level class for communicating securely over a TCP socket, using | 8 * A high-level class for communicating securely over a TCP socket, using |
9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an | 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an |
10 * [IOSink] interface, making it ideal for using together with | 10 * [IOSink] interface, making it ideal for using together with |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 } | 867 } |
868 if (encrypted.length > 0) { | 868 if (encrypted.length > 0) { |
869 int bytes = _secureFilter.processBuffer(READ_ENCRYPTED); | 869 int bytes = _secureFilter.processBuffer(READ_ENCRYPTED); |
870 if (bytes > 0) { | 870 if (bytes > 0) { |
871 encrypted.advanceStart(bytes); | 871 encrypted.advanceStart(bytes); |
872 progress = true; | 872 progress = true; |
873 } | 873 } |
874 } | 874 } |
875 if (!_socketClosedRead && encrypted.free > 0) { | 875 if (!_socketClosedRead && encrypted.free > 0) { |
876 if (_bufferedData != null) { | 876 if (_bufferedData != null) { |
877 _readFromCarryOver(); | 877 _readFromBuffered(); |
878 progress = true; | 878 progress = true; |
879 } else { | 879 } else { |
880 List<int> data = _socket.read(encrypted.free); | 880 List<int> data = _socket.read(encrypted.free); |
881 if (data != null) { | 881 if (data != null) { |
882 int bytes = data.length; | 882 int bytes = data.length; |
883 int startIndex = encrypted.start + encrypted.length; | 883 int startIndex = encrypted.start + encrypted.length; |
884 encrypted.data.setRange(startIndex, startIndex + bytes, data); | 884 encrypted.data.setRange(startIndex, startIndex + bytes, data); |
885 encrypted.length += bytes; | 885 encrypted.length += bytes; |
886 progress = true; | 886 progress = true; |
887 } | 887 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 void destroy(); | 973 void destroy(); |
974 void handshake(); | 974 void handshake(); |
975 void init(); | 975 void init(); |
976 X509Certificate get peerCertificate; | 976 X509Certificate get peerCertificate; |
977 int processBuffer(int bufferIndex); | 977 int processBuffer(int bufferIndex); |
978 void registerBadCertificateCallback(Function callback); | 978 void registerBadCertificateCallback(Function callback); |
979 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); | 979 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); |
980 | 980 |
981 List<_ExternalBuffer> get buffers; | 981 List<_ExternalBuffer> get buffers; |
982 } | 982 } |
OLD | NEW |