aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistproc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-27 14:16:39 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-27 14:16:39 -0400
commitbb42ad1231f4e9fa4c774e797882bf2d5a7f8f58 (patch)
treeeb191f2aa55aee32c0c779abe76cddeba34c617a /src/backend/access/gist/gistproc.c
parentae42744e4ebd961e8dc66ca4836bff99b714a2b3 (diff)
downloadpostgresql-bb42ad1231f4e9fa4c774e797882bf2d5a7f8f58.tar.gz
postgresql-bb42ad1231f4e9fa4c774e797882bf2d5a7f8f58.zip
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.
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions