From: Mukund Sivaraman Date: Thu, 23 Aug 2012 04:08:15 +0000 (+0530) Subject: [master] Print buffer size passed to setsockopt() X-Git-Tag: trac2351_base~115^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a33926d267c2d96b968136f8ae14e6e15cb00d2;p=thirdparty%2Fkea.git [master] Print buffer size passed to setsockopt() This will be useful in debugging the OpenBSD setsockopt() failures. --- diff --git a/src/lib/util/io/socketsession.cc b/src/lib/util/io/socketsession.cc index 4c509493d5..ba4e6c7f83 100644 --- a/src/lib/util/io/socketsession.cc +++ b/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); } }