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.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go
index f190f63..8cc2ed0 100644
--- a/src/rhimportd/ctrlWebSimple.go
+++ b/src/rhimportd/ctrlWebSimple.go
@@ -92,7 +92,6 @@ func webSimpleResponse(w http.ResponseWriter, result *rhimport.Result) {
}
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)
if jsonerr := decoder.Decode(reqdata); jsonerr != nil {
@@ -100,7 +99,8 @@ func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool,
return
}
- ctx = rhimport.NewContext(conf, db, rhl, rhdl)
+ logname := "simple-" + r.RemoteAddr
+ ctx = rhimport.NewContext(conf, db, getStdLog(logname+"-std"), getDbgLog(logname+"-dbg"))
if trusted {
ctx.UserName = r.Header.Get("X-Forwarded-User")
} else {
@@ -123,7 +123,7 @@ func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool,
}
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))
+ rhdl.Printf("WebSimpleHandler: %s requests '%s'", r.RemoteAddr, html.EscapeString(r.URL.Path))
var ctx *rhimport.Context
var err error
@@ -160,11 +160,6 @@ func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error())
return
}
- if res.ResponseCode == http.StatusOK {
- rhl.Println("ImportFile succesfully imported", ctx.SourceFile)
- } else {
- rhl.Println("ImportFile import of", ctx.SourceFile, "was unsuccesful")
- }
webSimpleResponse(w, res)
return