diff --git a/server/listener.go b/server/listener.go index 4cbf76ff12..4cf4b45cfb 100644 --- a/server/listener.go +++ b/server/listener.go @@ -22,6 +22,7 @@ import ( "github.com/dolthub/go-mysql-server/server" "github.com/dolthub/vitess/go/mysql" + "github.com/dolthub/vitess/go/netutil" ) var ( @@ -76,6 +77,12 @@ func (l *Listener) Accept() { continue } + // Configure read timeouts on this connection + // TODO: use timeouts from the live server values + if l.cfg.ConnReadTimeout != 0 || l.cfg.ConnWriteTimeout != 0 { + conn = netutil.NewConnWithTimeouts(conn, l.cfg.ConnReadTimeout, l.cfg.ConnWriteTimeout) + } + connectionHandler := NewConnectionHandler(conn, l.cfg.Handler) go connectionHandler.HandleConnection() }