Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 21:24:45 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-11 21:24:45 +0300
commit3d691bf42432304a3ae6d6465c3f596629891e74 (patch)
treeb37d38ccf1a672a4c862f53b4534e07db5122091 /server.go
parent3824fc8ca34b8f94ae7ef7550aec196dbbfdecf5 (diff)
Move most of configuration to appConfig
Diffstat (limited to 'server.go')
-rw-r--r--server.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.go b/server.go
index f3408f25..3f267b65 100644
--- a/server.go
+++ b/server.go
@@ -26,11 +26,11 @@ func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) {
return tc, nil
}
-func listenAndServe(fd uintptr, handler http.HandlerFunc, tlsConfig *tls.Config) error {
+func listenAndServe(fd uintptr, handler http.HandlerFunc, useHTTP2 bool, tlsConfig *tls.Config) error {
// create server
server := &http.Server{Handler: handler, TLSConfig: tlsConfig}
- if *http2proto {
+ if useHTTP2 {
err := http2.ConfigureServer(server, &http2.Server{})
if err != nil {
return err
@@ -50,7 +50,7 @@ func listenAndServe(fd uintptr, handler http.HandlerFunc, tlsConfig *tls.Config)
}
}
-func listenAndServeTLS(fd uintptr, cert, key []byte, handler http.HandlerFunc, tlsHandler tlsHandlerFunc) error {
+func listenAndServeTLS(fd uintptr, cert, key []byte, handler http.HandlerFunc,tlsHandler tlsHandlerFunc, useHTTP2 bool) error {
certificate, err := tls.X509KeyPair(cert, key)
if err != nil {
return err
@@ -64,5 +64,5 @@ func listenAndServeTLS(fd uintptr, cert, key []byte, handler http.HandlerFunc, t
tlsConfig.Certificates = []tls.Certificate{
certificate,
}
- return listenAndServe(fd, handler, tlsConfig)
+ return listenAndServe(fd, handler, useHTTP2, tlsConfig)
}