@@ -2,7 +2,6 @@ package main
22
33import (
44 "bytes"
5- "context"
65 "crypto/rand"
76 "crypto/tls"
87 "crypto/x509"
@@ -156,7 +155,6 @@ type CLIArgs struct {
156155 bwLimit uint64
157156 bwBuckets uint
158157 bwSeparate bool
159- connTimeLimit time.Duration
160158 reqHeaderTimeout time.Duration
161159}
162160
@@ -199,7 +197,6 @@ func parse_args() CLIArgs {
199197 flag .Uint64Var (& args .bwLimit , "bw-limit" , 0 , "per-user bandwidth limit in bytes per second" )
200198 flag .UintVar (& args .bwBuckets , "bw-limit-buckets" , 1024 * 1024 , "number of buckets of bandwidth limit" )
201199 flag .BoolVar (& args .bwSeparate , "bw-limit-separate" , false , "separate upload and download bandwidth limits" )
202- flag .DurationVar (& args .connTimeLimit , "conn-time-limit" , 6 * time .Hour , "hard time limit for connections" )
203200 flag .DurationVar (& args .reqHeaderTimeout , "req-header-timeout" , 30 * time .Second , "amount of time allowed to read request headers" )
204201 flag .Parse ()
205202 args .positionalArgs = flag .Args ()
@@ -270,14 +267,6 @@ func run() int {
270267 d = newDialer
271268 }
272269
273- var srvConnContext func (ctx context.Context , c net.Conn ) context.Context
274- if args .connTimeLimit > 0 {
275- srvConnContext = func (ctx context.Context , c net.Conn ) context.Context {
276- newCtx , _ := context .WithTimeout (ctx , args .connTimeLimit )
277- return newCtx
278- }
279- }
280-
281270 forwarder := forward .PairConnections
282271 if args .bwLimit != 0 {
283272 forwarder = forward .NewBWLimit (
@@ -301,7 +290,6 @@ func run() int {
301290 ReadHeaderTimeout : args .reqHeaderTimeout ,
302291 WriteTimeout : 0 ,
303292 IdleTimeout : 0 ,
304- ConnContext : srvConnContext ,
305293 }
306294
307295 if args .disableHTTP2 {
0 commit comments