Browse Source

[master] Print buffer size passed to setsockopt()

This will be useful in debugging the OpenBSD setsockopt() failures.
Mukund Sivaraman 12 years ago
parent
commit
8a33926d26
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/lib/util/io/socketsession.cc

+ 5 - 2
src/lib/util/io/socketsession.cc

@@ -163,7 +163,9 @@ SocketSessionForwarder::connectToReceiver() {
         if (setsockopt(impl_->fd_, SOL_SOCKET, SO_SNDBUF, &SOCKSESSION_BUFSIZE,
                        sizeof(SOCKSESSION_BUFSIZE)) == -1) {
             close();
-            isc_throw(SocketSessionError, "Failed to set send buffer size");
+            isc_throw(SocketSessionError,
+                      "Failed to set send buffer size to " <<
+                          SOCKSESSION_BUFSIZE);
         }
     }
     if (connect(impl_->fd_, convertSockAddr(&impl_->sock_un_),
@@ -286,7 +288,8 @@ struct SocketSessionReceiver::ReceiverImpl {
         if (setsockopt(fd_, SOL_SOCKET, SO_RCVBUF, &SOCKSESSION_BUFSIZE,
                        sizeof(SOCKSESSION_BUFSIZE)) == -1) {
             isc_throw(SocketSessionError,
-                      "Failed to set receive buffer size");
+                      "Failed to set receive buffer size to " <<
+                          SOCKSESSION_BUFSIZE);
         }
     }