libpq can now talk to either 3.0 or 2.0 protocol servers. It first tries
Tom Lane <tgl@sss.pgh.pa.us>
libpq can now talk to either 3.0 or 2.0 protocol servers. It first tries protocol 3, then falls back to 2 if postmaster rejects the startup packet with an old-format error message. A side benefit of the rewrite is that SSL-encrypted connections can now be made without blocking. (I think, anyway, but do not have a good way to test.)
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/libpq/ip.c | modified | +17 −15 |
| src/backend/libpq/pqcomm.c | modified | +8 −9 |
| src/include/libpq/ip.h | modified | +2 −2 |
| src/interfaces/libpq/fe-auth.c | modified | +6 −2 |
| src/interfaces/libpq/fe-connect.c | modified | +429 −328 |
| src/interfaces/libpq/fe-exec.c | modified | +146 −1082 |
| src/interfaces/libpq/fe-misc.c | modified | +47 −24 |
| src/interfaces/libpq/fe-protocol2.c | added | +1239 −0 |
| src/interfaces/libpq/fe-protocol3.c | added | +1247 −0 |
| src/interfaces/libpq/fe-secure.c | modified | +78 −28 |
| src/interfaces/libpq/libpq-fe.h | modified | +10 −8 |
| src/interfaces/libpq/libpq-int.h | modified | +102 −53 |
| src/interfaces/libpq/Makefile | modified | +2 −2 |