Skip to content

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.

2 participants