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 // The close queue handles graceful closing of HTTP connections. When | 7 // The close queue handles graceful closing of HTTP connections. When |
8 // a connection is added to the queue it will enter a wait state | 8 // a connection is added to the queue it will enter a wait state |
9 // waiting for all data written and possibly socket shutdown from | 9 // waiting for all data written and possibly socket shutdown from |
10 // peer. | 10 // peer. |
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 var socket = socketConnections.first._socket; | 2019 var socket = socketConnections.first._socket; |
2020 if (!secure && socket is! SecureSocket) break; | 2020 if (!secure && socket is! SecureSocket) break; |
2021 if (secure && socket is SecureSocket && | 2021 if (secure && socket is SecureSocket && |
2022 _sendClientCertificate == socket.sendClientCertificate && | 2022 _sendClientCertificate == socket.sendClientCertificate && |
2023 _clientCertificate == socket.certificateName) break; | 2023 _clientCertificate == socket.certificateName) break; |
2024 } | 2024 } |
2025 socketConnections.removeFirst()._close(); | 2025 socketConnections.removeFirst()._close(); |
2026 } | 2026 } |
2027 } | 2027 } |
2028 if (socketConnections == null || socketConnections.isEmpty) { | 2028 if (socketConnections == null || socketConnections.isEmpty) { |
2029 Socket socket = secure ? | 2029 Socket socket = secure && proxy.isDirect ? |
2030 new SecureSocket(connectHost, | 2030 new SecureSocket(connectHost, |
2031 connectPort, | 2031 connectPort, |
2032 sendClientCertificate: _sendClientCertificate, | 2032 sendClientCertificate: _sendClientCertificate, |
2033 certificateName: _clientCertificate) : | 2033 certificateName: _clientCertificate) : |
2034 new Socket(connectHost, connectPort); | 2034 new Socket(connectHost, connectPort); |
2035 // Until the connection is established handle connection errors | 2035 // Until the connection is established handle connection errors |
2036 // here as the HttpClientConnection object is not yet associated | 2036 // here as the HttpClientConnection object is not yet associated |
2037 // with the socket. | 2037 // with the socket. |
2038 socket.onError = (e) { | 2038 socket.onError = (e) { |
2039 proxyIndex++; | 2039 proxyIndex++; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 | 2330 |
2331 | 2331 |
2332 class _RedirectInfo implements RedirectInfo { | 2332 class _RedirectInfo implements RedirectInfo { |
2333 const _RedirectInfo(int this.statusCode, | 2333 const _RedirectInfo(int this.statusCode, |
2334 String this.method, | 2334 String this.method, |
2335 Uri this.location); | 2335 Uri this.location); |
2336 final int statusCode; | 2336 final int statusCode; |
2337 final String method; | 2337 final String method; |
2338 final Uri location; | 2338 final Uri location; |
2339 } | 2339 } |
OLD | NEW |