mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
basic loop connection detection. prevent if you configure forward to 127.0.0.1:<port> and your server has the same port.
But this doesn't protect if not forwarded to localhost "127.0.0.1". Loop connections across different hosts arn't detected too. Former-commit-id: 464a80708ebd11c0f7c83dc87a1afe0f10e0e078
This commit is contained in:
@@ -18,6 +18,10 @@ ProtoServer::ProtoServer(Hyperion *hyperion, uint16_t port) :
|
||||
QStringList slaves = forwarder->getProtoSlaves();
|
||||
|
||||
for (int i = 0; i < slaves.size(); ++i) {
|
||||
if ( QString("127.0.0.1:%1").arg(port) == slaves.at(i) ) {
|
||||
throw std::runtime_error("Loop between proto server and forwarder detected. Fix your config!");
|
||||
}
|
||||
|
||||
ProtoConnection* p = new ProtoConnection(slaves.at(i).toLocal8Bit().constData());
|
||||
p->setSkipReply(true);
|
||||
_proxy_connections << p;
|
||||
|
Reference in New Issue
Block a user