[Libreoffice-commits] online.git: wsd/LOOLWSD.cpp
Aron Budea (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 18 09:44:16 UTC 2020
wsd/LOOLWSD.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 4e2e2f22c6f199e2afda4d9509b7795a2f4d7c09
Author: Aron Budea <aron.budea at collabora.com>
AuthorDate: Thu Jun 18 07:27:08 2020 +0200
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Thu Jun 18 11:43:57 2020 +0200
wsd: Don't try to resolve an accepted IP address
...and pollute the logs with warnings if it fails.
Change-Id: I71828205b8d020287f5b6d0bb82feb17c2fdd2f7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96567
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index c77c49152..5c77a8a12 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2211,14 +2211,17 @@ public:
addressToCheck = Util::trim(param);
try
{
- hostToCheck = Poco::Net::DNS::resolve(addressToCheck).name();
- allow &= allowPostFrom(addressToCheck) || StorageBase::allowedWopiHost(hostToCheck);
+ if (!allowPostFrom(addressToCheck))
+ {
+ hostToCheck = Poco::Net::DNS::resolve(addressToCheck).name();
+ allow &= StorageBase::allowedWopiHost(hostToCheck);
+ }
}
catch (const Poco::Exception& exc)
{
LOG_WRN("Poco::Net::DNS::resolve(\"" << addressToCheck << "\") failed: " << exc.displayText());
- // We can't find out the hostname, check the IP only
- allow &= allowPostFrom(addressToCheck);
+ // We can't find out the hostname, and it already failed the IP check
+ allow = false;
}
if(!allow)
{
More information about the Libreoffice-commits
mailing list