Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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)