diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-07-06 16:36:48 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2015-07-06 16:36:48 +0300 |
commit | 8e33fc1784cbd657a7238ab5639ee1f8f54a3ec0 (patch) | |
tree | 2afdb33f033645d2ec0d89870d7d9696db6bf602 | |
parent | 4f33621f3f50286e607a3cdcc1f7a7d51075af95 (diff) |
Call getsockopt() on the correct socket.
We're interested in the buffer size of the socket that's connected to the
client, not the one that's listening for new connections. It happened to
work, as default buffer size is the same on both, but it was clearly not
wrong.
Spotted by Tom Lane
-rw-r--r-- | src/backend/libpq/pqcomm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 9f92e4efae7..b27ac952173 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -773,7 +773,7 @@ StreamConnection(pgsocket server_fd, Port *port) * https://msdn.microsoft.com/en-us/library/bb736549%28v=vs.85%29.aspx */ optlen = sizeof(oldopt); - if (getsockopt(server_fd, SOL_SOCKET, SO_SNDBUF, (char *) &oldopt, + if (getsockopt(port->sock, SOL_SOCKET, SO_SNDBUF, (char *) &oldopt, &optlen) < 0) { elog(LOG, "getsockopt(SO_SNDBUF) failed: %m"); |