fix conn accept deadlock

This commit is contained in:
Jay 2020-01-14 14:11:31 +00:00
parent bbeb8ce7f4
commit 9b9edf08d8

View File

@ -8,12 +8,12 @@ import (
"log" "log"
"net" "net"
"regexp" "regexp"
"strconv"
"strings"
"tcp-proxy/pkg/common" "tcp-proxy/pkg/common"
"tcp-proxy/pkg/config" "tcp-proxy/pkg/config"
"tcp-proxy/pkg/logger" "tcp-proxy/pkg/logger"
"tcp-proxy/pkg/proxy" "tcp-proxy/pkg/proxy"
"strconv"
"strings"
"github.com/google/uuid" "github.com/google/uuid"
) )
@ -146,6 +146,7 @@ func accept(ctx context.Context, listener *net.TCPListener, connChan chan *net.T
select { select {
case <-ctx.Done(): case <-ctx.Done():
return return
default:
} }
} }
} }