Fix deadlock in update-self

This commit is contained in:
Kovid Goyal
2022-11-15 22:33:23 +05:30
parent d9215feda5
commit 0c0b9e6b9c
2 changed files with 21 additions and 14 deletions

View File

@@ -40,7 +40,7 @@ func DownloadToWriter(url string, dest io.Writer, progress_callback ReportFunc)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("The server responded with the HTTP error %d (%s)", resp.StatusCode, resp.Status)
return fmt.Errorf("The server responded with the HTTP error: %s", resp.Status)
}
wc := write_counter{report: progress_callback}
cl, err := strconv.Atoi(resp.Header.Get("Content-Length"))