summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/ctrlWeb.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWeb.go')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWeb.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWeb.go b/src/helsinki.at/rhimportd/ctrlWeb.go
index 894780c..2a95676 100644
--- a/src/helsinki.at/rhimportd/ctrlWeb.go
+++ b/src/helsinki.at/rhimportd/ctrlWeb.go
@@ -34,20 +34,21 @@ import (
type webHandler struct {
*rhimport.Config
*rhimport.RdDbChan
+ *rhimport.SessionStoreChan
trusted bool
- H func(*rhimport.Config, *rhimport.RdDbChan, bool, http.ResponseWriter, *http.Request)
+ H func(*rhimport.Config, *rhimport.RdDbChan, *rhimport.SessionStoreChan, bool, http.ResponseWriter, *http.Request)
}
func (self webHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- self.H(self.Config, self.RdDbChan, self.trusted, w, r)
+ self.H(self.Config, self.RdDbChan, self.SessionStoreChan, self.trusted, w, r)
}
-func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDbChan) {
- http.Handle("/public/simple", webHandler{conf, rddb, false, webSimpleHandler})
- http.Handle("/trusted/simple", webHandler{conf, rddb, true, webSimpleHandler})
+func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan) {
+ http.Handle("/public/simple", webHandler{conf, rddb, sessions, false, webSimpleHandler})
+ http.Handle("/trusted/simple", webHandler{conf, rddb, sessions, true, webSimpleHandler})
- http.Handle("/public/socket", webHandler{conf, rddb, false, webSocketHandler})
- http.Handle("/trusted/socket", webHandler{conf, rddb, true, webSocketHandler})
+ http.Handle("/public/socket", webHandler{conf, rddb, sessions, false, webSocketHandler})
+ http.Handle("/trusted/socket", webHandler{conf, rddb, sessions, true, webSocketHandler})
rhl.Println("web-ctrl: listening on", addr_s)
server := &http.Server{Addr: addr_s, ReadTimeout: 60 * time.Second, WriteTimeout: 60 * time.Second}