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

Side by Side Diff: lib/src/command/lish.dart

Issue 1235013002: Remove the timeout for downloading packages. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 5 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
« no previous file with comments | « no previous file | lib/src/http.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 pub.command.lish; 5 library pub.command.lish;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:http/http.dart' as http; 9 import 'package:http/http.dart' as http;
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // TODO(nweiz): Cloud Storage can provide an XML-formatted error. We 67 // TODO(nweiz): Cloud Storage can provide an XML-formatted error. We
68 // should report that error and exit. 68 // should report that error and exit.
69 var newUri = server.resolve("/api/packages/versions/new"); 69 var newUri = server.resolve("/api/packages/versions/new");
70 var response = await client.get(newUri, headers: PUB_API_HEADERS); 70 var response = await client.get(newUri, headers: PUB_API_HEADERS);
71 var parameters = parseJsonResponse(response); 71 var parameters = parseJsonResponse(response);
72 72
73 var url = _expectField(parameters, 'url', response); 73 var url = _expectField(parameters, 'url', response);
74 if (url is! String) invalidServerResponse(response); 74 if (url is! String) invalidServerResponse(response);
75 cloudStorageUrl = Uri.parse(url); 75 cloudStorageUrl = Uri.parse(url);
76 var request = new http.MultipartRequest('POST', cloudStorageUrl); 76 var request = new http.MultipartRequest('POST', cloudStorageUrl);
77 request.headers['Pub-Request-Timeout'] = 'None';
78 77
79 var fields = _expectField(parameters, 'fields', response); 78 var fields = _expectField(parameters, 'fields', response);
80 if (fields is! Map) invalidServerResponse(response); 79 if (fields is! Map) invalidServerResponse(response);
81 fields.forEach((key, value) { 80 fields.forEach((key, value) {
82 if (value is! String) invalidServerResponse(response); 81 if (value is! String) invalidServerResponse(response);
83 request.fields[key] = value; 82 request.fields[key] = value;
84 }); 83 });
85 84
86 request.followRedirects = false; 85 request.followRedirects = false;
87 request.files.add(new http.MultipartFile.fromBytes( 86 request.files.add(new http.MultipartFile.fromBytes(
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 182 }
184 183
185 var confirmed = await confirm(message); 184 var confirmed = await confirm(message);
186 if (!confirmed) { 185 if (!confirmed) {
187 log.error("Package upload canceled."); 186 log.error("Package upload canceled.");
188 return false; 187 return false;
189 } 188 }
190 return true; 189 return true;
191 } 190 }
192 } 191 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698