summaryrefslogtreecommitdiff
path: root/src/rhimportd/ctrlWebSimple.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhimportd/ctrlWebSimple.go')
-rw-r--r--src/rhimportd/ctrlWebSimple.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go
index cd2c556..15f06ee 100644
--- a/src/rhimportd/ctrlWebSimple.go
+++ b/src/rhimportd/ctrlWebSimple.go
@@ -28,6 +28,7 @@ import (
"encoding/json"
"fmt"
"helsinki.at/rhimport"
+ "helsinki.at/rhrd-go/rddb"
"html"
"net/http"
)
@@ -90,7 +91,7 @@ func webSimpleResponse(w http.ResponseWriter, result *rhimport.Result) {
encoder.Encode(respdata)
}
-func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) {
+func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) {
decoder := json.NewDecoder(r.Body)
reqdata := newWebSimpleRequestData(conf)
@@ -99,7 +100,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust
return
}
- ctx = rhimport.NewContext(conf, rddb)
+ ctx = rhimport.NewContext(conf, db)
if trusted {
ctx.UserName = r.Header.Get("X-Forwarded-User")
} else {
@@ -121,12 +122,12 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust
return
}
-func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) {
+func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) {
rhdl.Printf("WebSimpleHandler: request for '%s'", html.EscapeString(r.URL.Path))
var ctx *rhimport.Context
var err error
- if ctx, err = webSimpleParseRequest(conf, rddb, trusted, r); err != nil {
+ if ctx, err = webSimpleParseRequest(conf, db, trusted, r); err != nil {
webSimpleErrorResponse(w, http.StatusBadRequest, err.Error())
return
}