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/download_action.h" | 5 #include "update_engine/download_action.h" |
6 #include <errno.h> | 6 #include <errno.h> |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include <glib.h> | 10 #include <glib.h> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 } | 156 } |
157 if (delegate_) { | 157 if (delegate_) { |
158 delegate_->SetDownloadStatus(false); // Set to inactive. | 158 delegate_->SetDownloadStatus(false); // Set to inactive. |
159 } | 159 } |
160 ActionExitCode code = | 160 ActionExitCode code = |
161 successful ? kActionCodeSuccess : kActionCodeDownloadTransferError; | 161 successful ? kActionCodeSuccess : kActionCodeDownloadTransferError; |
162 if (code == kActionCodeSuccess) { | 162 if (code == kActionCodeSuccess) { |
163 if (!install_plan_.is_full_update) { | 163 if (!install_plan_.is_full_update) { |
164 if (!delta_performer_->VerifyPayload("", | 164 if (!delta_performer_->VerifyPayload("", |
165 install_plan_.download_hash, | 165 install_plan_.download_hash, |
166 install_plan_.size)) { | 166 install_plan_.size, |
167 NULL)) { | |
petkov
2011/03/30 22:36:23
Intentionally removed the TODO, I assume?
adlr
2011/04/04 23:27:13
Yeah, I think it makes this CL cleaner
| |
167 LOG(ERROR) << "Download of " << install_plan_.download_url | 168 LOG(ERROR) << "Download of " << install_plan_.download_url |
168 << " failed due to payload verification error."; | 169 << " failed due to payload verification error."; |
169 code = kActionCodeDownloadPayloadVerificationError; | 170 code = kActionCodeDownloadPayloadVerificationError; |
170 } else if (!delta_performer_->GetNewPartitionInfo( | 171 } else if (!delta_performer_->GetNewPartitionInfo( |
171 &install_plan_.kernel_size, | 172 &install_plan_.kernel_size, |
172 &install_plan_.kernel_hash, | 173 &install_plan_.kernel_hash, |
173 &install_plan_.rootfs_size, | 174 &install_plan_.rootfs_size, |
174 &install_plan_.rootfs_hash)) { | 175 &install_plan_.rootfs_hash)) { |
175 LOG(ERROR) << "Unable to get new partition hash info."; | 176 LOG(ERROR) << "Unable to get new partition hash info."; |
176 code = kActionCodeDownloadNewPartitionInfoError; | 177 code = kActionCodeDownloadNewPartitionInfoError; |
(...skipping 23 matching lines...) Expand all Loading... | |
200 processor_->ActionComplete(this, code); | 201 processor_->ActionComplete(this, code); |
201 } | 202 } |
202 | 203 |
203 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) { | 204 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) { |
204 if (code_ != kActionCodeSuccess) { | 205 if (code_ != kActionCodeSuccess) { |
205 processor_->ActionComplete(this, code_); | 206 processor_->ActionComplete(this, code_); |
206 } | 207 } |
207 } | 208 } |
208 | 209 |
209 }; // namespace {} | 210 }; // namespace {} |
OLD | NEW |