]> granicus.if.org Git - postgresql/commit
Ensure libpq reports a suitable error message on unexpected socket EOF.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Oct 2014 22:42:01 +0000 (18:42 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 22 Oct 2014 22:42:01 +0000 (18:42 -0400)
commitac6e8753707337d338e3a5fdb99d4f593ebc2df5
tree3a598c8233ff9f117e594873f17aa65c766b160d
parent98170fa4650752f670f055c74190e924ed8b655e
Ensure libpq reports a suitable error message on unexpected socket EOF.

The EOF-detection logic in pqReadData was a bit confused about who should
set up the error message in case the kernel gives us read-ready-but-no-data
rather than ECONNRESET or some other explicit error condition.  Since the
whole point of this situation is that the lower-level functions don't know
there's anything wrong, pqReadData itself must set up the message.  But
keep the assumption that if an errno was reported, a message was set up at
lower levels.

Per bug #11712 from Marko Tiikkaja.  It's been like this for a very long
time, so back-patch to all supported branches.
src/interfaces/libpq/fe-misc.c