Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: xhe <[email protected]>
  • Loading branch information
xhebox committed Dec 2, 2023
1 parent cdf33ef commit 59d7ab3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/proxy/backend/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,13 @@ loop:
if packetErr != nil {
// tiproxy pp enabled, tidb pp disabled, tls disabled => invalid sequence
// tiproxy pp disabled, tidb pp enabled, tls disabled => invalid sequence
for _, p := range []string{
"packets out of order",
"(nvali): d sequence",
"invalid sequence",
"PROXY Protocol",
} {
if strings.Contains(packetErr.Message, p) {
if pktIdx == 0 {
if packetErr.Code == 1156 || packetErr.Code == 8052 {
return errors.Wrap(ErrBackendPPV2, packetErr)
}
if strings.Contains(packetErr.Message, "PROXY Protocol") {
return ErrBackendPPV2
}
}
return errors.Wrap(ErrClientAuthFail, packetErr)
}
Expand Down

0 comments on commit 59d7ab3

Please sign in to comment.