diff options
Diffstat (limited to 'rhimport/fetcher.go')
-rw-r--r-- | rhimport/fetcher.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go index b4380fa..f176e03 100644 --- a/rhimport/fetcher.go +++ b/rhimport/fetcher.go @@ -115,7 +115,7 @@ func curlProgressCallback(dltotal, dlnow, ultotal, ulnow float64, userdata inter return false } - if data.ctx.Cancel != nil && len(data.ctx.Cancel) > 0 { + if data.ctx.isCanceled() { data.res.ResponseCode = http.StatusNoContent data.res.ErrorString = "canceled" return false @@ -443,7 +443,7 @@ func fetchFileDirConvert(ctx *Context, res *Result, origSrc *os.File, sizeTotal written += uint64(w) ctx.reportProgress(1, "fetching", float64(written), float64(sizeTotal)) - if ctx.Cancel != nil && len(ctx.Cancel) > 0 { + if ctx.isCanceled() { res.ResponseCode = http.StatusNoContent res.ErrorString = "canceled" break @@ -549,7 +549,7 @@ func fetchFileFake(ctx *Context, res *Result, uri *url.URL) error { } for i := uint(0); i < uint(duration); i++ { - if ctx.Cancel != nil && len(ctx.Cancel) > 0 { + if ctx.isCanceled() { rhl.Printf("faking got canceled") res.ResponseCode = http.StatusNoContent res.ErrorString = "canceled" |