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

Drop clients from proxy_worker, not proxy_conn #27

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

cottsay
Copy link
Owner

@cottsay cottsay commented Jan 7, 2025

A previous refactor moved the authorization process from the proxy_conn to the proxy_worker, but did not introduce any mechanism to drop an in-progress authorization before a client connection was assigned to an available proxy_conn for normal use. Because ownership of the client connection was also moved to the proxy_worker, it's safe to initiate the connection dropping process from the proxy_worker instead of the proxy_conn, which will cover the in-progress authorization case as well.

This was previously done with a borrowed reference to the client connection here:

openelp/src/proxy_conn.c

Lines 850 to 860 in 11fde32

void proxy_conn_drop(struct proxy_conn_handle *pc)
{
struct proxy_conn_priv *priv = pc->priv;
mutex_lock_shared(&priv->mutex_client);
if (priv->conn_client != NULL)
conn_drop(priv->conn_client);
mutex_unlock_shared(&priv->mutex_client);
}

A previous refactor moved the authorization process from the proxy_conn
to the proxy_worker, but did not introduce any mechanism to drop an
in-progress authorization before a client connection was assigned to an
available proxy_conn for normal use. Because ownership of the client
connection was also moved to the proxy_worker, it's safe to initiate the
connection dropping process from the proxy_worker instead of the
proxy_conn, which will cover the in-progress authorization case as well.

Fixes 7709624
@cottsay cottsay added the bug label Jan 7, 2025
@cottsay cottsay self-assigned this Jan 7, 2025
@cottsay cottsay merged commit c61445d into main Jan 8, 2025
5 checks passed
@cottsay cottsay deleted the cottsay/drop-during-auth branch January 8, 2025 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant