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

Side by Side Diff: utils/pub/curl_client.dart

Issue 12021022: Stop supporting map literals with 1 type argument (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library curl_client; 5 library curl_client;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import '../../pkg/http/lib/http.dart' as http; 10 import '../../pkg/http/lib/http.dart' as http;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // line. We just care about the last block. There is one trailing empty 154 // line. We just care about the last block. There is one trailing empty
155 // line, though, which we don't want to consider a separator. 155 // line, though, which we don't want to consider a separator.
156 var lastBlank = lines.lastIndexOf("", lines.length - 2); 156 var lastBlank = lines.lastIndexOf("", lines.length - 2);
157 if (lastBlank != -1) lines.removeRange(0, lastBlank + 1); 157 if (lastBlank != -1) lines.removeRange(0, lastBlank + 1);
158 158
159 var statusParts = lines.removeAt(0).split(" "); 159 var statusParts = lines.removeAt(0).split(" ");
160 var status = int.parse(statusParts[1]); 160 var status = int.parse(statusParts[1]);
161 var isRedirect = status >= 300 && status < 400; 161 var isRedirect = status >= 300 && status < 400;
162 var reasonPhrase = 162 var reasonPhrase =
163 Strings.join(statusParts.getRange(2, statusParts.length - 2), " "); 163 Strings.join(statusParts.getRange(2, statusParts.length - 2), " ");
164 var headers = <String>{}; 164 var headers = <String, String>{};
165 for (var line in lines) { 165 for (var line in lines) {
166 if (line.isEmpty) continue; 166 if (line.isEmpty) continue;
167 var split = split1(line, ":"); 167 var split = split1(line, ":");
168 headers[split[0].toLowerCase()] = split[1].trim(); 168 headers[split[0].toLowerCase()] = split[1].trim();
169 } 169 }
170 var responseStream = process.stdout; 170 var responseStream = process.stdout;
171 if (responseStream.closed) { 171 if (responseStream.closed) {
172 responseStream = new ListInputStream(); 172 responseStream = new ListInputStream();
173 responseStream.markEndOfStream(); 173 responseStream.markEndOfStream();
174 } 174 }
(...skipping 14 matching lines...) Expand all
189 /// path to the bundled `curl.exe`; elsewhere, this is just "curl", and we 189 /// path to the bundled `curl.exe`; elsewhere, this is just "curl", and we
190 /// assume it to be installed and on the user's PATH. 190 /// assume it to be installed and on the user's PATH.
191 static String get _defaultExecutable { 191 static String get _defaultExecutable {
192 if (Platform.operatingSystem != 'windows') return 'curl'; 192 if (Platform.operatingSystem != 'windows') return 'curl';
193 // Note: This line of code gets munged by create_sdk.py to be the correct 193 // Note: This line of code gets munged by create_sdk.py to be the correct
194 // relative path to curl in the SDK. 194 // relative path to curl in the SDK.
195 var pathToCurl = "../../third_party/curl/curl.exe"; 195 var pathToCurl = "../../third_party/curl/curl.exe";
196 return relativeToPub(pathToCurl); 196 return relativeToPub(pathToCurl);
197 } 197 }
198 } 198 }
OLDNEW
« runtime/vm/parser.cc ('K') | « tests/co19/co19-runtime.status ('k') | utils/pub/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698