| Index: sdk/lib/io/http_impl.dart
|
| diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
|
| index bd382bccc28d645f8faae0cee7bfd58069cb6433..42c1db9843c22ec0041a4231469a7118a70beefe 100644
|
| --- a/sdk/lib/io/http_impl.dart
|
| +++ b/sdk/lib/io/http_impl.dart
|
| @@ -1883,7 +1883,11 @@ class _HttpClient implements HttpClient {
|
| // On error, continue with next proxy.
|
| .catchError(connect);
|
| }
|
| - return connect(new HttpException("No proxies given"));
|
| + // Make sure we go through the event loop before taking a
|
| + // connection from the pool. For long-running synchronous code the
|
| + // server might have closed the connection, so this lowers the
|
| + // probability of getting a connection that was already closed.
|
| + return new Future(() => connect(new HttpException("No proxies given")));
|
| }
|
|
|
| _SiteCredentials _findCredentials(Uri url, [_AuthenticationScheme scheme]) {
|
|
|