| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 void _checkSocketDone() { | 1530 void _checkSocketDone() { |
| 1531 if (_isAllDone) { | 1531 if (_isAllDone) { |
| 1532 // If we are done writing the response, and either the server | 1532 // If we are done writing the response, and either the server |
| 1533 // has closed or the connection is not persistent, we must | 1533 // has closed or the connection is not persistent, we must |
| 1534 // close. | 1534 // close. |
| 1535 if (_isReadClosed || !_response.persistentConnection) { | 1535 if (_isReadClosed || !_response.persistentConnection) { |
| 1536 this.onClosed = () { | 1536 this.onClosed = () { |
| 1537 _client._closedSocketConnection(_socketConn); | 1537 _client._closedSocketConnection(_socketConn); |
| 1538 }; | 1538 }; |
| 1539 _client._closeQueue.add(this); | 1539 _client._closeQueue.add(this); |
| 1540 } else if (_socket != null) { | 1540 } else { |
| 1541 _client._returnSocketConnection(_socketConn); | 1541 _client._returnSocketConnection(_socketConn); |
| 1542 _socket = null; | 1542 _socket = null; |
| 1543 _socketConn = null; | 1543 _socketConn = null; |
| 1544 assert(_pendingRedirect == null || _pendingRetry == null); | 1544 assert(_pendingRedirect == null || _pendingRetry == null); |
| 1545 if (_pendingRedirect != null) { | 1545 if (_pendingRedirect != null) { |
| 1546 _doRedirect(_pendingRedirect); | 1546 _doRedirect(_pendingRedirect); |
| 1547 _pendingRedirect = null; | 1547 _pendingRedirect = null; |
| 1548 } else if (_pendingRetry != null) { | 1548 } else if (_pendingRetry != null) { |
| 1549 _doRetry(_pendingRetry); | 1549 _doRetry(_pendingRetry); |
| 1550 _pendingRetry = null; | 1550 _pendingRetry = null; |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 | 2300 |
| 2301 | 2301 |
| 2302 class _RedirectInfo implements RedirectInfo { | 2302 class _RedirectInfo implements RedirectInfo { |
| 2303 const _RedirectInfo(int this.statusCode, | 2303 const _RedirectInfo(int this.statusCode, |
| 2304 String this.method, | 2304 String this.method, |
| 2305 Uri this.location); | 2305 Uri this.location); |
| 2306 final int statusCode; | 2306 final int statusCode; |
| 2307 final String method; | 2307 final String method; |
| 2308 final Uri location; | 2308 final Uri location; |
| 2309 } | 2309 } |
| OLD | NEW |