pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: oauth: Ensure unused socket registrations are removed 2+ messages / 1 participants [nested] [flat]
* pgsql: oauth: Ensure unused socket registrations are removed @ 2025-08-08 16:07 Jacob Champion <jchampion@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Jacob Champion @ 2025-08-08 16:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org oauth: Ensure unused socket registrations are removed If Curl needs to switch the direction of a socket's registration (e.g. from CURL_POLL_IN to CURL_POLL_OUT), it expects the old registration to be discarded. For epoll, this happened via EPOLL_CTL_MOD, but for kqueue, the old registration would remain if it was not explicitly removed by Curl. Explicitly remove the opposite-direction event during registrations. (If that event doesn't exist, we'll just get an ENOENT, which will be ignored by the same code that handles CURL_POLL_REMOVE.) A few assertions are also added to strengthen the relationship between the number of events added, the number of events pulled off the queue, and the lengths of the kevent arrays. Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Backpatch-through: 18 Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3d9c03429a82c199a77563ae5d57c4c9cefa3d41 Modified Files -------------- src/interfaces/libpq-oauth/oauth-curl.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: oauth: Ensure unused socket registrations are removed @ 2025-08-08 16:07 Jacob Champion <jchampion@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Jacob Champion @ 2025-08-08 16:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org oauth: Ensure unused socket registrations are removed If Curl needs to switch the direction of a socket's registration (e.g. from CURL_POLL_IN to CURL_POLL_OUT), it expects the old registration to be discarded. For epoll, this happened via EPOLL_CTL_MOD, but for kqueue, the old registration would remain if it was not explicitly removed by Curl. Explicitly remove the opposite-direction event during registrations. (If that event doesn't exist, we'll just get an ENOENT, which will be ignored by the same code that handles CURL_POLL_REMOVE.) A few assertions are also added to strengthen the relationship between the number of events added, the number of events pulled off the queue, and the lengths of the kevent arrays. Reviewed-by: Thomas Munro <thomas.munro@gmail.com> Backpatch-through: 18 Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/16b0c48583a5043f46d75cde99d8a3ffbd9c7c98 Modified Files -------------- src/interfaces/libpq-oauth/oauth-curl.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-08-08 16:07 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-08-08 16:07 pgsql: oauth: Ensure unused socket registrations are removed Jacob Champion <jchampion@postgresql.org> 2025-08-08 16:07 pgsql: oauth: Ensure unused socket registrations are removed Jacob Champion <jchampion@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox