mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-04 23:45:07 +00:00
add WriteTimeout
This commit is contained in:
parent
498542c983
commit
ccab1a346a
@ -559,13 +559,14 @@ func startAPIs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
type test struct {
|
type test struct {
|
||||||
IdleTimeout time.Duration
|
IdleTimeout time.Duration
|
||||||
ReadTimeout time.Duration
|
ReadTimeout time.Duration
|
||||||
|
WriteTimeout time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
func listen(ctx context.Context, router *mux.Router, port uint16, tlsConfig *tls.Config, shutdown <-chan os.Signal, test test) error {
|
func listen(ctx context.Context, router *mux.Router, port uint16, tlsConfig *tls.Config, shutdown <-chan os.Signal, test test) error {
|
||||||
http2Server := &http2.Server{IdleTimeout: test.IdleTimeout}
|
http2Server := &http2.Server{IdleTimeout: test.IdleTimeout}
|
||||||
http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig, ReadTimeout: test.ReadTimeout, IdleTimeout: test.IdleTimeout}
|
http1Server := &http.Server{Handler: h2c.NewHandler(router, http2Server), TLSConfig: tlsConfig, ReadTimeout: test.ReadTimeout, IdleTimeout: test.IdleTimeout, WriteTimeout: test.WriteTimeout}
|
||||||
|
|
||||||
lc := net.ListenConfig()
|
lc := net.ListenConfig()
|
||||||
lis, err := lc.Listen(ctx, "tcp", fmt.Sprintf(":%d", port))
|
lis, err := lc.Listen(ctx, "tcp", fmt.Sprintf(":%d", port))
|
||||||
|
Loading…
Reference in New Issue
Block a user