From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Ensure we discard unread/unsent data when abandoning a connectio |
Date: | 2011-08-27 18:17:08 |
Message-ID: | E1QxNRM-0008O1-9o@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Ensure we discard unread/unsent data when abandoning a connection attempt.
There are assorted situations wherein PQconnectPoll() will abandon a
connection attempt and try again with different parameters (eg, SSL versus
not SSL). However, the code forgot to discard any pending data in libpq's
I/O buffers when doing this. In at least one case (server returns E
message during SSL negotiation), there is unread input data which bollixes
the next connection attempt. I have not checked to see whether this is
possible in the other cases where we close the socket and retry, but it
seems like a matter of good defensive programming to add explicit
buffer-flushing code to all of them.
This is one of several issues exposed by Daniel Farina's report of
misbehavior after a server-side fork failure.
This has been wrong since forever, so back-patch to all supported branches.
Branch
------
REL8_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/bb42ad1231f4e9fa4c774e797882bf2d5a7f8f58
Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2011-08-27 20:30:10 | pgsql: Document minimum required version of DocBook XSL stylesheets |
Previous Message | Bruce Momjian | 2011-08-27 15:06:11 | pgsql: Allow more include files to be compiled in their own by adding m |