summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariusz Michaluk <d.michaluk@samsung.com>2019-05-14 15:53:58 +0200
committerDariusz Michaluk <d.michaluk@samsung.com>2019-05-14 15:53:58 +0200
commitf28d202efe7074c3d8334c8e577a55b0191e8810 (patch)
tree9b399e782e1b6db4b29ff71e49b1d685d258f23f
parenta9844c2ed624b961164fa1e04ee9691c1c43d895 (diff)
downloadkey-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.tar.gz
key-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.tar.bz2
key-manager-f28d202efe7074c3d8334c8e577a55b0191e8810.zip
Increase backlog for listening sockets
When systemd's socket activaction is utilized, the default backlog parameter passed to the listen() function is set to SOMAXCONN, which is equal to 128. In distributions where systemd is not used for socket activation, the default UNIX socket implementation sets the backlog value to 5. This may lead to rare overflow of an internal connection queue. This manifests itself as the -EAGAIN error returned by connect(). To mitigate the issue, the backlog parameter has been set to SOMAXCONN, which is a default value used by systemd. Change-Id: I906cd4de478b0dac0eaf860550fccd2f9cd6e184
-rw-r--r--src/manager/main/socket-manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/manager/main/socket-manager.cpp b/src/manager/main/socket-manager.cpp
index f3f6e3f..07ce31c 100644
--- a/src/manager/main/socket-manager.cpp
+++ b/src/manager/main/socket-manager.cpp
@@ -617,7 +617,7 @@ int SocketManager::CreateDomainSocketHelp(
umask(originalUmask);
- if (-1 == listen(sockfd, 5)) {
+ if (-1 == listen(sockfd, SOMAXCONN)) {
int err = errno;
close(sockfd);
LogError("Error in listen: " << GetErrnoString(err));