Adding read nad write timeout for unresponsive client connectinos (#1809)

This commit is contained in:
karthic rao 2016-06-01 00:23:21 +05:30 committed by Harshavardhana
parent 2e4ab71303
commit 1947ae198e

View File

@ -26,6 +26,7 @@ import (
"strconv"
"strings"
"syscall"
"time"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
@ -79,7 +80,10 @@ type serverCmdConfig struct {
func configureServer(srvCmdConfig serverCmdConfig) *http.Server {
// Minio server config
apiServer := &http.Server{
Addr: srvCmdConfig.serverAddr,
Addr: srvCmdConfig.serverAddr,
// Adding timeout of 10 minutes for unresponsive client connections.
ReadTimeout: 600 * time.Second,
WriteTimeout: 600 * time.Second,
Handler: configureServerHandler(srvCmdConfig),
MaxHeaderBytes: 1 << 20,
}