postgresql/src
Tom Lane 90e61df813 Fix treatment of *lpNumberOfBytesRecvd == 0: that's a completion condition.
pgwin32_recv() has treated a non-error return of zero bytes from WSARecv()
as being a reason to block ever since the current implementation was
introduced in commit a4c40f140d.  However, so far as one can tell
from Microsoft's documentation, that is just wrong: what it means is
graceful connection closure (in stream protocols) or receipt of a
zero-length message (in message protocols), and neither case should result
in blocking here.  The only reason the code worked at all was that control
then fell into the retry loop, which did *not* treat zero bytes specially,
so we'd get out after only wasting some cycles.  But as of 9.5 we do not
normally reach the retry loop and so the bug is exposed, as reported by
Shay Rojansky and diagnosed by Andres Freund.

Remove the unnecessary test on the byte count, and rearrange the code
in the retry loop so that it looks identical to the initial sequence.

Back-patch to 9.5.  The code is wrong all the way back, AFAICS, but
since it's relatively harmless in earlier branches we'll leave it alone.
2016-01-03 13:56:29 -05:00
..
backend Fix treatment of *lpNumberOfBytesRecvd == 0: that's a completion condition. 2016-01-03 13:56:29 -05:00
bin Teach pg_dump to quote reloption values safely. 2016-01-02 19:04:45 -05:00
common Update copyright for 2016 2016-01-02 13:33:40 -05:00
include Update copyright for 2016 2016-01-02 13:33:40 -05:00
interfaces Update copyright for 2016 2016-01-02 13:33:40 -05:00
makefiles Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
pl Update copyright for 2016 2016-01-02 13:33:40 -05:00
port Update copyright for 2016 2016-01-02 13:33:40 -05:00
template Remove some remains from Alpha support removal 2015-10-29 16:40:14 -04:00
test Update copyright for 2016 2016-01-02 14:19:48 -05:00
timezone Update copyright for 2016 2016-01-02 13:33:40 -05:00
tools Make copyright.pl cope with nonstandard case choices in copyright notices. 2016-01-02 14:45:21 -05:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in Make prove_installcheck remove the old log directory, if any. 2015-10-11 20:36:07 -04:00
Makefile.shlib
nls-global.mk
win32.mak