MDEV-25817 proxy protocol: successful login does not reset connect errors#5293
MDEV-25817 proxy protocol: successful login does not reset connect errors#5293vaintroub wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where successful logins under the PROXY protocol did not correctly reset the connect-error counters for the proxied client and the proxy host. It introduces a new flag have_proxy_protocol_connect_errors to track connection errors and ensures both the socket peer and the real client's error counters are reset upon a successful login. Additionally, test cases are added to verify this behavior. One review comment suggests a safer way to handle snprintf output length in the test code to prevent potential buffer over-reads.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
8a90603 to
3eb1ee5
Compare
…rors With proxy protocol thd_set_peer_addr() runs twice (proxy host, then the real client from the proxy header). Connect errors are accounted against the real client, but check_connection() incorrectly uses condition on the proxy host's count, rather than real client's address. Fix: reset both the proxy host, and real client's connect errors on successful connection. Added tests for incomplete handshake, and reset behavior, under proxy protocol, for both real client errors, and proxy host errors.
3eb1ee5 to
41dd192
Compare
With proxy protocol thd_set_peer_addr() runs twice (proxy host, then the real client from the proxy header). Connect errors are accounted against the real client, but check_connection() incorrectly uses condition on the proxy host's count, rather than real client's address.
Fix: reset both the proxy host, and real client's connect errors on successful connection.
Added tests for incomplete handshake, and reset behavior, under proxy protocol, for both real client errors, and proxy host errors.