Skip to content

Commit 8e33fc1

Browse files
committed
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
1 parent 4f33621 commit 8e33fc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/libpq/pqcomm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ StreamConnection(pgsocket server_fd, Port *port)
773773
* https://msdn.microsoft.com/en-us/library/bb736549%28v=vs.85%29.aspx
774774
*/
775775
optlen = sizeof(oldopt);
776-
if (getsockopt(server_fd, SOL_SOCKET, SO_SNDBUF, (char *) &oldopt,
776+
if (getsockopt(port->sock, SOL_SOCKET, SO_SNDBUF, (char *) &oldopt,
777777
&optlen) < 0)
778778
{
779779
elog(LOG, "getsockopt(SO_SNDBUF) failed: %m");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy