OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "update_engine/update_attempter.h" | 5 #include "update_engine/update_attempter.h" |
6 | 6 |
7 // From 'man clock_gettime': feature test macro: _POSIX_C_SOURCE >= 199309L | 7 // From 'man clock_gettime': feature test macro: _POSIX_C_SOURCE >= 199309L |
8 #ifndef _POSIX_C_SOURCE | 8 #ifndef _POSIX_C_SOURCE |
9 #define _POSIX_C_SOURCE 199309L | 9 #define _POSIX_C_SOURCE 199309L |
10 #endif // _POSIX_C_SOURCE | 10 #endif // _POSIX_C_SOURCE |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 } | 155 } |
156 LOG_IF(INFO, !obeying_proxies_) << "To help ensure updates work, this update " | 156 LOG_IF(INFO, !obeying_proxies_) << "To help ensure updates work, this update " |
157 "check we are ignoring the proxy settings and using " | 157 "check we are ignoring the proxy settings and using " |
158 "direct connections."; | 158 "direct connections."; |
159 | 159 |
160 DisableDeltaUpdateIfNeeded(); | 160 DisableDeltaUpdateIfNeeded(); |
161 CHECK(!processor_->IsRunning()); | 161 CHECK(!processor_->IsRunning()); |
162 processor_->set_delegate(this); | 162 processor_->set_delegate(this); |
163 | 163 |
164 // Actions: | 164 // Actions: |
165 LibcurlHttpFetcher* update_check_fetcher = | |
166 new LibcurlHttpFetcher(GetProxyResolver()); | |
167 // If this is an automatic check, try harder to connect to the network. See | |
168 // comment in libcurl_http_fetcher.cc. | |
169 if (!obey_proxies) { | |
170 update_check_fetcher->set_no_network_max_retries(3); | |
171 } | |
165 shared_ptr<OmahaRequestAction> update_check_action( | 172 shared_ptr<OmahaRequestAction> update_check_action( |
166 new OmahaRequestAction(prefs_, | 173 new OmahaRequestAction(prefs_, |
167 omaha_request_params_, | 174 omaha_request_params_, |
168 NULL, | 175 NULL, |
169 new LibcurlHttpFetcher(GetProxyResolver()))); | 176 update_check_fetcher)); |
adlr
2010/11/29 21:23:28
// passes ownership
petkov
2010/11/29 21:28:19
Done.
| |
170 shared_ptr<OmahaResponseHandlerAction> response_handler_action( | 177 shared_ptr<OmahaResponseHandlerAction> response_handler_action( |
171 new OmahaResponseHandlerAction(prefs_)); | 178 new OmahaResponseHandlerAction(prefs_)); |
172 shared_ptr<FilesystemCopierAction> filesystem_copier_action( | 179 shared_ptr<FilesystemCopierAction> filesystem_copier_action( |
173 new FilesystemCopierAction(false)); | 180 new FilesystemCopierAction(false)); |
174 shared_ptr<FilesystemCopierAction> kernel_filesystem_copier_action( | 181 shared_ptr<FilesystemCopierAction> kernel_filesystem_copier_action( |
175 new FilesystemCopierAction(true)); | 182 new FilesystemCopierAction(true)); |
176 shared_ptr<OmahaRequestAction> download_started_action( | 183 shared_ptr<OmahaRequestAction> download_started_action( |
177 new OmahaRequestAction(prefs_, | 184 new OmahaRequestAction(prefs_, |
178 omaha_request_params_, | 185 omaha_request_params_, |
179 new OmahaEvent( | 186 new OmahaEvent( |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 if (resume_offset < response_handler_action_->install_plan().size) { | 563 if (resume_offset < response_handler_action_->install_plan().size) { |
557 ranges.push_back(make_pair(resume_offset, -1)); | 564 ranges.push_back(make_pair(resume_offset, -1)); |
558 } | 565 } |
559 } else { | 566 } else { |
560 ranges.push_back(make_pair(0, -1)); | 567 ranges.push_back(make_pair(0, -1)); |
561 } | 568 } |
562 fetcher->set_ranges(ranges); | 569 fetcher->set_ranges(ranges); |
563 } | 570 } |
564 | 571 |
565 } // namespace chromeos_update_engine | 572 } // namespace chromeos_update_engine |
OLD | NEW |