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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/server.dart

Issue 203623004: Add web socket command to stop serving a directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up. Created 6 years, 9 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
Index: sdk/lib/_internal/pub/lib/src/barback/server.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/server.dart b/sdk/lib/_internal/pub/lib/src/barback/server.dart
index c918126f9ff32c2b5e96f7f8e60cf9422932cd6f..43ec02df7f961757ef0adbb8bb6b0cfbd3178712 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/server.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/server.dart
@@ -95,7 +95,7 @@ class BarbackServer {
/// Closes this server.
Future close() {
var futures = [_server.close(), _resultsController.close()];
- futures.addAll(_webSockets);
+ futures.addAll(_webSockets.map((socket) => socket.close()));
return Future.wait(futures);
}
@@ -153,9 +153,7 @@ class BarbackServer {
_environment.barback.getAssetById(id).then((result) {
_logRequest(request, "getAssetById($id) returned");
return result;
- })
- .then((asset) => _serveAsset(request, asset))
- .catchError((error, trace) {
+ }).then((asset) => _serveAsset(request, asset)).catchError((error, trace) {
if (error is! AssetNotFoundException) throw error;
return _environment.barback.getAssetById(id.addExtension("/index.html"))
.then((asset) {

Powered by Google App Engine
This is Rietveld 408576698