Don't use pq_putmessage in socket comm function - Mailing list pgsql-hackers

From Anthonin Bonnefoy
Subject Don't use pq_putmessage in socket comm function
Date
Msg-id CAO6_Xqpf5+Rzw_-XOOz-d-R5x6_2JHtpnzXP0nrYWiHyZokA_Q@mail.gmail.com
Whole thread
Responses Re: Don't use pq_putmessage in socket comm function
Re: NULL pointer dereference in syslogger with load_libraries() and -DEXEC_BACKEND at startup
List pgsql-hackers
Hi,

Currently, socket_putmessage_noblock enlarges the output buffer and
then calls pq_putmessage to store the message in the buffer.

pq_putmessage is a macro redirecting to PqCommMethods->putmessage.
This is normally set to socket_putmessage, so
socket_putmessage_noblock calls socket_putmessage as desired.

However, if a custom PqCommMethods is defined, any call to
socket_putmessage_noblock will then loop to the custom putmessage.

This patch fixes the issue by directly using socket_putmessage in
socket_putmessage_noblock.

Regards,
Anthonin Bonnefoy

Attachment

pgsql-hackers by date:

Previous
From: "Jonathan Gonzalez V."
Date:
Subject: Re: [PATCH] Cover get_json_table_plan() with tests
Next
From: Antonin Houska
Date:
Subject: Re: Allow progress tracking of sub-commands