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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = | 165 LibcurlHttpFetcher* update_check_fetcher = |
166 new LibcurlHttpFetcher(GetProxyResolver()); | 166 new LibcurlHttpFetcher(GetProxyResolver()); |
167 // If this is an automatic check, try harder to connect to the network. See | 167 // Try harder to connect to the network. See comment in |
168 // comment in libcurl_http_fetcher.cc. | 168 // libcurl_http_fetcher.cc. |
169 if (!obey_proxies) { | 169 update_check_fetcher->set_no_network_max_retries(3); |
170 update_check_fetcher->set_no_network_max_retries(3); | |
171 } | |
172 shared_ptr<OmahaRequestAction> update_check_action( | 170 shared_ptr<OmahaRequestAction> update_check_action( |
173 new OmahaRequestAction(prefs_, | 171 new OmahaRequestAction(prefs_, |
174 omaha_request_params_, | 172 omaha_request_params_, |
175 NULL, | 173 NULL, |
176 update_check_fetcher)); // passes ownership | 174 update_check_fetcher)); // passes ownership |
177 shared_ptr<OmahaResponseHandlerAction> response_handler_action( | 175 shared_ptr<OmahaResponseHandlerAction> response_handler_action( |
178 new OmahaResponseHandlerAction(prefs_)); | 176 new OmahaResponseHandlerAction(prefs_)); |
179 shared_ptr<FilesystemCopierAction> filesystem_copier_action( | 177 shared_ptr<FilesystemCopierAction> filesystem_copier_action( |
180 new FilesystemCopierAction(false)); | 178 new FilesystemCopierAction(false)); |
181 shared_ptr<FilesystemCopierAction> kernel_filesystem_copier_action( | 179 shared_ptr<FilesystemCopierAction> kernel_filesystem_copier_action( |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 if (resume_offset < response_handler_action_->install_plan().size) { | 561 if (resume_offset < response_handler_action_->install_plan().size) { |
564 ranges.push_back(make_pair(resume_offset, -1)); | 562 ranges.push_back(make_pair(resume_offset, -1)); |
565 } | 563 } |
566 } else { | 564 } else { |
567 ranges.push_back(make_pair(0, -1)); | 565 ranges.push_back(make_pair(0, -1)); |
568 } | 566 } |
569 fetcher->set_ranges(ranges); | 567 fetcher->set_ranges(ranges); |
570 } | 568 } |
571 | 569 |
572 } // namespace chromeos_update_engine | 570 } // namespace chromeos_update_engine |
OLD | NEW |