mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03:00
Make connection limit configurable
This commit is contained in:
@@ -25,10 +25,11 @@ import (
|
||||
|
||||
// Config - http server config
|
||||
type Config struct {
|
||||
Address string
|
||||
TLS bool
|
||||
CertFile string
|
||||
KeyFile string
|
||||
Address string
|
||||
TLS bool
|
||||
CertFile string
|
||||
KeyFile string
|
||||
ConnectionLimit int
|
||||
}
|
||||
|
||||
// Server - http server related
|
||||
|
||||
@@ -43,7 +43,9 @@ type MemoryFactory struct {
|
||||
func (f MemoryFactory) GetStartServerFunc() StartServerFunc {
|
||||
return func() (chan<- string, <-chan error) {
|
||||
_, _, driver := memory.Start(f.MaxMemory, f.Expiration)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
|
||||
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
|
||||
conf.SetDriver(driver)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
|
||||
return ctrl, status
|
||||
}
|
||||
}
|
||||
@@ -58,7 +60,9 @@ type FilesystemFactory struct {
|
||||
func (f FilesystemFactory) GetStartServerFunc() StartServerFunc {
|
||||
return func() (chan<- string, <-chan error) {
|
||||
_, _, driver := fs.Start(f.Path)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
|
||||
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
|
||||
conf.SetDriver(driver)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
|
||||
return ctrl, status
|
||||
}
|
||||
}
|
||||
@@ -86,7 +90,9 @@ type DonutFactory struct {
|
||||
func (f DonutFactory) GetStartServerFunc() StartServerFunc {
|
||||
return func() (chan<- string, <-chan error) {
|
||||
_, _, driver := donut.Start(f.Paths)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
|
||||
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
|
||||
conf.SetDriver(driver)
|
||||
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
|
||||
return ctrl, status
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user