Index: omaha_request_action.cc |
diff --git a/omaha_request_action.cc b/omaha_request_action.cc |
index bb2275d2f78e58389702854bb1348b7ebd18e888..c74ea8d648b420d1eeda41300829a6831f7f01d9 100644 |
--- a/omaha_request_action.cc |
+++ b/omaha_request_action.cc |
@@ -341,13 +341,6 @@ void OmahaRequestAction::TransferComplete(HttpFetcher *fetcher, |
LOG(INFO) << "Omaha request response: " << string(response_buffer_.begin(), |
response_buffer_.end()); |
- // Events are best effort transactions -- assume they always succeed. |
- if (IsEvent()) { |
- CHECK(!HasOutputPipe()) << "No output pipe allowed for event requests."; |
- completer.set_code(kActionCodeSuccess); |
petkov
2011/01/12 01:10:22
Here you could:
if (event->result ==
OmahaEvent::
petkov
2011/01/12 01:17:08
Of course I meant:
if (event->result == OmahaEven
|
- return; |
- } |
- |
if (!successful) { |
LOG(ERROR) << "Omaha request network transfer failed."; |
int code = GetHTTPResponseCode(); |
@@ -359,6 +352,17 @@ void OmahaRequestAction::TransferComplete(HttpFetcher *fetcher, |
kActionCodeOmahaRequestHTTPResponseBase + code)); |
return; |
} |
+ |
+ // Events are best effort transactions, but it's still okay to fail them, |
petkov
2011/01/12 01:10:22
This is somewhat dangerous. The code runs for both
|
+ // (which happens above) since we can use the failure code to decide if we |
+ // should signal the crash reporter about a failure. |
+ // If we get here, assume success for the Event. |
+ if (IsEvent()) { |
+ CHECK(!HasOutputPipe()) << "No output pipe allowed for event requests."; |
+ completer.set_code(kActionCodeSuccess); |
+ return; |
+ } |
+ |
if (!HasOutputPipe()) { |
// Just set success to whether or not the http transfer succeeded, |
// which must be true at this point in the code. |