postgresql/src/interfaces
Tom Lane 724e30c9f8 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.
2011-08-27 14:16:14 -04:00
..
ecpg Add "%option warn" to all flex input files that lacked it. 2011-08-25 13:55:57 -04:00
libpq Ensure we discard unread/unsent data when abandoning a connection attempt. 2011-08-27 14:16:14 -04:00
Makefile Fix parallel make when running make install before make all 2011-03-08 23:52:29 +02:00