Instead of a bare recv() to read the server's response to an SSL request packet, use pqReadData().  This has the same effect since conn->ssl isn't set yet and we aren't expecting more than one byte. The advantage is that we will correctly detect loss-of-connection instead of going into an infinite loop.  Per report from Hannu Krosing.
Instead of a bare recv() to read the server's response to an SSL
request packet, use pqReadData().  This has the same effect since
conn->ssl isn't set yet and we aren't expecting more than one byte.
The advantage is that we will correctly detect loss-of-connection
instead of going into an infinite loop.  Per report from Hannu Krosing.

greenplum-db/gpdb,tpostgres-projects/tPostgres,rvs/gpdb,tangp3/gpdb,techdragon/Postgres-XL,lisakowen/gpdb,xuegang/gpdb,ashwinstar/gpdb,Chibin/gpdb,randomtask1155/gpdb,kaknikhil/gpdb,atris/gpdb,rvs/gpdb,ovr/postgres-xl,kaknikhil/gpdb,kmjungersen/PostgresXL,Chibin/gpdb,snaga/postgres-xl,tpostgres-projects/tPostgres,ahachete/gpdb,royc1/gpdb,zaksoup/gpdb,CraigHarris/gpdb,lintzc/gpdb,yuanzhao/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,arcivanov/postgres-xl,ahachete/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,kaknikhil/gpdb,royc1/gpdb,greenplum-db/gpdb,tangp3/gpdb,50wu/gpdb,randomtask1155/gpdb,royc1/gpdb,xuegang/gpdb,Postgres-XL/Postgres-XL,zaksoup/gpdb,Quikling/gpdb,50wu/gpdb,ashwinstar/gpdb,snaga/postgres-xl,edespino/gpdb,ashwinstar/gpdb,yazun/postgres-xl,tpostgres-projects/tPostgres,edespino/gpdb,jmcatamney/gpdb,atris/gpdb,Chibin/gpdb,rubikloud/gpdb,lintzc/gpdb,oberstet/postgres-xl,zaksoup/gpdb,Chibin/gpdb,cjcjameson/gpdb,ovr/postgres-xl,edespino/gpdb,chrishajas/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,atris/gpdb,yazun/postgres-xl,lisakowen/gpdb,snaga/postgres-xl,xuegang/gpdb,lintzc/gpdb,yazun/postgres-xl,Quikling/gpdb,ahachete/gpdb,zaksoup/gpdb,jmcatamney/gpdb,xinzweb/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,rubikloud/gpdb,randomtask1155/gpdb,zeroae/postgres-xl,rvs/gpdb,adam8157/gpdb,tangp3/gpdb,rvs/gpdb,ahachete/gpdb,adam8157/gpdb,postmind-net/postgres-xl,jmcatamney/gpdb,yuanzhao/gpdb,kmjungersen/PostgresXL,lintzc/gpdb,chrishajas/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,tangp3/gpdb,zeroae/postgres-xl,CraigHarris/gpdb,oberstet/postgres-xl,lpetrov-pivotal/gpdb,pavanvd/postgres-xl,CraigHarris/gpdb,cjcjameson/gpdb,ovr/postgres-xl,lintzc/gpdb,rvs/gpdb,pavanvd/postgres-xl,royc1/gpdb,atris/gpdb,randomtask1155/gpdb,tangp3/gpdb,Quikling/gpdb,zeroae/postgres-xl,Quikling/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,yuanzhao/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,oberstet/postgres-xl,kaknikhil/gpdb,foyzur/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,rubikloud/gpdb,lisakowen/gpdb,atris/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,yazun/postgres-xl,zeroae/postgres-xl,chrishajas/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,chrishajas/gpdb,yuanzhao/gpdb,janebeckman/gpdb,Postgres-XL/Postgres-XL,yuanzhao/gpdb,postmind-net/postgres-xl,zeroae/postgres-xl,randomtask1155/gpdb,yuanzhao/gpdb,xinzweb/gpdb,adam8157/gpdb,arcivanov/postgres-xl,50wu/gpdb,lintzc/gpdb,CraigHarris/gpdb,arcivanov/postgres-xl,Quikling/gpdb,Quikling/gpdb,atris/gpdb,tangp3/gpdb,postmind-net/postgres-xl,xuegang/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,kmjungersen/PostgresXL,0x0FFF/gpdb,xinzweb/gpdb,janebeckman/gpdb,0x0FFF/gpdb,tangp3/gpdb,zaksoup/gpdb,ahachete/gpdb,ashwinstar/gpdb,xuegang/gpdb,edespino/gpdb,cjcjameson/gpdb,tangp3/gpdb,janebeckman/gpdb,zaksoup/gpdb,edespino/gpdb,techdragon/Postgres-XL,foyzur/gpdb,Chibin/gpdb,lisakowen/gpdb,0x0FFF/gpdb,cjcjameson/gpdb,rvs/gpdb,xinzweb/gpdb,lintzc/gpdb,chrishajas/gpdb,lintzc/gpdb,rubikloud/gpdb,Chibin/gpdb,janebeckman/gpdb,jmcatamney/gpdb,royc1/gpdb,atris/gpdb,50wu/gpdb,rubikloud/gpdb,yazun/postgres-xl,ovr/postgres-xl,lisakowen/gpdb,janebeckman/gpdb,rubikloud/gpdb,lintzc/gpdb,tpostgres-projects/tPostgres,royc1/gpdb,Chibin/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,rubikloud/gpdb,lisakowen/gpdb,xuegang/gpdb,kaknikhil/gpdb,Quikling/gpdb,oberstet/postgres-xl,rvs/gpdb,xuegang/gpdb,ovr/postgres-xl,randomtask1155/gpdb,techdragon/Postgres-XL,royc1/gpdb,CraigHarris/gpdb,chrishajas/gpdb,ahachete/gpdb,50wu/gpdb,Quikling/gpdb,0x0FFF/gpdb,edespino/gpdb,kmjungersen/PostgresXL,janebeckman/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,xuegang/gpdb,cjcjameson/gpdb,pavanvd/postgres-xl,zaksoup/gpdb,foyzur/gpdb,lpetrov-pivotal/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,Chibin/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,royc1/gpdb,arcivanov/postgres-xl,edespino/gpdb,lisakowen/gpdb,foyzur/gpdb,rvs/gpdb,kaknikhil/gpdb,50wu/gpdb,jmcatamney/gpdb,chrishajas/gpdb,rvs/gpdb,greenplum-db/gpdb,foyzur/gpdb,snaga/postgres-xl,Chibin/gpdb,adam8157/gpdb,Quikling/gpdb,arcivanov/postgres-xl,ahachete/gpdb,rvs/gpdb,ashwinstar/gpdb,randomtask1155/gpdb,jmcatamney/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,yuanzhao/gpdb,postmind-net/postgres-xl,Postgres-XL/Postgres-XL,xinzweb/gpdb,Quikling/gpdb,Chibin/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,0x0FFF/gpdb,adam8157/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,0x0FFF/gpdb,janebeckman/gpdb,janebeckman/gpdb,arcivanov/postgres-xl,0x0FFF/gpdb,Postgres-XL/Postgres-XL,50wu/gpdb,ashwinstar/gpdb,lpetrov-pivotal/gpdb,xinzweb/gpdb,ahachete/gpdb,greenplum-db/gpdb,chrishajas/gpdb,snaga/postgres-xl,yuanzhao/gpdb,cjcjameson/gpdb,atris/gpdb,lisakowen/gpdb,kmjungersen/PostgresXL,edespino/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,edespino/gpdb,yuanzhao/gpdb,pavanvd/postgres-xl,adam8157/gpdb,xuegang/gpdb,oberstet/postgres-xl,edespino/gpdb,janebeckman/gpdb,greenplum-db/gpdb