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

Unified Diff: pkg/http/lib/src/base_request.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « pkg/http/lib/src/base_client.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/base_request.dart
diff --git a/pkg/http/lib/src/base_request.dart b/pkg/http/lib/src/base_request.dart
index eb36703eaf6311b342a56c3e6037cf52f85be669..41f04917d93a17af2686f0410243987b57a6d126 100644
--- a/pkg/http/lib/src/base_request.dart
+++ b/pkg/http/lib/src/base_request.dart
@@ -4,6 +4,7 @@
library base_request;
+import 'dart:async';
import 'dart:io';
import 'dart:isolate';
import 'dart:uri';
@@ -105,7 +106,7 @@ abstract class BaseRequest {
/// requests.
Future<StreamedResponse> send() {
var client = new Client();
- return client.send(this).transform((response) {
+ return client.send(this).then((response) {
// TODO(nweiz): This makes me sick to my stomach, but it's currently the
// best way to listen for the response stream being closed. Kill it with
// fire once issue 4202 is fixed.
@@ -117,7 +118,7 @@ abstract class BaseRequest {
});
return response;
- });
+ }).catchError((_) { client.close(); });
}
/// Throws an error if this request has been finalized.
« no previous file with comments | « pkg/http/lib/src/base_client.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698