diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-02-27 05:36:05 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2009-02-27 05:36:05 +0300 |
commit | a5a3a73bf148397ad672c46e2f34fdde9c02f331 (patch) | |
tree | 601966ed4542056b21720bd3a14045dcca830af8 | |
parent | f56a47f388402c62eef910f3023f091fd6d6b413 (diff) |
Unbreak QoS on Unix
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1592 05730e5d-ab1b-0410-a4ac-84af385074fa
-rw-r--r-- | src/Connection.cpp | 9 | ||||
-rw-r--r-- | src/mumble/ServerHandler.cpp | 4 | ||||
-rw-r--r-- | src/murmur/Server.cpp | 7 | ||||
-rw-r--r-- | src/murmur/UnixMurmur.cpp | 4 |
4 files changed, 15 insertions, 9 deletions
diff --git a/src/Connection.cpp b/src/Connection.cpp index cecb45004..213c2e04d 100644 --- a/src/Connection.cpp +++ b/src/Connection.cpp @@ -84,10 +84,13 @@ void Connection::setToS() { dwFlow = 0; if (! QOSAddSocketToFlow(hQoS, qtsSocket->socketDescriptor(), NULL, QOSTrafficTypeAudioVideo, QOS_NON_ADAPTIVE_FLOW, &dwFlow)) qWarning("Connection: Failed to add flow to QOS"); -#else if defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) int val = 0xa0; - if (setsockopt(qtsSocket->socketDescriptor(), IPPROTO_IP, IP_TOS, &val, sizeof(val))) - log("Server: Failed to set TOS for TCP Socket"); + if (setsockopt(qtsSocket->socketDescriptor(), IPPROTO_IP, IP_TOS, &val, sizeof(val))) { + int val = 0x60; + if (setsockopt(qtsSocket->socketDescriptor(), IPPROTO_IP, IP_TOS, &val, sizeof(val))) + qWarning("Connection: Failed to set TOS for TCP Socket"); + } #endif } diff --git a/src/mumble/ServerHandler.cpp b/src/mumble/ServerHandler.cpp index 643be4fb1..587519975 100644 --- a/src/mumble/ServerHandler.cpp +++ b/src/mumble/ServerHandler.cpp @@ -345,7 +345,7 @@ void ServerHandler::serverConnectionConnected() { #if defined(Q_OS_UNIX) int val = 0xe0; if (setsockopt(qusUdp->socketDescriptor(), IPPROTO_IP, IP_TOS, &val, sizeof(val))) - log("Server: Failed to set TOS for UDP Socket"); + qWarning("ServerHandler: Failed to set TOS for UDP Socket"); #elif defined(Q_OS_WIN) if (hQoS != NULL) { struct sockaddr_in addr; @@ -356,7 +356,7 @@ void ServerHandler::serverConnectionConnected() { dwFlowUDP = 0; if (! QOSAddSocketToFlow(hQoS, qusUdp->socketDescriptor(), reinterpret_cast<sockaddr *>(&addr), QOSTrafficTypeVoice, QOS_NON_ADAPTIVE_FLOW, &dwFlowUDP)) - qWarning("Failed to add UDP to QOS"); + qWarning("ServerHandler: Failed to add UDP to QOS"); } #endif } diff --git a/src/murmur/Server.cpp b/src/murmur/Server.cpp index dd87fc6ec..d6aadc2dd 100644 --- a/src/murmur/Server.cpp +++ b/src/murmur/Server.cpp @@ -123,8 +123,11 @@ Server::Server(int snum, QObject *p) : QThread(p) { } else { #ifdef Q_OS_UNIX int val = 0xe0; - if (setsockopt(sUdpSocket, IPPROTO_IP, IP_TOS, &val, sizeof(val))) - log("Server: Failed to set TOS for UDP Socket"); + if (setsockopt(sUdpSocket, IPPROTO_IP, IP_TOS, &val, sizeof(val))) { + int val = 0x80; + if (setsockopt(sUdpSocket, IPPROTO_IP, IP_TOS, &val, sizeof(val))) + log("Server: Failed to set TOS for UDP Socket"); + } #endif } } diff --git a/src/murmur/UnixMurmur.cpp b/src/murmur/UnixMurmur.cpp index 2d8a149d4..d6fd5d6df 100644 --- a/src/murmur/UnixMurmur.cpp +++ b/src/murmur/UnixMurmur.cpp @@ -227,7 +227,7 @@ void UnixMurmur::setuid() { void UnixMurmur::initialcap() { #ifdef Q_OS_LINUX - cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE, CAP_SYS_RESOURCE, CAP_SETUID, CAP_SETGID }; + cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE, CAP_SYS_RESOURCE, CAP_NET_ADMIN, CAP_SETUID, CAP_SETGID }; if (! bRoot) return; @@ -250,7 +250,7 @@ void UnixMurmur::initialcap() { void UnixMurmur::finalcap() { #ifdef Q_OS_LINUX - cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE }; + cap_value_t caps[] = {CAP_DAC_OVERRIDE, CAP_SYS_NICE, CAP_NET_ADMIN }; if (! bRoot) return; |