From ccdc28631aa6f398a24ab70cd6404a84ac1ae0c5 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 21 Feb 2017 21:51:07 -0700 Subject: [PATCH] httpserver: Remove unused ReadTimeout from tlsHelloListener --- caddyhttp/httpserver/mitm.go | 11 ++++------- caddyhttp/httpserver/server.go | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/caddyhttp/httpserver/mitm.go b/caddyhttp/httpserver/mitm.go index d83fa71c..fc80371b 100644 --- a/caddyhttp/httpserver/mitm.go +++ b/caddyhttp/httpserver/mitm.go @@ -9,7 +9,6 @@ import ( "net/http" "strings" "sync" - "time" ) // tlsHandler is a http.Handler that will inject a value @@ -253,12 +252,11 @@ func parseRawClientHello(data []byte) (info rawHelloInfo) { } // newTLSListener returns a new tlsHelloListener that wraps ln. -func newTLSListener(ln net.Listener, config *tls.Config, readTimeout time.Duration) *tlsHelloListener { +func newTLSListener(ln net.Listener, config *tls.Config) *tlsHelloListener { return &tlsHelloListener{ - Listener: ln, - config: config, - readTimeout: readTimeout, - helloInfos: make(map[string]rawHelloInfo), + Listener: ln, + config: config, + helloInfos: make(map[string]rawHelloInfo), } } @@ -270,7 +268,6 @@ func newTLSListener(ln net.Listener, config *tls.Config, readTimeout time.Durati type tlsHelloListener struct { net.Listener config *tls.Config - readTimeout time.Duration helloInfos map[string]rawHelloInfo helloInfosMu sync.RWMutex } diff --git a/caddyhttp/httpserver/server.go b/caddyhttp/httpserver/server.go index 538c2fe1..d8b8e550 100644 --- a/caddyhttp/httpserver/server.go +++ b/caddyhttp/httpserver/server.go @@ -247,7 +247,7 @@ func (s *Server) Serve(ln net.Listener) error { // not implement the File() method we need for graceful restarts // on POSIX systems. // TODO: Is this ^ still relevant anymore? Maybe we can now that it's a net.Listener... - ln = newTLSListener(ln, s.Server.TLSConfig, s.Server.ReadTimeout) + ln = newTLSListener(ln, s.Server.TLSConfig) if handler, ok := s.Server.Handler.(*tlsHandler); ok { handler.listener = ln.(*tlsHelloListener) }