client: disable checking for ping and event status in responses

Turns out CoreUpdate does not currently send <ping status="ok"> and
<event status="ok"> in responses like the protocol says it should.
This commit is contained in:
Michael Marineau 2017-06-08 12:54:51 -07:00
parent 2d48f3a029
commit d946c1e7b2
1 changed files with 11 additions and 6 deletions

View File

@ -217,14 +217,15 @@ func (ac *AppClient) UpdateCheck() (*omaha.UpdateResponse, error) {
return nil, err return nil, err
} }
if appResp.Ping == nil { // BUG: CoreUpdate does not send ping status in response.
/*if appResp.Ping == nil {
ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid)) ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid))
return nil, fmt.Errorf("omaha: ping status missing from response") return nil, fmt.Errorf("omaha: ping status missing from response")
} }
if appResp.Ping.Status != "ok" { if appResp.Ping.Status != "ok" {
return nil, fmt.Errorf("omaha: ping status %s", appResp.Ping.Status) return nil, fmt.Errorf("omaha: ping status %s", appResp.Ping.Status)
} }*/
if appResp.UpdateCheck == nil { if appResp.UpdateCheck == nil {
ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid)) ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid))
@ -254,14 +255,16 @@ func (ac *AppClient) Ping() error {
return err return err
} }
if appResp.Ping == nil { // BUG: CoreUpdate does not send ping status in response.
_ = appResp
/*if appResp.Ping == nil {
ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid)) ac.Event(NewErrorEvent(ExitCodeOmahaResponseInvalid))
return fmt.Errorf("omaha: ping status missing from response") return fmt.Errorf("omaha: ping status missing from response")
} }
if appResp.Ping.Status != "ok" { if appResp.Ping.Status != "ok" {
return fmt.Errorf("omaha: ping status %s", appResp.Ping.Status) return fmt.Errorf("omaha: ping status %s", appResp.Ping.Status)
} }*/
return nil return nil
} }
@ -282,7 +285,9 @@ func (ac *AppClient) Event(event *omaha.EventRequest) <-chan error {
return return
} }
if len(appResp.Events) == 0 { // BUG: CoreUpdate does not send event status in response.
_ = appResp
/*if len(appResp.Events) == 0 {
errc <- fmt.Errorf("omaha: event status missing from response") errc <- fmt.Errorf("omaha: event status missing from response")
return return
} }
@ -290,7 +295,7 @@ func (ac *AppClient) Event(event *omaha.EventRequest) <-chan error {
if appResp.Events[0].Status != "ok" { if appResp.Events[0].Status != "ok" {
errc <- fmt.Errorf("omaha: event status %s", appResp.Events[0].Status) errc <- fmt.Errorf("omaha: event status %s", appResp.Events[0].Status)
return return
} }*/
errc <- nil errc <- nil
return return