Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#473] Fix connection status output #474

Merged

Conversation

fluca1978
Copy link
Collaborator

pgagroal-cli was reporting the wrong status for connections because it was decoding the connection status via
pgagroal_server_state_as_string that is used to decode the status of a server.
This commit renames the already existent function
pgagroal_get_state_string as pgagroal_connection_state_as_string for consistency with the server
one (pgagroal_server_state_as_string``) and makes the management decoding using such function to get the effective status of the connection. Since the function pgagroal_connection_state_as_stringkeeps the already existent statuses, the text output is not changed. However, in the caseUnknwon` is reported, the function places also the numeric constant in the output so that it will be easy to debug edge cases.

Close #473

`pgagroal-cli` was reporting the wrong status for connections because
it was decoding the connection status via
`pgagroal_server_state_as_string` that is used to decode the status of
a server.
This commit renames the already existent function
`pgagroal_get_state_string` as `pgagroal_connection_state_as_string`
for consistency with the server
one (`pgagroal_server_state_as_string``) and makes the management
decoding using such function to get the effective status of the
connection.
Since the function `pgagroal_connection_state_as_string` keeps the
already existent statuses, the text output is not changed.
However, in the case `Unknwon` is reported, the function places also
the numeric constant in the output so that it will be easy to debug
edge cases.

Close agroal#473
@jesperpedersen jesperpedersen merged commit bcd6c68 into agroal:master Sep 26, 2024
2 checks passed
@jesperpedersen jesperpedersen added the bug Something isn't working label Sep 26, 2024
@jesperpedersen
Copy link
Collaborator

Merged.

Thanks for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connection status misreported in pgagroal-cli output
2 participants