Update the Winsock API version requested by libpq.
authorTom Lane <[email protected]>
Sun, 18 Oct 2020 16:56:43 +0000 (12:56 -0400)
committerTom Lane <[email protected]>
Sun, 18 Oct 2020 16:56:43 +0000 (12:56 -0400)
According to Microsoft's documentation, 2.2 has been the current
version since Windows 98 or so.  Moreover, that's what the Postgres
backend has been requesting since 2004 (cf commit 4cdf51e64).
So there seems no reason for libpq to keep asking for 1.1.

Bring thread_test along, too, so that we're uniformly asking for 2.2
in all our WSAStartup calls.

It's not clear whether there's any point in back-patching this,
so for now I didn't.

Discussion: https://postgr.es/m/132799.1602960277@sss.pgh.pa.us

src/interfaces/libpq/fe-connect.c
src/test/thread/thread_test.c

index 704c9e2f79f82483dadc14d8a8bc8d554451c35a..b0ca37c2ed81b3d5fcde105ba9ba8be5c858dbc8 100644 (file)
@@ -3883,7 +3883,7 @@ makeEmptyPGconn(void)
    {
        WSADATA     wsaData;
 
-       if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
+       if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
            return NULL;
        wsastartup_done = true;
    }
index e1bec01b81ad78eae5a5131c1b9e05d04c7e950d..09603c95dd683d45774b4c4e2c3ffb0c9e72a442 100644 (file)
@@ -126,7 +126,7 @@ main(int argc, char *argv[])
 #endif
 
 #ifdef WIN32
-   err = WSAStartup(MAKEWORD(1, 1), &wsaData);
+   err = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (err != 0)
    {
        fprintf(stderr, "Cannot start the network subsystem - %d**\nexiting\n", err);