fix: reject's dial warning

This commit is contained in:
wwqgtxx 2023-02-26 11:11:54 +08:00
parent f565edd76d
commit efbde4a179
2 changed files with 5 additions and 3 deletions

View File

@ -53,9 +53,6 @@ func (rw *nopConn) Read(b []byte) (int, error) {
} }
func (rw *nopConn) Write(b []byte) (int, error) { func (rw *nopConn) Write(b []byte) (int, error) {
if len(b) == 0 {
return 0, nil
}
return 0, io.EOF return 0, io.EOF
} }

View File

@ -410,6 +410,11 @@ func handleTCPConn(connCtx C.ConnContext) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
for _, chain := range remoteConn.Chains() {
if chain == "REJECT" {
return remoteConn, nil
}
}
peekMutex.Lock() peekMutex.Lock()
defer peekMutex.Unlock() defer peekMutex.Unlock()
peekBytes, _ = conn.Peek(conn.Buffered()) peekBytes, _ = conn.Peek(conn.Buffered())