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 const int _OUTGOING_BUFFER_SIZE = 8 * 1024; | 7 const int _OUTGOING_BUFFER_SIZE = 8 * 1024; |
8 | 8 |
9 class _HttpIncoming extends Stream<List<int>> { | 9 class _HttpIncoming extends Stream<List<int>> { |
10 final int _transferLength; | 10 final int _transferLength; |
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 return completer.future; | 1629 return completer.future; |
1630 } | 1630 } |
1631 var currentBadCertificateCallback = client._badCertificateCallback; | 1631 var currentBadCertificateCallback = client._badCertificateCallback; |
1632 callback(X509Certificate certificate) => | 1632 callback(X509Certificate certificate) => |
1633 currentBadCertificateCallback == null ? false : | 1633 currentBadCertificateCallback == null ? false : |
1634 currentBadCertificateCallback(certificate, uriHost, uriPort); | 1634 currentBadCertificateCallback(certificate, uriHost, uriPort); |
1635 Future socketFuture = (isSecure && proxy.isDirect | 1635 Future socketFuture = (isSecure && proxy.isDirect |
1636 ? SecureSocket.connect(host, | 1636 ? SecureSocket.connect(host, |
1637 port, | 1637 port, |
1638 context: context, | 1638 context: context, |
1639 sendClientCertificate: true, | |
1640 onBadCertificate: callback) | 1639 onBadCertificate: callback) |
1641 : Socket.connect(host, port)); | 1640 : Socket.connect(host, port)); |
1642 _connecting++; | 1641 _connecting++; |
1643 return socketFuture.then((socket) { | 1642 return socketFuture.then((socket) { |
1644 _connecting--; | 1643 _connecting--; |
1645 socket.setOption(SocketOption.TCP_NODELAY, true); | 1644 socket.setOption(SocketOption.TCP_NODELAY, true); |
1646 var connection = | 1645 var connection = |
1647 new _HttpClientConnection(key, socket, client, false, context); | 1646 new _HttpClientConnection(key, socket, client, false, context); |
1648 if (isSecure && !proxy.isDirect) { | 1647 if (isSecure && !proxy.isDirect) { |
1649 connection._dispose = true; | 1648 connection._dispose = true; |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2864 const _RedirectInfo(this.statusCode, this.method, this.location); | 2863 const _RedirectInfo(this.statusCode, this.method, this.location); |
2865 } | 2864 } |
2866 | 2865 |
2867 String _getHttpVersion() { | 2866 String _getHttpVersion() { |
2868 var version = Platform.version; | 2867 var version = Platform.version; |
2869 // Only include major and minor version numbers. | 2868 // Only include major and minor version numbers. |
2870 int index = version.indexOf('.', version.indexOf('.') + 1); | 2869 int index = version.indexOf('.', version.indexOf('.') + 1); |
2871 version = version.substring(0, index); | 2870 version = version.substring(0, index); |
2872 return 'Dart/$version (dart:io)'; | 2871 return 'Dart/$version (dart:io)'; |
2873 } | 2872 } |
OLD | NEW |