go18.go 831 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build go1.8
  5. package http2
  6. import (
  7. "crypto/tls"
  8. "net/http"
  9. )
  10. func cloneTLSConfig(c *tls.Config) *tls.Config { return c.Clone() }
  11. var _ http.Pusher = (*responseWriter)(nil)
  12. // Push implements http.Pusher.
  13. func (w *responseWriter) Push(target string, opts *http.PushOptions) error {
  14. internalOpts := pushOptions{}
  15. if opts != nil {
  16. internalOpts.Method = opts.Method
  17. internalOpts.Header = opts.Header
  18. }
  19. return w.push(target, internalOpts)
  20. }
  21. func configureServer18(h1 *http.Server, h2 *Server) error {
  22. if h2.IdleTimeout == 0 {
  23. if h1.IdleTimeout != 0 {
  24. h2.IdleTimeout = h1.IdleTimeout
  25. } else {
  26. h2.IdleTimeout = h1.ReadTimeout
  27. }
  28. }
  29. return nil
  30. }