Skip to content

Commit

Permalink
fix: reject's dial warning
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Feb 26, 2023
1 parent f565edd commit efbde4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions adapter/outbound/reject.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ func (rw *nopConn) Read(b []byte) (int, error) {
}

func (rw *nopConn) Write(b []byte) (int, error) {
if len(b) == 0 {
return 0, nil
}
return 0, io.EOF
}

Expand Down
5 changes: 5 additions & 0 deletions tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,11 @@ func handleTCPConn(connCtx C.ConnContext) {
if err != nil {
return nil, err
}
for _, chain := range remoteConn.Chains() {
if chain == "REJECT" {
return remoteConn, nil
}
}
peekMutex.Lock()
defer peekMutex.Unlock()
peekBytes, _ = conn.Peek(conn.Buffered())
Expand Down

0 comments on commit efbde4a

Please sign in to comment.