diff options
-rw-r--r-- | service/headers/config.go | 2 | ||||
-rw-r--r-- | service/http/config.go | 1 | ||||
-rw-r--r-- | service/http/service.go | 5 | ||||
-rw-r--r-- | util/network.go | 1 |
4 files changed, 6 insertions, 3 deletions
diff --git a/service/headers/config.go b/service/headers/config.go index bb7a6b2b..f9af1df2 100644 --- a/service/headers/config.go +++ b/service/headers/config.go @@ -14,7 +14,7 @@ type Config struct { Response map[string]string } -// CORS headers configuration. +// CORSConfig headers configuration. type CORSConfig struct { // AllowedOrigin: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin AllowedOrigin string diff --git a/service/http/config.go b/service/http/config.go index b5b18c23..c2b11c8d 100644 --- a/service/http/config.go +++ b/service/http/config.go @@ -53,6 +53,7 @@ type HTTP2Config struct { MaxConcurrentStreams uint32 } +// InitDefaults sets default values for HTTP/2 configuration. func (cfg *HTTP2Config) InitDefaults() error { cfg.Enabled = true cfg.MaxConcurrentStreams = 128 diff --git a/service/http/service.go b/service/http/service.go index b3f56480..f9bd0a90 100644 --- a/service/http/service.go +++ b/service/http/service.go @@ -139,7 +139,7 @@ func (s *Service) Serve() error { if s.fcgi != nil { go func() { - err <- s.ListenAndServeFCGI() + err <- s.ServeFCGI() }() } @@ -172,7 +172,8 @@ func (s *Service) Server() *roadrunner.Server { return s.rr } -func (s *Service) ListenAndServeFCGI() error { +// ServeFCGI starts FastCGI server. +func (s *Service) ServeFCGI() error { l, err := util.CreateListener(s.cfg.FCGI.Address) if err != nil { return err diff --git a/util/network.go b/util/network.go index 510a97a9..70e38fdb 100644 --- a/util/network.go +++ b/util/network.go @@ -7,6 +7,7 @@ import ( "syscall" ) +// CreateListener crates socket listener based on DSN definition. func CreateListener(address string) (net.Listener, error) { dsn := strings.Split(address, "://") if len(dsn) != 2 { |