Fix: socks4 request continues after authentication failed (#1624)
This commit is contained in:
parent
0427b76fc9
commit
da95b27da6
1 changed files with 5 additions and 1 deletions
|
@ -91,6 +91,7 @@ func ServerHandshake(rw io.ReadWriter, authenticator auth.Authenticator) (addr s
|
||||||
code = RequestGranted
|
code = RequestGranted
|
||||||
} else {
|
} else {
|
||||||
code = RequestIdentdMismatched
|
code = RequestIdentdMismatched
|
||||||
|
err = ErrRequestIdentdMismatched
|
||||||
}
|
}
|
||||||
|
|
||||||
var reply [8]byte
|
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[4:8], dstIP)
|
||||||
copy(reply[2:4], dstPort)
|
copy(reply[2:4], dstPort)
|
||||||
|
|
||||||
_, err = rw.Write(reply[:])
|
_, wErr := rw.Write(reply[:])
|
||||||
|
if err == nil {
|
||||||
|
err = wErr
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue