8000 redis: use dbname param when redis is unauthenticated by maddymeows · Pull Request #1668 · coturn/coturn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

redis: use dbname param when redis is unauthenticated #1668

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

maddymeows
Copy link
Contributor
@maddymeows maddymeows commented Apr 15, 2025

Fixes a regression pointed out at #1488 (comment).

A regression was introduced in the last PR where the dbname parameter was not respected if using redis without authentication. The logic for sending the select command responsible for switching to the correct database was wrongly guarded behind authentication being provided. This PR flattens the control flow so the select command is always sent, whether using authentication or not.

@eakraly
Copy link
Collaborator
eakraly commented May 5, 2025

Hi @maddymeows ! Thanks for the PR
Could you please add explanation what the issue is and how this PR solves it?
Referencing some other PR/comment is hard to understand - especially if looking at source code or git commit history.
Thanks!

@maddymeows
Copy link
Contributor Author
maddymeows commented May 5, 2025

A regression was introduced in the last PR where the dbname parameter was not respected if using redis without authentication. The logic for sending the select command responsible for switching to the correct database was wrongly guarded behind authentication being provided. This PR flattens the control flow so the select command is always sent, whether using authentication or not.

@ggarber ggarber requested a review from Copilot May 21, 2025 05:37
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Redis connection setup to ensure the co->dbname parameter is applied even when no authentication is used, addressing a regression.

  • Separated the error, authentication, and database selection into independent checks
  • Always executes the SELECT command when co->dbname is set, regardless of authentication state
Comments suppressed due to low confidence (1)

src/apps/relay/dbdrivers/dbd_redis.c:374

  • Consider adding or updating tests to cover the new unauthenticated DB selection logic, ensuring that the co->dbname branch is exercised when no password is provided.
if (redisconnection && co->dbname) {

@ggarber ggarber self-assigned this May 21, 2025
@ggarber ggarber merged commit c0b2c8d into coturn:master May 21, 2025
58 checks passed
@ggarber
Copy link
Contributor
ggarber commented May 21, 2025

thank you for this PR @maddymeows 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0