summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/fetcher.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/fetcher.go')
-rw-r--r--src/helsinki.at/rhimport/fetcher.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/helsinki.at/rhimport/fetcher.go b/src/helsinki.at/rhimport/fetcher.go
index 300abef..a8ac22c 100644
--- a/src/helsinki.at/rhimport/fetcher.go
+++ b/src/helsinki.at/rhimport/fetcher.go
@@ -101,7 +101,7 @@ func FetchFileCurl(ctx *ImportContext, res *FetchResult, uri *url.URL) (err erro
cbdata := &FetcherCurlCBData{remotename: path.Base(uri.Path)}
defer cbdata.Cleanup()
- if cbdata.basepath, err = ioutil.TempDir(ctx.Config.TempDir, "rhimportd-"); err != nil {
+ if cbdata.basepath, err = ioutil.TempDir(ctx.conf.TempDir, "rhimportd-"); err != nil {
return
}
@@ -142,7 +142,7 @@ func FetchFileLocal(ctx *ImportContext, res *FetchResult, uri *url.URL) (err err
ctx.ProgressCallBack(1, "fetching", 1.0, ctx.ProgressCallBackData)
}
- ctx.SourceFile = filepath.Join(ctx.Config.LocalFetchDir, path.Clean("/"+uri.Path))
+ ctx.SourceFile = filepath.Join(ctx.conf.LocalFetchDir, path.Clean("/"+uri.Path))
var src *os.File
if src, err = os.Open(ctx.SourceFile); err != nil {
res.ResponseCode = http.StatusBadRequest
@@ -194,13 +194,14 @@ func checkPassword(ctx *ImportContext, result *FetchResult) (err error) {
cached := true
for {
+ res_ch := make(chan getPasswordResult)
req := getPasswordRequest{}
req.username = ctx.UserName
req.cached = cached
- req.response = make(chan getPasswordResult)
- ctx.RdDb.getPasswordChan <- req
+ req.response = res_ch
+ ctx.rddb.getPasswordChan <- req
- res := <-req.response
+ res := <-res_ch
if res.err != nil {
return res.err
}