MCPcopy Create free account
hub / github.com/aria2/aria2 / applySocketBufferSize

Function applySocketBufferSize

src/SocketCore.cc:179–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178namespace {
179void applySocketBufferSize(sock_t fd)
180{
181 auto recvBufSize = SocketCore::getSocketRecvBufferSize();
182 if (recvBufSize == 0) {
183 return;
184 }
185
186 if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (a2_sockopt_t)&recvBufSize,
187 sizeof(recvBufSize)) < 0) {
188 auto errNum = SOCKET_ERRNO;
189 A2_LOG_WARN(fmt("Failed to set socket buffer size. Cause: %s",
190 errorMsg(errNum).c_str()));
191 }
192}
193} // namespace
194
195void SocketCore::create(int family, int protocol)

Callers 4

createMethod · 0.85
bindInternalFunction · 0.85
acceptConnectionMethod · 0.85
establishConnectionMethod · 0.85

Calls 2

fmtFunction · 0.85
errorMsgFunction · 0.85

Tested by

no test coverage detected