mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 03:06:47 +00:00
Fix: socks4 request continues after authentication failed (#1624)
This commit is contained in:
1 parent
f5806d9263
commit
b0f83e401f
1 file changed
+5
-1
@@ -91,6 +91,7 @@ func ServerHandshake(rw io.ReadWriter, authenticator auth.Authenticator) (addr s
|
||||
code = RequestGranted
|
||||
} else {
|
||||
code = RequestIdentdMismatched
|
||||
err = ErrRequestIdentdMismatched
|
||||
}
|
||||
|
||||
var reply [8]byte
|
||||
@@ -99,7 +100,10 @@ func ServerHandshake(rw io.ReadWriter, authenticator auth.Authenticator) (addr s
|
||||
copy(reply[4:8], dstIP)
|
||||
copy(reply[2:4], dstPort)
|
||||
|
||||
_, err = rw.Write(reply[:])
|
||||
_, wErr := rw.Write(reply[:])
|
||||
if err == nil {
|
||||
err = wErr
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user