Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Unified Diff: sdk/lib/io/http_impl.dart

Issue 1055943004: Process outstanding events before making a new HTTP client request (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/https_bad_certificate_client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]) {
« no previous file with comments | « no previous file | tests/standalone/io/https_bad_certificate_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698