File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ var DefaultReadHeaderTimeout = 10 * time.Second
2626// Only one of Policy or ConnPolicy should be provided. If both are provided then
2727// a panic would occur during accept.
2828type Listener struct {
29- Listener net.Listener
29+ Listener net.Listener
30+ // Deprecated: use ConnPolicyFunc instead. This will be removed in future release.
3031 Policy PolicyFunc
3132 ConnPolicy ConnPolicyFunc
3233 ValidateHeader Validator
Original file line number Diff line number Diff line change @@ -703,7 +703,14 @@ func TestPanicIfPolicyAndConnPolicySet(t *testing.T) {
703703 fmt .Printf ("accept did panic as expected with error, %v" , r )
704704 }
705705 }()
706- pl .Accept ()
706+ conn , err := pl .Accept ()
707+ if err != nil {
708+ t .Fatalf ("Expected the accept to panic but did not and error is returned, got %v" , err )
709+ }
710+
711+ if conn != nil {
712+ t .Fatalf ("xpected the accept to panic but did not, got %v" , conn )
713+ }
707714 t .Fatalf ("expected the accept to panic but did not" )
708715}
709716
You can’t perform that action at this time.
0 commit comments