]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix socket_putmessage_noblock() to call socket_putmessage() master github/master
authorMichael Paquier <michael@paquier.xyz>
Thu, 23 Jul 2026 07:48:40 +0000 (16:48 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 23 Jul 2026 07:48:40 +0000 (16:48 +0900)
commit544d25b7af958ca6c03e98bfbc1538c295b30601
treefd45cd15b0ef62cacd907b50242cd3b6b1b6f262
parentabbd74ce8738d536e8d99151122b7a650e3b63d5
Fix socket_putmessage_noblock() to call socket_putmessage()

socket_putmessage_noblock() used pq_putmessage(), which redirects to
PqCommMethods->putmessage.  In the common cases, this points to
socket_putmessage(), but it would become incorrect if PqCommMethods
points to a different implementation.

This change may look like a bug, but as far as I can see this is mostly
cosmetic.  The code is able to work currently, as the repalloc() done in
the noblock() call ensures that the blocking path of internal_putbytes()
is never reached.  The issue has gone unnoticed since 2bd9e412f92b.

Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAO6_Xqpf5+Rzw_-XOOz-d-R5x6_2JHtpnzXP0nrYWiHyZokA_Q@mail.gmail.com
src/backend/libpq/pqcomm.c