summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2020-06-18 07:27:08 +0200
committerAndras Timar <andras.timar@collabora.com>2020-06-18 14:20:19 +0200
commit5e73cf4d47b2c023f266ce5bc1c3b7df5617830b (patch)
treedb36c20198b6ef86a5c47bea04fe5594ac5bdf0b
parentonline: fix io error on saveas (diff)
downloadonline-5e73cf4d47b2c023f266ce5bc1c3b7df5617830b.tar.gz
online-5e73cf4d47b2c023f266ce5bc1c3b7df5617830b.zip
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@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit c76531061e3a9e1c13c6b6484a88059e8335caa1) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96585 Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--wsd/LOOLWSD.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 93858ad281..d15e259020 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2208,14 +2208,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)
{