diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/helsinki.at/rhimportd/ctrlWeb.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWeb.go b/src/helsinki.at/rhimportd/ctrlWeb.go index 6b6568d..a786a23 100644 --- a/src/helsinki.at/rhimportd/ctrlWeb.go +++ b/src/helsinki.at/rhimportd/ctrlWeb.go @@ -28,6 +28,7 @@ import ( "helsinki.at/rhimport" "net/http" _ "net/http/pprof" + "time" ) type webHandler struct { @@ -46,5 +47,6 @@ func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDbCh http.Handle("/trusted/simple", webHandler{conf, rddb, true, webSimpleHandler}) rhl.Println("web-ctrl: listening on", addr_s) - http.ListenAndServe(addr_s, nil) // TODO: reader.Timeout, writer.Timeout??? + server := &http.Server{Addr: addr_s, ReadTimeout: 60 * time.Second, WriteTimeout: 60 * time.Second} + server.ListenAndServe() } |