Skip to content

Commit

Permalink
Fix pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Dec 9, 2024
1 parent 9341e0a commit 0c2015c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vsock-bridge/include/listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ namespace vsockio
return;
}

if (&_acceptRcvBuf != -1) {
if (_acceptRcvBuf != -1) {
if (setsockopt(clientFd, SOL_SOCKET, SO_RCVBUF, &_acceptRcvBuf, sizeof(int)) < 0)
{
close(clientFd);
throw std::runtime_error("error setting _acceptRcvBuf to SO_RCVBUF");
}
}

if (&_acceptSndBuf != -1) {
if (_acceptSndBuf != -1) {
if (setsockopt(clientFd, SOL_SOCKET, SO_SNDBUF, &_acceptSndBuf, sizeof(int)) < 0)
{
close(clientFd);
Expand Down Expand Up @@ -229,15 +229,15 @@ namespace vsockio
return nullptr;
}

if (&_peerRcvBuf != -1) {
if (_peerRcvBuf != -1) {
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &_peerRcvBuf, sizeof(int)) < 0)
{
close(fd);
throw std::runtime_error("error setting _peerRcvBuf to SO_RCVBUF");
}
}

if (&_peerSndBuf != -1) {
if (_peerSndBuf != -1) {
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &_peerSndBuf, sizeof(int)) < 0)
{
close(fd);
Expand Down

0 comments on commit 0c2015c

Please sign in to comment.