I have spent sometime to investigate the issue, it is reproduciable. In case of Windows, when pqsecure_raw_read() function error code WSAEWOULDBLOCK (EWOULDBLOCK) when no data queued to be read from the non blocking socket there is a need to log retry flag. Related error code can be retrieved via Windows WSAGetLastError() instead of errno, preprocessor SOCK_ERRNO handle it gracefully. PFA patch, it resolve the issue i.e.
C:\PG\postgresql\pg_with_openssl_inst_v1_patch>bin\psql.exe -d postgres -h 172.16.141.210
psql (9.5alpha2)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=# select version();
version
-----------------------------------------------------------------
PostgreSQL 9.5alpha2, compiled by Visual C++ build 1800, 64-bit
(1 row)
Regards,
Muhammad Asif Naeem