diff options
author | Wolfgang Müller | 2022-01-08 12:28:40 +0000 |
---|---|---|
committer | Wolfgang Müller | 2022-01-08 12:30:19 +0000 |
commit | 6347ecae61c07b2879719710f279e053f1acb83e (patch) | |
tree | 55c1adc722226117cf3dad98b8ecc56be1903778 | |
parent | ebec697dc1cffeea4e8cd60209a750d1e1412e43 (diff) | |
download | portage-roles-6347ecae61c07b2879719710f279e053f1acb83e.tar.gz |
service-quasselcore: Drop bind-host patch
We no longer need this particular patch, plus it most likely wouldn't
apply to 0.14.0 anyway.
-rw-r--r-- | service-quasselcore/patches/net-irc/quassel/quassel-bind-host.patch | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/service-quasselcore/patches/net-irc/quassel/quassel-bind-host.patch b/service-quasselcore/patches/net-irc/quassel/quassel-bind-host.patch deleted file mode 100644 index 2bf8726..0000000 --- a/service-quasselcore/patches/net-irc/quassel/quassel-bind-host.patch +++ /dev/null @@ -1,116 +0,0 @@ -diff --git a/src/common/main.cpp b/src/common/main.cpp -index 0ee13ecd..2df950a0 100644 ---- a/src/common/main.cpp -+++ b/src/common/main.cpp -@@ -185,6 +185,7 @@ int main(int argc, char **argv) - #ifndef BUILD_QTUI - // put core-only arguments here - cliParser->addOption("listen", 0, "The address(es) quasselcore will listen on", "<address>[,<address>[,...]]", "::,0.0.0.0"); -+ cliParser->addOption("bind-host", 0, "The address quasselcore will make outgoing connections from.", "address", ""); - cliParser->addOption("port", 'p', "The port quasselcore will listen at", "port", "4242"); - cliParser->addSwitch("norestore", 'n', "Don't restore last core's state"); - cliParser->addSwitch("config-from-environment", 0, "Load configuration from environment variables"); -diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp -index fa8ae9bf..af335e1f 100644 ---- a/src/core/corenetwork.cpp -+++ b/src/core/corenetwork.cpp -@@ -22,6 +22,7 @@ - - #include <QDebug> - #include <QHostInfo> -+#include <QHostAddress> - - #include "core.h" - #include "coreidentity.h" -@@ -244,6 +245,76 @@ void CoreNetwork::connectToIrc(bool reconnecting) - displayStatusMsg(tr("Connecting to %1:%2...").arg(server.host).arg(server.port)); - displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Connecting to %1:%2...").arg(server.host).arg(server.port)); - -+ QHostInfo targetinfo; -+ -+ // Qt caches DNS entries for a minute, resulting in round-robin (e.g. for chat.freenode.net) not working if several users -+ // connect at a similar time. QHostInfo::fromName(), however, always performs a fresh lookup, overwriting the cache entry. -+ if (! server.useProxy) { -+ //Avoid hostname lookups when a proxy is specified. The lookups won't use the proxy and may therefore leak the DNS -+ //hostname of the server. Qt's DNS cache also isn't used by the proxy so we don't need to refresh the entry. -+ //TODO: don't do this twice if bind-host is set -+ targetinfo = QHostInfo::fromName(server.host); -+ } else if (Quassel::isOptionSet("bind-host")) { -+ qWarning() << tr("bind-host not supported if proxy is set"); -+ } -+ -+ if (!server.useProxy && Quassel::isOptionSet("bind-host")) { -+ QHostAddress hostaddr = QHostAddress(); -+ QString bindaddr = Quassel::optionValue("bind-host"); -+ -+ QHostInfo bindinfo = QHostInfo::fromName(bindaddr); -+ -+ if (bindinfo.error() != QHostInfo::NoError) { -+ qWarning() << qPrintable(tr("Could not look up bind host \"%1\": %2").arg(bindaddr).arg(bindinfo.errorString())); -+ } else if (targetinfo.error() != QHostInfo::NoError) { -+ qWarning() << qPrintable(tr("Could not look up server host %1").arg(targetinfo.errorString())); -+ } else { -+ QHostAddress baddr4 = QHostAddress(); -+ QHostAddress baddr6 = QHostAddress(); -+ for (int i = 0; i < bindinfo.addresses().size(); i++) { -+ if (!baddr4.isNull() && !baddr6.isNull()) { -+ break; -+ } -+ if (baddr4.isNull() && bindinfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) { -+ baddr4 = bindinfo.addresses()[i]; -+ } -+ if (baddr6.isNull() && bindinfo.addresses()[i].protocol() == QAbstractSocket::IPv6Protocol) { -+ baddr6 = bindinfo.addresses()[i]; -+ } -+ } -+ -+ QHostAddress taddr4 = QHostAddress(); -+ QHostAddress taddr6 = QHostAddress(); -+ for (int i = 0; i < targetinfo.addresses().size(); i++) { -+ if (!taddr4.isNull() && !taddr6.isNull()) { -+ break; -+ } -+ if (taddr4.isNull() && targetinfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) { -+ taddr4 = targetinfo.addresses()[i]; -+ } -+ if (taddr6.isNull() && targetinfo.addresses()[i].protocol() == QAbstractSocket::IPv6Protocol) { -+ taddr6 = targetinfo.addresses()[i]; -+ } -+ } -+ -+ QHostAddress bind = QHostAddress(); -+ if (!baddr6.isNull() && !taddr6.isNull()) { -+ bind = baddr6; -+ } else if (!baddr4.isNull() && !taddr4.isNull()) { -+ bind = baddr4; -+ } else { -+ qWarning() << tr("Mismatched bind-host and server family."); -+ } -+ -+ if (!bind.isNull()) { -+ qWarning() << qPrintable(tr("Binding to %1").arg(bind.toString())); -+ if (!socket.bind(bind)) { -+ qWarning() << qPrintable(tr("Could not bind to %1").arg(bind.toString())); -+ } -+ } -+ } -+ } -+ - if (server.useProxy) { - QNetworkProxy proxy((QNetworkProxy::ProxyType)server.proxyType, server.proxyHost, server.proxyPort, server.proxyUser, server.proxyPass); - socket.setProxy(proxy); -@@ -256,14 +327,6 @@ void CoreNetwork::connectToIrc(bool reconnecting) - - // Reset tracking for valid timestamps in PONG replies - setPongTimestampValid(false); -- -- // Qt caches DNS entries for a minute, resulting in round-robin (e.g. for chat.freenode.net) not working if several users -- // connect at a similar time. QHostInfo::fromName(), however, always performs a fresh lookup, overwriting the cache entry. -- if (! server.useProxy) { -- //Avoid hostname lookups when a proxy is specified. The lookups won't use the proxy and may therefore leak the DNS -- //hostname of the server. Qt's DNS cache also isn't used by the proxy so we don't need to refresh the entry. -- QHostInfo::fromName(server.host); -- } - #ifdef HAVE_SSL - if (server.useSsl) { - CoreIdentity *identity = identityPtr(); |