mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user