Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a75f928 authored by Yao Chen's avatar Yao Chen
Browse files

Increase the SO_SNDBUF for statsd socket.

In addition to the dgram queue size, the sender buffer size also matters.
Set it to a higher value (default is 224KB).

Test: manual
Change-Id: Ib610c1fa1eaf3c5e36f51854a2b0720f387dc1b8
parent cc563077
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -109,6 +109,11 @@ static int statsdOpen() {
        if (sock < 0) {
            ret = -errno;
        } else {
            int sndbuf = 1 * 1024 * 1024;  // set max send buffer size 1MB
            socklen_t bufLen = sizeof(sndbuf);
            // SO_RCVBUF does not have an effect on unix domain socket, but SO_SNDBUF does.
            // Proceed to connect even setsockopt fails.
            setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &sndbuf, bufLen);
            struct sockaddr_un un;
            memset(&un, 0, sizeof(struct sockaddr_un));
            un.sun_family = AF_UNIX;