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

Unified Diff: pkg/analysis_server/lib/driver.dart

Issue 239333006: Make the http portion of the analysis server optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/driver.dart
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
index cd46bea567a8da3356c102a1d0bc5d956c60a941..911cbc66883a2ee7163b96bdd49b7075f4554b03 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/driver.dart
@@ -60,26 +60,28 @@ class Driver {
_printUsage(parser);
return;
}
- if (results[PORT_OPTION] == null) {
- print('Missing required port number');
- print('');
- _printUsage(parser);
- exitCode = 1;
- return;
+ int port;
+ bool serve_http = false;
+ if (results[PORT_OPTION] != null) {
+ serve_http = true;
+ try {
+ port = int.parse(results[PORT_OPTION]);
+ } on FormatException {
+ print('Invalid port number: ${results[PORT_OPTION]}');
+ print('');
+ _printUsage(parser);
+ exitCode = 1;
+ return;
+ }
}
- try {
- int port = int.parse(results[PORT_OPTION]);
+ if (serve_http) {
httpServer.serveHttp(port);
- } on FormatException {
- print('Invalid port number: ${results[PORT_OPTION]}');
- print('');
- _printUsage(parser);
- exitCode = 1;
- return;
}
stdioServer.serveStdio().then((_) {
- httpServer.close();
+ if (serve_http) {
+ httpServer.close();
+ }
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698